How do I make it so Slave traders have a bunch of "merchandise"?

Started by Locusthorde300, May 31, 2015, 07:06:31 PM

Previous topic - Next topic

Locusthorde300

I'm not sure how to mod traders, and the modding wiki has basically nothing on the subject. I also can't find anything in the core files for it either.

Shinzy

if you just want to add stuff for the slave traders to sell
go to Mods/Core/Defs/TraderKindDefs
find the
  <TraderKindDef>
    <defName>SlaveTrader</defName>
in the TraderKinds.xml

and take example of the "StockGenerator" bits of other traders as to how to have them carry different stuffs

Locusthorde300

I totally passed over that folder, weird.

I'm noticing a lot of different stuff with stock. Do those catagories automatically add things, or do you have to manually add them to the catagories?

IE; if I make a mod that adds a gun, will it automatically be added to the Weapons Stock because its a weapon, or do I have to add in my own code to do that?

Shinzy

Quote from: Locusthorde300 on June 01, 2015, 12:05:22 AM
I totally passed over that folder, weird.

I'm noticing a lot of different stuff with stock. Do those catagories automatically add things, or do you have to manually add them to the catagories?

IE; if I make a mod that adds a gun, will it automatically be added to the Weapons Stock because its a weapon, or do I have to add in my own code to do that?

Yes! that is exactly it ;D
in the weapon defs you have the category
    <thingCategories>
      <li>WeaponsRanged</li>
    </thingCategories>
which defines in which category all the items will be stored in the stockpile
The traders will also carry any item that would be listed in there
including modded weapons if you put their thing category as WeaponsRanged

(if you don't want the items from that category to be carried by the trader there's some extra tags you can put on it -> "<Tradeability>never/sellable</tradeability>)
if I've understood right the 'sellable' would make your item well.. sellable =P but so that you can't buy it anywhere *citation needed

Haplo

FYI: If you want to add something to the exotic trader, you don't need to change the trader. There it's possible to just add this tag to your stuff and the trader will maybe carry that item:

<ThingDef ...>
...
<tradeTags>
<li>Exotic</li>
</tradeTags>
...
</ThingDef>

Locusthorde300

Thank you both.

Now, is there a way to change the prices at which they buy/sell things?

Shinzy

Quote from: Locusthorde300 on June 04, 2015, 09:14:14 PM
Thank you both.

Now, is there a way to change the prices at which they buy/sell things?

through traders you can adjust
if the prices are cheap/normal/expensive
        <price>Expensive</price>

if you want to be more precise you need to edit the market price of the item itself
each item has line like this
      <MarketValue>9</MarketValue>
in their <statbases>
unless the item is made out of stuff (like wood)
in which case the price is determined by the amount of materials used
like 50 woods cost 50 times whatever single log's price is

Locusthorde300

Is there a way to Forbid selling slaves to a trader?

So it is in a sense, more of a "Freelance-for-hire" type ship?

As well, is there a way to call a ship to come to your colony? I remember techtreeminami did this.

Shinzy

Quote from: Locusthorde300 on June 05, 2015, 12:21:42 PM
Is there a way to Forbid selling slaves to a trader?

So it is in a sense, more of a "Freelance-for-hire" type ship?

As well, is there a way to call a ship to come to your colony? I remember techtreeminami did this.
I think no to each of these, without some skills in the dll modding side of things

Haplo mite know more, Haplo? HAPLOOO? *poke* are you theeere? hello?

Haplo

*grin* please refrain from poking me. I'm rather ticklish *g*

For your questions: You can not define if something is sellable or buyable only in alpha 10 easily. Even with some coding it's not that easy as far as I know. You need to change the trader itself, which isn't that easily done yet..

For the calling: that's only doable via dll modding, sorry. I think mrofa has something like that already in his communication relais integrated. But if you know dll modding, then you can just copy the code out of the trader incident and fit it for your own pleasure :)

Locusthorde300

#10
Quote from: Haplo on June 05, 2015, 02:43:53 PM
-snip-
Alright, it was worth a shot.

In regards to making new trader types. What files would be required, apart from TraderKindsdef.xml?

I wanted to make a "Mercenary" trade ship basically. Where you can buy mercs, but can't sell slaves. It'd have probably 15-30 at any time, and they'd be cheaper. As well, using the comms console or something to call the ship to you, with a cost and delay.