Jump to content

[Tutorial] Adding Custom Traders with Single Currency + Extras


Recommended Posts

Adding Custom Traders with Single Currency
Not too sure if anyone is gonna find this useful.
Worth a shot tho...


Okay, so what I am going to go over is how to add custom traders to anywhere on the map. I'm not too sure on how the other maps work, so I'll be doing this on my servers' Chernarus Overpoch map. I had found load loads of help here: he didn't exactly go into the depth that I needed. So I figured some of it out on my own and solved some of the problems and also removed some steps that wasn't needed. Hope you guys can follow this and make good use of it.

What you are going to need:
- DayZ Epoch / Overpoch Server
- Database Access
- Notepad (or Notepad++)
- Your servers .pbos / files

Luxuries to make it easier:
- InfiStar AntiHack

Onto the tutorial...
Tutorial and Introduction:

Firstly, you will need to join your server to find the location of which you want to place your trader.
So I've reached my destination of where i want to add my trader;


2014-09-02_00002_zpsb59e11b0.jpg




Once I've found the location, use Infistar (If you have it, if not use this: Click me!) to find yourself a Skin for your trader, and also its ID.

Within the image below, I'm using: Secretary4

2014-09-02_00003_zps6c3c1079.jpg

So now, I log out in the position of where i want my trader to stand. Once disconnected from the server I open up my database to find my UID, correct survivor, and also the location of where I logged out. (For my database I use: 
HeidiSQL) I can find this in my character_data table. Like so:

lele_zpsbafe4e7c.png

Once you have made note of the location, head over to your servers pbo, extract it and navigate to this folder (Which is relevant to your server).

Server PBO > Missions > DayZ_Epoch_17.Chernarus

(This is relevant to me, if you use the Chernarus 17 map then do the same, but pick the once your server runs).

Once you have opened the right mission folder open the mission.sqf then in here, go right down to the bottom of the folder and paste this in:

_unit_10000 = objNull;
if (true) then
{
  _this = createAgent ["Your Chosen Skin", [Location], [], 0, "CAN_COLLIDE"];
  _unit_10000 = _this;
  _this setDir DIRECTION;
  _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;};

you will have to make changed to these values:
- Your Chosen Skin
- Location
- DIRECTION

This is mine for example:

_unit_10000 = objNull;
if (true) then
{
  _this = createAgent ["Secretary4", [1313.83,4079.07,0.189], [], 0, "CAN_COLLIDE"];
  _unit_10000 = _this;
  _this setDir 360;
  _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;};

Once you have completed this, save the file.
After that navigate to:

Mission PBO > server_traders.sqf

Once you have opened this file, create a new instance at the top, use this for a template...

//Custom Trader One
menu_CHANGE ME = [
	[],
	[],
	"CHANGE ME"
];

You will have to change each of the parts to your liking. So mine for example...

//Admin Vendor - Weapons
menu_Secretary4 = [
	[["Assault Rifle",637],["Light Machine Gun",638],["Pistols",674],["Shotguns and Single-shot",641],["Sniper Rifle",640],["Submachine Guns",642],["Overwatch VIL",1002],["Overwatch TAR",1003],["Overwatch Sniper",1011],["Overwatch SCAR",1004],["Overwatch sidearm",1001],["Overwatch MAS",1007],["Overwatch HK417",1009],["Overwatch HK416",1008],["Overwatch HK416",1008],["Overwatch DMR",1010],["Overwatch ACR",1005],["ACR-Black",1101],["ACR-Snow",1102],["ACR-Tan",1103],["ACR-Woodland",1104]],
	[],
	"neutral"
];

You can see within the Server_Traders file that there are certain values you need, so you need to state whether they are a, bandit, hero or neutral trader. Then for the first set of "[]," you need to add value like: ["Assault Rifle",637] which will give the trader the knowledge to sell assault rifles.

Once you are happy with this save it and then go back to your database and go to the "trader_tids" table, then scroll right down to the bottom and add a new value:
222_zps583e769b.png

Once you've made a new row make sure the ID and the trade id are completely different to the rest, so +1 to the one above.
333_zps265014e4.png

After you have done that, in your database, go to your server_traders table and go right to the bottom once more and make a new row and use the same principle as above.

Here's mine for an example:
newsss_zps54ae763e.png

Then once you've done that, quit out of your database. And restart your server.
Once you get back in, go to where your trader is located and you should see them and they should work perfectly.

Here's some images of my added trader:

2014-09-03_00001_zpsa5cf3031.jpg2014-09-03_00002_zpsc2683fee.jpg


