Jump to content

Need help to make modlet to add prefabs to RWGmixer.xml


Cirion

Recommended Posts

I'm still really bad with modlets.

 

Would anyone be willing to share a brief sample modlet with me to explain how its done? Just a simple one-two liner to show how to add, let's call it, "SamplePrefab" (a prefab called SamplePrefab made from the prefab editor) to a new RWG.

 

Thanks!

Link to comment
Share on other sites

Answered my own question. If anyone else is curious here is sample code

 

<config>

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

<prefab name="xcostum_Public_Pool(by_Warsaken)" max_count="100"/>

</append>

 

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

<prefab name="xcostum_Public_Pool(by_Warsaken)" max_count="100"/>

</append>

 

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

<prefab name="xcostum_Public_Pool(by_Warsaken)" max_count="100"/>

</append>

 

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

<prefab name="xcostum_Public_Pool(by_Warsaken)" max_count="100"/>

</append>

 

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

<prefab name="xcostum_Public_Pool(by_Warsaken)" max_count="100"/>

</append>

</config>

 

(set it to 100 so I could be sure to easily find it lol)

Link to comment
Share on other sites

Hi Cirion,

 

Where would the actual prefab "xcostum_Public_Pool(by_Warsaken)" need to go? Logic would say, that one would just toss it in the prefabs folder. However, can it be contained and referenced from within a prefabs folder in the modlet itself, for neatness and possible clean distribution to the community?

 

I ask because I'm finally learning xpath, after years of bleary eyed butchering of code.

Link to comment
Share on other sites

After more experimentation I need some help after all.

 

I made my own POI "FortKNOX" but when I try to use the same method as a POI someone else made (previous code) it doesn't seem to work. I expect some setting in FortKNOX.XML is broken or something.

 

Here is what I have written in it

 

<?xml version="1.0" encoding="UTF-8"?>

<prefab>

<property name="CopyAirBlocks" value="True" />

<property name="Zoning" value="any" />

<property name="AllowedTownships" value="any" />

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

<property name="ExcludeDistantPOIMesh" value="False" />

<property name="ExcludePOICulling" value="False" />

<property name="DistantPOIYOffset" value="0" />

<property name="AllowTopSoilDecorations" value="False" />

<property name="EditorGroups" value="Wilderness" />

<property name="DifficultyTier" value="1" />

<property name="TraderArea" value="False" />

</prefab>

 

BTW it does not have any zombies in it. Before you wonder why no sleeper zombie settings.

 

- - - Updated - - -

 

Hi Cirion,

 

Where would the actual prefab "xcostum_Public_Pool(by_Warsaken)" need to go? Logic would say, that one would just toss it in the prefabs folder. However, can it be contained and referenced from within a prefabs folder in the modlet itself, for neatness and possible clean distribution to the community?

 

I ask because I'm finally learning xpath, after years of bleary eyed butchering of code.

 

Not sure yet... possibly. I'm trying to learn the basics first before I try that tho haha

Link to comment
Share on other sites

Afaik it would need to be in data/prefabs, BUT, since mods/modname/worlds now works, I wonder if /prefabs can be there too.

 

Y'all should test. :)

 

It might be interesting to see Guppy.

 

After more experimentation I need some help after all.

 

I made my own POI "FortKNOX" but when I try to use the same method as a POI someone else made (previous code) it doesn't seem to work. I expect some setting in FortKNOX.XML is broken or something.

 

Here is what I have written in it

 

<?xml version="1.0" encoding="UTF-8"?>

<prefab>

<property name="CopyAirBlocks" value="True" />

<property name="Zoning" value="any" />

<property name="AllowedTownships" value="any" />

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

<property name="ExcludeDistantPOIMesh" value="False" />

<property name="ExcludePOICulling" value="False" />

<property name="DistantPOIYOffset" value="0" />

<property name="AllowTopSoilDecorations" value="False" />

<property name="EditorGroups" value="Wilderness" />

<property name="DifficultyTier" value="1" />

<property name="TraderArea" value="False" />

</prefab>

 

BTW it does not have any zombies in it. Before you wonder why no sleeper zombie settings.

 

- - - Updated - - -

 

 

 

Not sure yet... possibly. I'm trying to learn the basics first before I try that tho haha

 

It's all cool man. I was looking for a more elegant solution to just throwing custom prefabs into the prefabs folder myself. I'm not a prefab builder so my help on your issue would be limited.

 

A basic understand can be garnished with simple trial and error. Just make copies of the files you are working with and tinker away. If it works and does what you intend, go xpath.

 

Best of luck

Link to comment
Share on other sites

good call, copied another one that works line for line except the Sleeper lines (since no zombies) now it works

 

ZERO clue what line it needed but don't care it works haha

 

<?xml version="1.0" encoding="UTF-8"?>

<prefab>

<property name="CopyAirBlocks" value="True"/>

<property name="AllowTopSoilDecorations" value="False"/>

<property name="TraderArea" value="False"/>

<property name="ExcludeDistantPOIMesh" value="False"/>

<property name="ExcludePOICulling" value="False"/>

<property name="DifficultyTier" value="2"/>

<property name="Zoning" value="Commercial,Downtown,Industrial,ResidentialNew,ResidentialOld"/>

<property name="RotationToFaceNorth" value="1"/>

<property name="YOffset" value="0"/>

<property name="DistantPOIYOffset" value="0"/>

<property name="StaticSpawner.Size" value="32, 2, 32"/>

<property name="AllowedBiomes" value="burnt_forest,snow,plains,pine_forest,forest,desert,wasteland"/>

<property name="AllowedTownships" value="city,rural,town,wilderness"/>

<property name="EditorGroups" value="Wilderness"/>

</prefab>

Link to comment
Share on other sites

good call, copied another one that works line for line except the Sleeper lines (since no zombies) now it works

 

ZERO clue what line it needed but don't care it works haha

 

<?xml version="1.0" encoding="UTF-8"?>

<prefab>

<property name="CopyAirBlocks" value="True"/>

<property name="AllowTopSoilDecorations" value="False"/>

<property name="TraderArea" value="False"/>

<property name="ExcludeDistantPOIMesh" value="False"/>

<property name="ExcludePOICulling" value="False"/>

<property name="DifficultyTier" value="2"/>

<property name="Zoning" value="Commercial,Downtown,Industrial,ResidentialNew,ResidentialOld"/>

<property name="RotationToFaceNorth" value="1"/>

<property name="YOffset" value="0"/>

<property name="DistantPOIYOffset" value="0"/>

<property name="StaticSpawner.Size" value="32, 2, 32"/>

<property name="AllowedBiomes" value="burnt_forest,snow,plains,pine_forest,forest,desert,wasteland"/>

<property name="AllowedTownships" value="city,rural,town,wilderness"/>

<property name="EditorGroups" value="Wilderness"/>

</prefab>

 

That's great news! I love new players who are interested in building prefabs. We all benefit from their creations at some point. :encouragement:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...