• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

How to make a custom prefab appear in a random world

Muriel

New member
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 :) ):

Code:
<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:

Code:
<configs>
<append xpath="/rwgmixer/prefab_rule[@name='wildernessGroup']">
	<prefab name="%prefabname%" min_count="1" max_count="1" prob="10"/>
</append>
</configs>
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?

 
I don´t know exact how it is correct, but i think the prob should be max 1 (=100%)

Give it a value of between 0.01 - 1

 
<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" />

</prefab_rule>

Original rgwmixer lines

 
Last edited by a moderator:
Yes, but there's also this in rgwmixer.xml:

Code:
<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.

EDIT:

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

EDIT 2:

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

 
Last edited by a moderator:
Is your file actually called rgwmixer as the log states? Should be rwgmixer.

If you haven't sorted it by the time I get a chance to look, I'll see what my code for mine was.

 
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"/>

</append>
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?

 
Last edited by a moderator:
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

 
Back
Top