Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordinated Spawns (Purple Edition) #531

Conversation

MrPurple6411
Copy link
Member

Changes made in this pull request

  • Moved spawn creation to OnBatchFullyLoaded patch
  • Preload unspawned prefabs during initialization postfix to ensure speedy spawning later.

Copy link
Member

@Metious Metious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this pull request, I'm now getting an NRE first that goes like the following:

[Error  : Unity Log] NullReferenceException
Stack trace:
CellManager.RegisterCellEntity (LargeWorldEntity ent) (at <9ec6c1b62c324758b9c2d79021505be6>:0)
CellManager.RegisterEntity (LargeWorldEntity lwe) (at <9ec6c1b62c324758b9c2d79021505be6>:0)
Nautilus.MonoBehaviours.EntitySpawner+<>c__DisplayClass2_0.<SpawnAsync>b__0 () (at <c13f3a3dfa5c494f9fd922a160750b0b>:0)
UnityEngine.WaitUntil.get_keepWaiting () (at <bd0d47c27bd84106afaaecc2c74cdb94>:0)
UnityEngine.CustomYieldInstruction.MoveNext () (at <bd0d47c27bd84106afaaecc2c74cdb94>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <bd0d47c27bd84106afaaecc2c74cdb94>:0)

Then I end up with my object infinitely spawning.
image

This PR is not done yet. I'm converting it to a draft to prevent accidental merges.

Nautilus/MonoBehaviours/EntitySpawner.cs Outdated Show resolved Hide resolved
@Metious Metious marked this pull request as draft January 15, 2024 09:52
Copy link
Member

@Metious Metious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine on my tests

@Metious Metious marked this pull request as ready for review January 19, 2024 21:04
@LeeTwentyThree LeeTwentyThree merged commit 60cff24 into SubnauticaModding:master Jan 22, 2024
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants