ASharpPen / Valheim.SpawnThat

The Unlicense
12 stars 6 forks source link

Help with brains and skulls in Mistlands please? #191

Open Oosquai opened 10 months ago

Oosquai commented 10 months ago

Hi there! Love this mod - I'm using it to respawn mining nodes for slower players on my server who otherwise get left with scraps after the more aggressive players have moved through an area. I'm struggling in the Mistlands though. I can spawn skulls. I can spawn brains. How do I get the brains to spawn inside the skulls?

Here's what I have so far (and 19906 for giant_brain), but of course they don't spawn together: [WorldSpawner.19905] Name=MineRock_Skull Enabled=True Biomes=Mistlands PrefabName=giant_skull MaxSpawned=1 SpawnInterval=360000 SpawnChance=25 SpawnDistance=100 GroundOffset=-5 SpawnDuringDay=True SpawnDuringNight=True ConditionAltitudeMin=5 ConditionAltitudeMax=1000 SpawnInForest=True SpawnOutsideForest=True

Any suggestions please? Thank you!

ASharpPen commented 10 months ago

Hm, only one prefab is supported spawned pr spawning template, so it isn't really possible to group them up like that unless you build a custom prefab for it (which has its own complications).

You could try to just make them spawn only in positions near the skull though. Not sure how well it would work, you would have to test it out. This can be done by adding the following options to your giant brain spawner:

ConditionPositionMustBeNearPrefabs = giant_skull
ConditionPositionMustBeNearPrefabsDistance = 1

Positional conditions can be a bit fiddly, since the game will try up to 20 random positions pr spawning attempt, so if your conditions are too strict (like a distance of exactly 0) it may never successfully find a spot.

Oosquai commented 10 months ago

Awesome, thanks so much for the tips. I'll try this tonight!

Oosquai commented 10 months ago

This is mostly working! I found I had better luck getting brains to spawn with ConditionPositionMustBeNearPrefabsDistance = 5, and I also found I had to remove the SpawnDistance constraint. The brains are now spawning with at least some portion of them clipping into the skulls... I call that a win! Thank you so much for the awesome power of SpawnThat and DropThat, and for the help!

ASharpPen commented 10 months ago

Glad to hear! And thanks for the kind words :)

If you get unhappy with your current solution, you can also take a look at Upgrade World and Cron Job from Jere. I am not really familiar with the details, but I believe those should be able to reset locations / vegetation completely in your world.

Oosquai commented 10 months ago

Oh good call! Nice to have a backup. We'll try this way for a few and see how it goes, but thanks for the alternative idea. Happy adventuring!