[Idea] More flexible trader stock modding - XML strucuture suggestions

Started by Telkir, July 08, 2014, 06:35:15 AM

Previous topic - Next topic

Telkir

I've tried to search to see if there were any plans or ideas to fix this but didn't come up with anything. Correct me if I'm wrong (I often am and I suck at checking my facts :P), but right now, there are situations for modders where...

* Example Mod A introduces a new industrial resource, neutronium ore
* Example Mod B introduces another new industrial resource, microbes
* Both mods redefine the vanilla IndustrialTrader TraderKind to make them deal in their new resources
* Depending on the mod load order, either mod A or mod B will lose out, and not have their goods stocked as desired

I know this can be fixed by defining new types of traders. In some cases it's appropriate but for the example above it isn't ideal - most added resources can fall under the heading of one of the existing trader types.

If all resource-adding mods created individual trading ships for their stuff, someone who has a selection of mods could double or maybe even triple the types of trader that could visit the colony. With so many different types of traders it becomes a lottery in getting one that is actually useful to you at any given time.

In the future it would be nice if the modding framework was a little more flexible - keep the current TraderKindDefs, but instead of hardcoding inventories there, move the relevant stock tags within each resource ThingDef (stone blocks used as an example with the suggested new tags at the end):

<ThingDef ParentName="ResourceBase">
<defName>StoneBlocks</defName>
<label>Stone blocks</label>
<description>For building structures.</description>
<texturePath>Things/Item/Resource/StoneBlocks</texturePath>
<soundInteract>Stone_Drop</soundInteract>
<soundDrop>Stone_Drop</soundDrop>
<basePrice>1.9</basePrice>
<useStandardHealth>false</useStandardHealth>
<storeCategories>
<li>ResourcesRaw</li>
</storeCategories>
<tradeDefs>
<stockedByTrader>IndustrialTrader</stockedByTrader>
<stockPriceModifier>Cheap</stockPriceModifier>
<stockAmountMin>100</stockAmountMin>
<stockAmountMax>200</stockAmountMax>
</tradeDefs>
</ThingDef>


The aim of this change would be to allow modders to "stack" new resources into an existing TraderKind without actually overwriting anything or causing conflicts as described above.

I know it's early days still and the data format is being tweaked in each new alpha, so it seems like a good point to suggest this.

Edit for clarity.

StorymasterQ

This looks like a sound idea to consolidate different resource mods.
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here