Jump to content

A18: Distributing custom prefabs with XML modlets


khzmusik

Recommended Posts

Is this possible to do without others having to copy files by hand? Either by including them in the Mods folder, though the Mod Launcher, or some other way?

 

I tried putting the prefabs into the Mods/<My Mod Name>/Prefabs folder (as a sibling of Config, as they are in the base game's Data folder), on the hopes that it would "just work." Unsurprisingly it doesn't.

 

My use case: I created XML that specifies spawn groups that spawn Xyth's NPCs, and modified a couple existing POIs to use them with their sleeper volumes. When everything's ready, I'd like to share them, but obviously neither will work without the other.

 

If it's not possible to do this automagically, what are the conventions for distributing them together? This really is a "modlet" and not an overhaul, and I'd like to distribute it as such.

 

Sorry if this has been asked before, I searched but didn't find anything.

Link to comment
Share on other sites

You can use them in a modlet. It will have to have a rwgmixer.xml in the Config folder. In the mixer you will use a path to point to your modlet's Prefabs folder. Like:

 

<append xpath="/rwgmixer/prefab_rules/prefab_rule[@name='commercialGroup']">    
       <prefab name="././Mods/YOURMOD/Prefabs/YOURPREFABNAME" prob="0.5"/>
</append>

 

as an example. *There should be an extra . in ././Mods so there is two instead of one, but for some reason the forum won't let me post it. You can check the attached xml for the correct code.*

rwgmixer.zip

Link to comment
Share on other sites

You can use them in a modlet. It will have to have a rwgmixer.xml in the Config folder. In the mixer you will use a path to point to your modlet's Prefabs folder. Like:

 

<append xpath="/rwgmixer/prefab_rules/prefab_rule[@name='commercialGroup']">    
       <prefab name="././Mods/YOURMOD/Prefabs/YOURPREFABNAME" prob="0.5"/>
</append>

 

as an example. *There should be an extra . in ././Mods so there is two instead of one, but for some reason the forum won't let me post it. You can check the attached xml for the correct code.*

 

Oh, I had no idea that you could put a relative path in the "name" attribute. That's great, thank you.

 

(Of course, I'll still have to put in-progress prefabs in the main 7D2D Prefabs folder, and transfer them to the mod's folder when finished. But that's nobody's problem but mine.)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...