Jump to content

How to make a custom prefab appear in a random world


Recommended Posts

I've created a prefab I want to be spawned in random worlds.


In the "Prefab Properties" I set the "Group" to "Wilderness", as I don't want it to spawn in any city.

I also set it to only be allowed in the "pine_forest" biome in the %prefabname%.xml file (I actually did this from the UI, but I forgot where :)):


<property name="AllowedBiomes" value="pine_forest" />


I've also created an XPath config file to try to insert it into the world with a probability of 100% to ensure it is spawn:


<append xpath="/rwgmixer/prefab_rule[@name='wildernessGroup']">
	<prefab name="%prefabname%" min_count="1" max_count="1" prob="10"/>


But when I generated a new world the prefab was nowhere to be found!


So, how can I add a custom prefab to random worlds?

Link to comment
Share on other sites

<prefab_rule name="traderGroup"> <!-- Wilderness Zone groups -->

<prefab name="settlement_trader_01" prob="0.25"/>

<prefab name="settlement_trader_02" prob="0.25"/>

<prefab name="settlement_trader_03" prob="0.25"/>

<prefab name="settlement_trader_04" prob="0.25"/>

<prefab name="settlement_trader_05" />


Original rgwmixer lines

Link to comment
Share on other sites

Yes, but there's also this in rgwmixer.xml:


<prefab_rule name="wildernessGroup">
   <prefab name="settlement_trader_01" min_count="1" max_count="1" prob="2" min_repeat_distance="800"/>


I'll give setting prob to 1 a try, though.




No luck with prob="1". My prefab is still nowhere to be found in prefabs.xml in the newly generated world.




I noticed this in the debug log:


WRN XML patch for "rgwmixer.xml" from mod MyMod did not apply: <append xpath="/rwgmixer/prefab_rule[@name=wildernessGroup]"


Which is probably a contributing factor, but I can't see what's wrong with my XML that gives this error

Link to comment
Share on other sites

Hmm. It looks good to me.


<append xpath="/rwgmixer/prefab_rules/prefab_rule[@name=wildernessGroup]">

<prefab name="Nuka_Factory_Vanilla" min_count="0" max_count="1" prob=".04" min_repeat_distance="5000"/>



That's what I used for mine. Obviously it's supposed to be rare. Maybe try, in the editor, add it back to all the biomes and stuff. And then in the mixer just add it to wilderness. Do away with just limiting it to the pine forest or whatever.


Also, what map size were you using to test?

Link to comment
Share on other sites

Thanks to your XML I could find the error in mine. I'm missing the "prefab_rules" in the middle. When I added that and generated a new world my base was in it (in the pine forest) :)


Thanks for the input! :D

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...