This post started as a request for information on how add traders. The question was answered, so I thought I'd update my original post with instructions on how to do this:
It is easier to add traders if you don't want them to have their own inventory. This tutorial will start with explaining how to add traders and have them use the same database data/inventory as other traders.
Using the 3D editor, create a trader city. Place units at the locations where you want to have the traders standing. I am not going to explain how to use the 3D editor. You should already know how to do that.
Open server_traders.sqf for reference and keep it open.
Open mission.sqf and add an entry for your first new trader:
_unit_13001 = objNull;
if (true) then
{
_this = createAgent ["GUE_Soldier_1", [2550.658, 8326.5928, 2.3534577], [], 0, "CAN_COLLIDE"];
_unit_13001 = _this;
_this setDir 114.59087;
_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;};
_unit_#### can be a unique number not being used anywhere else in mission.sqf
"createAgent" should match one of the traders in the server_traders.sqf file. For example:
Change the coordinates above with the coordinates from the new trader city you created. Also change these lines:
_unit_13001 = _this;
_this setDir 114.59087;
_unit matches the _unit number you chose above and setDir is in the mission file from the trader city you created.
What this does is spawns a trader with the classname "BAF_Soldier_AMG_W"", which the server recognizes is the neutral ammo trader as defined in the server_traders.sqf file. Please note that I pulled this from a Panthera server_traders.sqf so yours might be different.
After you've added all the traders this way, feel free to copy over the other items, such as tents, boxes, etc that you created in the mission you created in the 3D editor. Place all of this above the "processInitCommands;" commands at the bottom of the server's mission.sqf.
Creating traders with their own inventory
If you want to create unique traders that do not use the inventory of an existing trader, you need to do a little more.
After adding the tents, boxes, etc that make up your new trader city, and adding the traders as above, you perform the following steps.
In server_traders.sqf, you have to add the trader. It has to use a unique classname not being used by any other trader and it can not be used by any AI that you have on the server. If, for example, you use the same classname for this new trader as that of a bandit AI in your mission system, when you come across a dead bandit, you will get a trader prompt on your scroll menu!
For my example, I will use "Fiona". She is a trader I added to my Napf and Panthera servers that sells and buys rare food and drinks. This is what I added to server_traders.sqf:
I used the model "RU_Damsel5". When you bring up the menu, it says "Rare Food/Drinks" and it uses trader ID 700. Whatever model you use, it needs to be added to the top of server_traders.sqf:
This adds the item "ItemSodaRabbit" with a quantity of 1000, selling for 6oz gold, buying for 3oz gold, to trader ID #700.
I hope that helps everyone! Let me know if you have questions. Thank you for everyone that answered the original post I made which led me to making this new post!
Question
BetterDeadThanZed
This post started as a request for information on how add traders. The question was answered, so I thought I'd update my original post with instructions on how to do this:
It is easier to add traders if you don't want them to have their own inventory. This tutorial will start with explaining how to add traders and have them use the same database data/inventory as other traders.
Using the 3D editor, create a trader city. Place units at the locations where you want to have the traders standing. I am not going to explain how to use the 3D editor. You should already know how to do that.
Open server_traders.sqf for reference and keep it open.
Open mission.sqf and add an entry for your first new trader:
_unit_#### can be a unique number not being used anywhere else in mission.sqf
"createAgent" should match one of the traders in the server_traders.sqf file. For example:
This is a neutral ammunition trader. You can select "BAF_Soldier_AMG_W" and put it in the above mission.sqf file:
Change the coordinates above with the coordinates from the new trader city you created. Also change these lines:
_unit matches the _unit number you chose above and setDir is in the mission file from the trader city you created.
What this does is spawns a trader with the classname "BAF_Soldier_AMG_W"", which the server recognizes is the neutral ammo trader as defined in the server_traders.sqf file. Please note that I pulled this from a Panthera server_traders.sqf so yours might be different.
After you've added all the traders this way, feel free to copy over the other items, such as tents, boxes, etc that you created in the mission you created in the 3D editor. Place all of this above the "processInitCommands;" commands at the bottom of the server's mission.sqf.
Creating traders with their own inventory
If you want to create unique traders that do not use the inventory of an existing trader, you need to do a little more.
After adding the tents, boxes, etc that make up your new trader city, and adding the traders as above, you perform the following steps.
In server_traders.sqf, you have to add the trader. It has to use a unique classname not being used by any other trader and it can not be used by any AI that you have on the server. If, for example, you use the same classname for this new trader as that of a bandit AI in your mission system, when you come across a dead bandit, you will get a trader prompt on your scroll menu!
For my example, I will use "Fiona". She is a trader I added to my Napf and Panthera servers that sells and buys rare food and drinks. This is what I added to server_traders.sqf:
I used the model "RU_Damsel5". When you bring up the menu, it says "Rare Food/Drinks" and it uses trader ID 700. Whatever model you use, it needs to be added to the top of server_traders.sqf:
In your database, you have to add the trader:
Then you have add the items the new trader will stock:
This adds the item "ItemSodaRabbit" with a quantity of 1000, selling for 6oz gold, buying for 3oz gold, to trader ID #700.
I hope that helps everyone! Let me know if you have questions. Thank you for everyone that answered the original post I made which led me to making this new post!
Link to comment
Share on other sites
Top Posters For This Question
21
15
11
7
Popular Days
May 29
13
May 30
8
Jun 17
8
Sep 17
6
Top Posters For This Question
BetterDeadThanZed 21 posts
drunkenjawa 15 posts
Hammer 11 posts
cring0 7 posts
Popular Days
May 29 2014
13 posts
May 30 2014
8 posts
Jun 17 2014
8 posts
Sep 17 2013
6 posts
Popular Posts
BetterDeadThanZed
This post started as a request for information on how add traders. The question was answered, so I thought I'd update my original post with instructions on how to do this: It is easier to add trad
cen
All of the added "buildings/objects" for the trader cities are found in the dayz_server.pbo, specifically dayz_server\mission\DayZ_Epoch_24.Napf\mission.sqf. You can get the .beidi file as well an
Magz
Thanks BetterDeadThanZed, your guide was a great help.
106 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now