How to build a Trader - GarageMan/Setting-up-a-DayZ-server GitHub Wiki
Independent of the server you are running, a trader is allways a nice extension.
With a litte effort you can create your custom trader, or more than one trader per map (like a blackmarket trader, a car dealer, etc.)
The basis for each trader is (my recommendation) Dr. Jones Trader workshop.
Check these videos on Youtube for further information on trader building:
Some tips on custom objects: https://github.com/Arkensor/DayZCommunityOfflineMode/wiki/Add-custom-objects-to-your-server-or-mission
You have to do 3 basic things:
- Install the workshop "Trader"
- Design the trader location(s)
- Define the trader catalogues (Which trader/person sells which objects/items at which prices?)
Copy&paste the workshop to your server. Do not forget to copy&paste the key.
Copy&paste the folder /Trader
from the directory /ServerProfileFolder
in the workshop to your server's profil folder:
That folder contains the configuration files.
Ask your self, how many trading locations you would like to have, and what the trading persons should sell at these traders.
Each trader (the person) has an unique ID, starting with 0, and a trader name. Each trader "holds" different categories - but you can have the same category at different traders. Plan wisely, because the configuration for all the categories and traders have to be maintained!
The following table shall describe a bit better what the structure of the file TraderConfig.txt
is:
Trader | ID | categories |
---|---|---|
Consume Trader | 0 | Vegetables |
Packaged Food | ||
Meat | ||
Animal Parts | ||
Drinks | ||
Medical Supplies | ||
Medications | ||
Money Exchange | ||
Misc Trade | 1 | Tools (small) |
Tools (big) | ||
Electronics | ||
Fire & Lights | ||
Cooking & Hunting Supplies | ||
Hardware Supplies | ||
Seeds & Lime | ||
Fluffy Pets <3 | ||
Weapon trader | 2 | Melee |
Sidearms | ||
Rifles | ||
Shotguns | ||
Submachine Guns | ||
Assault Rifles | ||
Sniper Rifles | ||
Grenades | ||
Weapon Supplies | 3 | Ammunition |
Magazines | ||
Handguards | ||
Buttstocks | ||
Optics | ||
Supressors | ||
Compensators | ||
Bayonets | ||
Flashlights | ||
Clothing Trader | 4 | Glasses |
Armbands | ||
Gloves | ||
Hats & Caps | ||
Helmets | ||
Masks | ||
Shirts | ||
Hoodies & Sweater | ||
Vests | ||
Jackets & Coats | ||
Skirts & Dresses | ||
Pants | ||
Shoes & Boots | ||
Ghillie | ||
Holster & Pouches | ||
Belt | ||
Bags | ||
Vehicles Trader | 5 | Vehicles |
Vehicle Parts | ||
Keys |
So, why is it important to wisely set up the trader configuration? It is becaus you have to devide any types.xml or classnames from any workshop/mod you are using on your server by all of the categories you define. You clearly have to understand which item in all of the types.xml or classnames is of which category. Not an easy initial job - but a more harder job for the maintanence of the trader configuration due to changes in the workshops (new items, etc.)
There can be more than one trader location, each of it with at least on trading person.
Use the DayZ Editor to create a trader location by putting together different items/objects from the standard library (prefix Land_
), or by adding workshops like:
-
BuilderItems, prefix is
bldr_
-
etc.
Each trader location consits of at least one trading person. Use the DayZ Editor to locate the position(s) of the trading "persons", and export that data as json. That data will be used later.
The data to be extracted from the trader location will be used in the file TraderObjects.txt
, thouhg I am not using the DayZ Editor Loader to load the trader objects instead of adding the object names and locations into the TraderObjects.txt
.
The only thing I am using the TraderObjects.txt
for is the definition of the TraderMarkerPosition, the TraderMarkerSafezone (at least 2 trading persons will result in overlapping safetone circles! A trading person hat a safezone, not the market it self!!)
Looking into the first lines of the default configuration in TraderObjects.txt
we see the configuration of the Greenmounten market:
// Green Mountain:
<TraderMarker> 0 // Trader ID, that is the Consume Trader
<TraderMarkerPosition> 3699.27, 402.13, 5967.91 // Coordinate X, Coordinate Y, Coordinate Z
<TraderMarkerSafezone> 80 // Safezone Radius
<TraderMarker> 1 // The Misc Trader
<TraderMarkerPosition> 3691.41, 402.074, 4998.47
<TraderMarkerSafezone> 80
<TraderMarker> 2 // The Weapon Trader
<TraderMarkerPosition> 3708.71, 403.153, 5974.79
<TraderMarkerSafezone> 80
<TraderMarker> 3 // The Weapon Supplies Trader
<TraderMarkerPosition> 3707.46, 403.153, 5973.3
<TraderMarkerSafezone> 80
<TraderMarker> 4 // The Clothing Trader
<TraderMarkerPosition> 3703.56, 402.345, 6009.53
<TraderMarkerSafezone> 30
<TraderMarker> 5 // The Vehicles Trader
<TraderMarkerPosition> 3723.84, 402.012, 5990.04
<TraderMarkerSafezone> 30
<VehicleSpawn> 3719.71, 402.012, 5994.85 // Vehicle Spawnpoint for Trader;
// Coordinate X, Coordinate Y, Coordinate Z (optional)
<VehicleSpawnOri> -42, 0, 0
Some lines below the configuration of the market places you will find the definition of the objects to spawn (which are the bots and the items like tables, etc.):
// ------------------------------------------------------ Objects to Spawn ------------------------------------------------------
// Green Mountain:
<Object> SurvivorF_Irena // Classname
<ObjectPosition> 3699.27, 402.13, 5967.91 // Coordinate X, Coordinate Y, Coordinate Z
<ObjectOrientation> -13.234265, 0, 0 // The orientation: Yaw, Pitch, Roll
//<ObjectAttachment> NPC_DUMMY // Add this if you are using an non Character Object for an Trader
// (like Vending Machines, etc.).
// It is needed to make the User Action for the Trading Menu work.
<ObjectAttachment> BoxCerealCrunchin // These are here clothes and equipment.
<ObjectAttachment> SurgicalGloves_White
<ObjectAttachment> Bandana_Polkapattern
<ObjectAttachment> MiniDress_PinkChecker
<ObjectAttachment> DressShoes_White
followed by more bots.
...
Below the bots definitions you will find the environment objects:
<Object> Land_FuelStation_Build
<ObjectPosition> 3693.1, 403.612, 5998.32
<ObjectOrientation> -23.000992, 0, 0
<Object> Land_Lunapark_Shooting_Gallery
<ObjectPosition> 3707.49, 403.612, 5974.74
<ObjectOrientation> 39.997997, 0, 0
... etc.
You do not have to enter that data - instead you can load a .dze
-file using the DayZEditor Loader, which makes it much easier!
The following lines describe the choices I made on Namalsk:
Vanilla:
My choise:
Iam using the DayZ Editor to setup the buildings, objects like tables, decoration, and to delete objects not wanted in that space.
Deleting objects can be performed very well by creating a dze-file, which than has to be loaded by the DayZ Editor Loader. That workshop deletes the objects.
To remove the spawn points which may exist for the buildings deleted, I collected the positions of the objects by dublicating each object (to be deleted) by pressing CTRL-C while pointing on it in the DayZ Editor, and than positioning these on the original object. So, I got the positions of each object to be deleted in X, Y and Z.
I than compare the object names and the relating coordinates with findings in the mapgrouppos.xml (just by searching for the building names. All buildings/objects in an area are sequental lines in the mapgrouppos.xml). Delete or comment-out the specific lines.
The following are the buildings (with loot spawning!) I have deleted on Tara Isle/Namalsk for my trader:
Comparing the object names (Land_Workshop4, Land_Workshop2, Land_Shed_W6, Land_Shed_Closed, and Land_Sawmill_Illuminanttower) with the mapgrouppos.xml entries led me to the following lines:
<group name="Land_Workshop2" pos="7259.395996 239.348907 7022.539551" rpy="-0.013943 0.024255 -119.892105" a="-150.107880" />
<group name="Land_Shed_W6" pos="7279.131836 240.109543 7040.708496" rpy="-0.000000 0.000000 154.537323" a="-64.537331" />
<group name="Land_Shed_Closed" pos="7272.294434 244.105789 7061.159668" rpy="-0.000000 0.000000 154.105789" a="-64.105797" />
<group name="Land_Sawmill_Illuminanttower" pos="7269.695313 248.797791 7074.691406" rpy="-0.000000 0.000000 -25.295294" a="115.295296" />
<group name="Land_Workshop4" pos="7256.444824 240.372116 7054.289063" rpy="0.017859 0.008508 -25.473642" a="115.473633" />
I just commented these lines (instead of deleting them) to avoid loot spawning in.
Again, a file has to been searched for the Zombies spawning in on Tara Isel at the position of my new trader.
The affectede file is the file zombie_territories.xml.
Due to I know only industrial Zombies are spawning in, the search was easy: Around 7.260 (X) and 7.022 (Y) has to be an entry in the zombie_territories.xml.
That's what I found - and "deleted" by commenting it out:
If you are using the workshop VPPmap
you should add the locaation of your traders/market places to that config file:
Example for VPPMapConfig.json
{
"M_MARKER_NAME": "Market Place Green Mountain",
"M_ICON_PATH": "VanillaPPMap\\GUI\\Textures\\CustomMapIcons\\waypointeditor_CA.paa",
"M_COLOR": [
139,
0,
0
],
"M_POSITION": [
7661.38,
0,
2324.26
],
"M_ISACTIVE": 1,
"M_IS_3D_ACTIVE": 1
},
Yes, you will need money for trading. Rubles as the russian currency are my favourite, but you can take US dollars etc., to.
Before thinking about adding an other mod for currency: The Trader-mod includes one currency, Russian rubles! If you would like to have a different currency consider about sign up for a workshop like MoneyMod(Trader).
Add the included (Russian) currency to the loottable by just loading that trader_currency_types.xml with the cfgeconomycore.xml
:
<type name="MoneyRuble1">
<nominal>150</nominal>
<lifetime>7200</lifetime>
<restock>0</restock>
<min>100</min>
<quantmin>1</quantmin>
<quantmax>100</quantmax>
<cost>100</cost>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="0" deloot="0"/>
<category name="tools"/>
<tag name="shelves"/>
<usage name="Town"/>
<usage name="Village"/>
<usage name="Hunting"/>
</type>
<type name="MoneyRuble5">
<nominal>150</nominal>
... etc.
You do not like to bunker your bugs at home? Us a banking system with ATMs (which you position at the market places, or in some of the towns?)
Players are allways leaving trash, e.g. paper from ammo packs. At least that paper can be "automatically" removed by setting the lifetime for paper from (standard) 7200 sec to e.g. 30 sec.
<!-- types.xml -->
...
<type name="Paper">
<nominal>0</nominal>
<lifetime>7200</lifetime> <!-- 7,200 secondes lifetime!! -->
<restock>0</restock>
<min>0</min>
<quantmin>-1</quantmin>
<quantmax>-1</quantmax>
<cost>100</cost>
<flags count_in_cargo="0" count_in_hoarder="0" count_in_map="1" count_in_player="0" crafted="1" deloot="0"/>
<category name="tools"/>
</type>
...