Editing the starting scenario

Started by apljee, March 11, 2015, 04:46:38 PM

Previous topic - Next topic

apljee

Is it possible to edit the starting scenario through XML code? Or will I have to man up and start using C#? I'm really just looking to edit the following of the starting colonists:

- Clothes
- Weapons
- Materials

ItchyFlea

You'll have to use C# for the colonists, and insert your changes into the MapGenerators.XML file, replacing <li Class="Genstep_Colonists" /> with your own.
Starting materials and weapons can be modified/added with XML. (The 3 starting weapons are a bit tricky but can be modified with XML. Probably easier to use C# for them though.)
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

apljee

(Kinda late reply, even though only one day.)
How would this be done (really only interested in editing the starting weapons and items, for now) I'll take a tutorial on the easiest route for both of them because I don't want things to get too hard before I have to get knee-deep in C# and XML.

ItchyFlea

I'm terrible with writing tutorials. Hopefully this makes sense:

Modify this file: \Defs\MapGeneratorDefs\MapGenerators.xml
If you want a new material to be strewn around the map like Steel and Silver is when you start a new colony, you'd use this code:

<li Class="Genstep_ScatterThingGroups">
<thingDefs>
<li>Steel</li>
</thingDefs>
<minSpacing>15</minSpacing>
<countPer10kCellsRange>
<min>1.4</min>
<max>1.4</max>
</countPer10kCellsRange>
<spotMustBeStandable>true</spotMustBeStandable>
<groupSizeRange>
<min>3</min>
<max>6</max>
</groupSizeRange>
<stackCountRange>
<min>40</min>
<max>60</max>
</stackCountRange>
</li>


If you want it appearing near your colonists like wood does, you'd use this code:
<li Class="Genstep_ScatterThingGroups">
<thingDefs>
<li>Steel</li>
</thingDefs>
<spotMustBeStandable>true</spotMustBeStandable>
<groupSizeRange>
<min>6</min>
<max>6</max>
</groupSizeRange>
<stackCountRange>
<min>40</min>
<max>60</max>
</stackCountRange>
<countAtPlayerStart>1</countAtPlayerStart>
</li>


You can do the same thing to have weapons laying about.

Modifying the starting weapons would probably be easier and not a hack if done via C# code.
I haven't tried it in A9 since the MapGenerator was returned, but in the past what I did was replace the weapon definition with that of a grass that had a lifespan of a couple of seconds and no chance of spreading seeds around.
What I then did was re-add the weapon using a different defname, so that the weapon existed, but didn't spawn at the start of the map.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created