Ok needing some help with traders.

ZarX

New Member
So I am using cfg based traders and I can add new catergories and such to them but how do I make a new trader? Also when ever I buy say a 350z from the trader is disappears but the key is added.
 
.....search is your friend, and dont say you did cause all i put in the search bar was the word traders....

its the second result after yours
 
Well I know how to do the custom traders through the data base.. but its different for a cfg based trader.
 
Well I know how to do the custom traders through the data base.. but its different for a cfg based trader.
soz didnt read post correctly, try and copy an existing trader and start changing stuff :p

oh and i realized my post came of very blunt apologies
 
No problem. I kinda figured you didn't read it right lol. I know lots of ppl always ask about adding custom traders which tons and tons of guides and videos but have yet to find any for cfg based traders. I thought about looking at the old traders and changing stuff but wasn't 100% sure if doing that would work or not.
 
Its actually pretty simple

First, edit server_traders.sqf to add the skins to use as traders (at the top). Try to pick one that isn't playable

We will add TK_GUE_Soldier_MG_EP1 as your new config trader.

Code:
// DayZ Epoch TRADERS for 17
serverTraders = ["Tanny_PMC","Graves","US_Delta_Force_AR_EP1","GUE_Commander","Damsel3","Soldier_MG_PKM_PMC","GUE_Worker2","GUE_Woodlander2","RUS_Soldier2","Drake_Light","GUE_Woodlander3","Soldier_GL_PMC","GUE_Villager3","CIV_EuroWoman01_EP1","Dr_Annie_Baker_EP1","RUS_Commander","Damsel5","TK_Special_Forces_MG_EP1","TK_Special_Forces_EP1","Ins_Soldier_AR","Ins_Lopotev","Ins_Worker2","Ins_Woodlander3","Dr_Hladik_EP1","pook_Doc_Bell47","Ins_Woodlander2","TK_GUE_Soldier_MG_EP1"];

Then at the bottom, associate the item categories with your traders (I know you're using config but I think this is still necessary?)

Code:
// New Trader
menu_TK_GUE_Soldier_MG_EP1 = [
    [["New Items for Sale",1301],["Boats Unarmed",672]],
    [],
    "neutral"


Select a skin that isn't one that a player or AI will have access to, one of these ought to work (or just use TK_GUE_Soldier_MG_EP1)

https://community.bistudio.com/wiki/ArmA_2_OA:_Infantry

Next, add an include for your new category file for your custom trader categories to CfgServerTrader\cfgServerTrader.hpp

Code:
    #include "Category\SampleConfigTraderListToAdd.hpp"

Edit this category file so that the class category number matches the category you set up for your new trader (Remember [["New Items for Sale",1301] ) ???

Code:
class Category_1301 {

    class 30Rnd_556x45_Stanag

    {
        type = "trade_items";
        buy[] = {4,"ItemSilverBar"};
        sell[] = {4,"ItemSilverBar"};
    };
};


Add your trader's location and direction on the map in mission.sqf like so:


Code:
_unit_13005 = objNull; //Gas Station Munsingen
if (true) then
{
  _this = createAgent ["TK_GUE_Soldier_MG_EP1", [3730.949, 7865.187, -30.138638], [], 0, "CAN_COLLIDE"];
  _unit_13005 = _this;
  _this setDir 366.01477;
  _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;  ";
  _this setUnitAbility 0.60000002;
_this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;};



If your trader will be selling vehicles, its important that you add a HeliHEmpty nearby for vehicles to spawn on.

Paste this in and edit:

Code:
        _vehicle_13005 = objNull; //Vehicle Spawn Munsingen
if (true) then
{
  _this = createVehicle ["HeliHEmpty", [3737.0913, 7855.8892], [], 0, "CAN_COLLIDE"];
  _vehicle_13005 = _this;
  _this setDir 492.67697;
  _this setPos [3737.0913, 7855.8892];
};



Don't forget you must change the _unit_ numbers, AND _vehicle_ numbers, BOTH in two places each in the above code, the 13000's are a safe point to start numbering from


Now you are onto editing the database. The only tables you edit are server_traders, traders_data, and trader_tids

I use Heidi SQL, open the database, password, select the database table trader_tids and add a new row to your TIDS. Edit the name and the trader. My preview entry was "692 - packaged food - 176" so my next one was "693 - Fuel Station - 177". I know you are using config traders but I think this step is still necessary. In Heidi I just click the white background to the right of the columns and it commits these changes.

Edit server_traders table to add a new row and include your new trader by id 177 (or whatever yours was)

You can copy paste all the other fields from an above row, and make sure your classname is the same as one you picked out, in this case TK_GUE_Soldier_MG_EP1.

Lastly, edit traders_data to add one row, copy another entry's info down for your trader's first stock item and set the TID to match your trader and TID (again may or may not be necessary).

You will have to repack your Dayz_Epoch_Server\Addons\Dayz_Server.PBO to include your newly edited mission.sqf , everything else is in MPMissions (or mission PBO?) so it may or may not require repack depending on host.

Sorry if I was unclear about anything, let me know if you have any questions
 
Last edited:
Back
Top