Repository navigation
Stop wheels and other subgrids counting as separate NPCs in area spawn limits - #468
Closed
Blaylock1988 wants to merge 4 commits into
Closed
Blaylock1988 wants to merge 4 commits into
Blaylock1988 wants to merge 4 commits into
Conversation
Contributor
Author
|
GetGroup(Mechanical) can't help in GridsSpawned, because no top part has attached yet when it runs, so every grid is still alone in its group. But each rotor, hinge, piston and suspension already holds the ID of the top it's about to attach (TopBlockId, which the prefab spawn remaps along with the top). So now it only skips a grid if one of its top parts belongs to a base on another grid. Decorative tops have no base pointing at them, so their grid keeps the NpcData. Separate grids like the dropship's vehicles on connectors or landing gear still get their own. |
Contributor
Author
|
closing as agreed to in discord. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since 9ea651c, each wheel, rotor head, hinge top and piston top of an MES spawn gets the spawn's NpcData and counts toward the area spawn limit, so a rover with four wheels counts as five spawns. These are the four "Small Grid" entries next to the Tire Thieves Shikari in your GESAP output. The Entity List hides them because it only lists the root grid of a mechanical group.
GridsSpawned runs before suspensions, rotors and pistons attach their top parts, so GetBiggestGridInGroup returns each top-part grid itself:
Modular-Encounters-Systems/Data/Scripts/ModularEncountersSystems/Spawning/PrefabSpawner.cs
Lines 349 to 363 in 88ebcf0
Change
Testing
Single player only. Three rovers (a body plus 4 wheels each) in one Planetary Installation spawn group: GESAP counted 15 before the change and 3 after, on the same save. A new spawn added 3, and its wheels show as OtherNPC.
Retested with the grouping: a Chad Shuttle, whose main grid has decorative top parts, keeps its spawn data, and so do the rover bodies; their wheels show as OtherNPC. Same after a reload.