Editing trader files

From Mod Wiki

Jump to: navigation, search

Many people ask how to add stuff to the trader, change prices or they have some other reason to ask for the trader files. Now this post will explain exactly how the trader files work.

The files can be found in \gamedata\config\misc . There is a file for every trader:In this tutorial I will use Sidorovich's file, to make things easier for me.

Contents

[trader] The info portions that control the changes

Every trader file starts with a [trader] section (I will call everything that has [around] it a section). This first section contains info portions that tell the game which sections to call next. Info portions are used by STALKER to control many things. They are given to you (silently) when you advance in the game. Sid's [trader] section looks like this:

[trader]
buy_condition  = trader_generic_buy
sell_condition = {+esc_kill_bandits_quest_done} trader_after_fabric_sell, trader_start_sell
buy_supplies   = {+esc_kill_bandits_quest_done} supplies_after_fabric, supplies_start

This means:

  • the buy condition is always trader_generic_buy
  • the sell condition is trader_start_sell as default and trader_after_fabric_sell, if the info portion esc_kill_bandits_quest_done is given. That is the case, when you've killed the bandits that keep the rookie stalker captive.
  • the buy_supplies are supplies_start as default and supplies_after_fabric after the same info portion is given.

Barkeep even has a second info portion, so his stuff is changed after X18 and then again after X16.

Now what do these different sections mean? Read in the next parts...

[trader_generic_buy] What the trader buys from you, for how much

From now on, you will find items listed in every section. They usually have two numbers behind them, but those numbers have different meanings for every section. In this first section you will find something like this:

;Артефакты

Don't care about such things. They are Cyrillic comments. Everything behind a ; in any .ltx file is a comment or something that someone has deactivated. If a ; is in the middle of a line, the line is active but everything behind that sign will be ignored.

Then there is also something like this:

mutant_dog_tail ;NO TRADE

It means you can't sell a dog tail to Sid, because Sid doesn't care about dog tails! He hasn't fixed a price for it.

Finally there will be something like this:

wpn_addon_silencer = 0.7, 0.2

It means Sid will give you money for a silencer. How much? Well, you have to do some math, to read it: 0.7 + 0.2 = 0.9 -> 0.9 / 2 = 0.45 -> 0.45 == 45% So he will pay you 45% of the base price. The base price is set in the other ltx files, that define the properties of weapons, suits, etc. Why so complicated? Don't ask me, I'm not GSC. They probably wanted to calculate it different first, but then just made it this way.

[supplies_start] What the trader has to offer

Let me say this right at the beginning: If you add things here, you'll also have to add/edit the same thing in the corresponding sell section. Explained in part 4.

So, this is where you can add stuff that the trader should sell to you. Since this is the [supplies_start] section, he will offer it right from the beginning - but he will offer it only until the next section becomes active ([supplies_after_fabric]). If he should offer it then also, you'd have to add/edit it there as well.

Let's say you want to buy a Gauss rifle from Sid, you'd put:

wpn_gauss = 1, 1

The first 1 means he could have one Gauss rifle in stock. The second 1 means the chance he will actually have it in stock is 100%.

To make things a bit more difficult, you want to add the gauss ammo, too:

ammo_gauss = 10, 0.3

He can have 10 boxes of ammo, but only with a possibility of 30% for each box!

Like I told you, this isn't everything: When adding stuff to the supplies, you have to add or edit the same stuff in the corresponding section ...

[trader_start_sell] What the trader sells

In this section it is defined for how much the trader will sell his supplies to you - if he sells them.

For example:

vodka = 1, 3

He will sell you his Vodka for twice its base price! Obviously the price calculation is done like explained in part 2 of this guide.

But many stuff isn't for sale:

mutant_dog_tail ;NO TRADE

Maybe Sid does care about dog tails, because he doesn't sell them either! He likes to keep them obviously!

If you want to be able to buy your Gauss rifle and ammo at start, you have to add it somewhere in this section [trader_start_sell]. If you want to be able to buy it for literally no money, you could add it like this:

wpn_gauss  = 0.00004, 0.00004
ammo_gauss = 0.002, 0.002

The Gauss base price is 25000, so this would sell it for 0.004 % = 1 RU. The ammo base price is 550. Sid throws it out for 0.2 % - around 1 RU.

Of course it would be much easier to edit the base price, than making this complicated rocket-science percentage calculations.

Also, usually prices that traders sell their stuff for, are higher than 100% - because they want to make profit. So the numbers would look like in the Vodka example.

Important: If you want to add something that is already in the file (but has ;NO TRADE behind it maybe), then you have to edit the line instead of adding the same item again. Don't make duplicates in the same section!

Note: All price calculations are shown for items which are 0% damaged. If they are damaged, they price will be reduced of course.

Quest items: If you want to sell or buy quest items, you have to set their quest item status to false.

quest_item = false

That can be done in gamedata\config\misc\quest_items.ltx

Links

Source: http://forums.filefront.com/s-t-l-k-e-r-soc-modding-editing/362105-tutorial-how-edit-trader-files.html#post4342355

Personal tools