Hope this helps some people out with adding traders to their map and for them to work with Singe Currency.


Extras


Adding Custom Trader menus

For the hero trader, I really wanted something extra, so a created myself a new "Trader table".
Heres how you will do it. My example is adding upgraded SUVs (DZE4) to the trader menus.


Firstly...
Open - 
Mission PBO > CFGServerTrader > Category

And create a new file, for example I am going to create a file called:
"HeroSUV.hpp" which I want to add the upgraded SUV's to the trader menus so within the file I create it so it looks like this (Just copy it if you wanna use mine):

class Category_3000 {
	class SUV_Blue_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Camo_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Charcoal_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Green_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Orange_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Pink_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Red_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
	class SUV_Silver_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
		class SUV_TK_CIV_EP1_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
		class SUV_White_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
		class SUV_Yellow_DZE4 {
		type = "trade_any_vehicle";
		buy[] ={300000,"Coins"};
		sell[] ={100000,"Coins"};
	};
}; 

So from here you can change the buy and sell values and also the ID's if you wanted. But at the top of this code you need to change the Category Number to something unused, so 3000 is fine.

Once you have finished editing your files, save it in the Category file with the rest of them. Then navigate to:

Mission PBO > CFGServerTrader > "sfgServerTrader.hpp"

then in that file paste this in the hero section:

#include "Category\HeroSUV.hpp"

Or if you are not using mine then:

#include "Category\YOURFILENAME.hpp"

Once you have done that save then finally navigate, finally, to this file:

Mission PBO > "server_traders.sqf"

Then find the trader you want the menu on (Example is for HeroSUV):

// Hero Vendor
menu_Tanny_PMC = [
	[["Ammunition",478],["Clothes",575],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",1300],["Money",700]],
	[],
	"hero"
];

Change to:

// Hero Vendor
menu_Tanny_PMC = [
	[["Ammunition",478],["Clothes",575],["Helicopter Armed",493],["Military Armed",562],["Upgraded SUVs",3000],["Trucks Armed",479],["Weapons",1300],["Money",700]],
	[],
	"hero"
];

See the Upgraded SUV's section? Well that "3000" is the category number we gave the file back in the HeroSUV.hpp file (or your custom file) that has to match! if it doesn't the trader menu will not work.

Just a quick note, if you are using IDs of which do not appear in the dynamic vehicle files, you should goto this file:
 

Server PBO > Missions > YOURMISSION > "dynamic_vehicle.sqf"

Then add these ids in somewhere:

["SUV_Blue_DZE4",1],
["SUV_Camo_DZE4",1],
["SUV_Charcoal_DZE4",1],
["SUV_Green_DZE4",1],
["SUV_Orange_DZE4",1],
["SUV_Pink_DZE4",1],
["SUV_Red_DZE4",1],
["SUV_Silver_DZE4",1],
["SUV_TK_CIV_EP1_DZE4",1],
["SUV_White_DZE4",1],
["SUV_Yellow_DZE4",1],

This allows the SUV's to be given to the buyer. If you don't do this player just lose their money and gives no SUV to the player. Just a heads up.
 

Once you've done this save, repack, restart. Then you are done!

 

Images:
2014-09-03_00003_zpsffc5eef8.jpg

 




So yeah, Hopefully, this helps some people out, took me a while to make this..
Make good use of it people! :D

Thanks to:
Raymix

Link to comment
Share on other sites

Infistar has a debug menu that shows your wordspace coords.

Also database tarders are not used anynore due to single currency. I would just get rid of all trader data in the db, so that way it will create less d'sync

Yeah I knew that, that's why I didn't add the items to the database. I add em to the CFGServerTraders file.

I know what you mean now. I guess people can still do it for a precaution.

Link to comment
Share on other sites

  • 3 weeks later...

I did every thing you said  but my trader never shows. I have no errors im using sc and it goes in my 17 folder can you make a video of you doing it 

Are you using 17 tho? if you are not using chernarus map 17, dont place it in there. I've used the exact same method as ive used above to create myself a new trader city and it works 100%

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

I'm having trouble getting the traders to display any custom content -

 

I'm trying to add a category for armed vehicles, one for air and one for ground.

I punched up the list into a sql, executed it on the database successfully, and gave the traders access to the categories - but they are showing up as empty categories on the vendors.

 

 

Did I miss a step somewhere I'm forgetting, or is there something special/different I have to do for it to work with the single currency system?

 

 

---

EDIT:

 

I figured out I hadn't #included the trader cfg files.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...