Jump to content

Help with custom trader city !!! Willing to pay


jonse

Recommended Posts

Hi

i am very good at coding and stuff but i cant seem to figure out how to add a trader at a random spot (bu coords ofc)

so i am looking for some help to make those traders because i really want a another trader at the sea so new players dont need to run so long but i cant make any traders i followed raymix's tutorial but that confuses me the fuck out so can somebody please help me with it i already made where they need to stand just pm me or reply if you want to help/ discuss i at Willig to pay

 

Link to comment
Share on other sites

If you have infistar you can turn on admin debug monitor and stand exactly where you want the trader. Take a screenshot of the coords in the debug.

Go into your server pbo, open up the missions.sqf (this will be in a folder named what ever map you are using, ex: missions\DayZ_Epoch_11.Chernarus)

Do a search for "_unit" without the "quotes".  Copy that whole block of code, that looks like this

_unit_13 = objNull;
if (true) then
{
  _this = createAgent ["Profiteer4", [11449.484, 11341.03, -9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _this setcaptive true;
  _unit_13 = _this;
  _this setDir 34.525925;
  _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;};
 

[/spolier]

paste that code at the bottom of the missions.sqf

Highlighted in bold, are the changes i made in order for the NPC to appear on the map

_unit_13000 = objNull;
if (true) then
{
  _this = createAgent ["Hooker2", [11449.484, 11341.03, -9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _this setcaptive true;
  _unit_13000 = _this;
  _this setDir 34.525925;
  _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;};

 

Now to make that NPC a actual trader.

Mission sided, open up your server_traders.sqf

paste this block of code at the bottom

// Drugs and alcohol
menu_Hooker2 = [
    [["Drugs 'n Alcohol",972]],
    [],
    "neutral"  //Options are neutral, hero, bandit
];

Highlighted in black are the things that need to be changed to suit your needs

972 is the number of the category, you will need to change it and make sure the number is unique, ex: 2000

the "Hooker2" needs to be added the server traders list at the top, like so



serverTraders = ["Functionary1_EP1_DZ",,"Hooker2",.........  DO NOT ADD PUT "menu_Hooker2" its "Hooker2" or whatever NPC you've used.

Now we need to define what drugs and alcohol is going to sell.

Open up your category folder, in there you will see tons of HPP files. NeutralAirplanes, NeutralAssaultRifle and so on.

If you are going to sell items, pay attention to the "trade_items" part in the HPP.

if its vehicles it will be "trade_any_vehicle" instead and so on...

copy one of those, Change the number at the top to 2000 (or whatever you would picked in the server_traders.sqf)

create the list of things you want to sell.

Save it as MYNEWTIEMS.hpp

Then you need to open cfgServerTrader.hpp   At the bottom of the list, add PATH\MYNEWTIEMS.hpp

Thats how you create a trader.

If you have any issues let me know

 

 

Link to comment
Share on other sites

jonse,

 

just about to sort out a custom trader for my taviana epochogins server. If you need any help jump onto our ts and ill do my best.

We created a full set of custom traders for cherno. I like klen best created a Tree lined drive up to the palace traders.

I am the coder my friend is the designer as I have no drawing skills.

What map are you wanting to add a trader to ?

 

TS3:  Teamspeak3

 

Hawkeye.

 

 

Link to comment
Share on other sites

9 minutes ago, hawkeye said:

jonse,

 

just about to sort out a custom trader for my taviana epochogins server. If you need any help jump onto our ts and ill do my best.

We created a full set of custom traders for cherno. I like klen best created a Tree lined drive up to the palace traders.

I am the coder my friend is the designer as I have no drawing skills.

What map are you wanting to add a trader to ?

 

TS3:  Teamspeak3

 

Hawkeye.

 

 

 

well thanks for the help but i dont need it anymore but my friend needs it here is his steam and ts ip 

http://steamcommunity.com/id/dacinibun

ts2.freets3.net:10060

 

or add me 

http://steamcommunity.com/profiles/76561198043320225/

Link to comment
Share on other sites

  • 1 month later...

Sorry to resurrect an old topic but I've searched and searched and can find NO clarification on what the "_this setDir 34.525925;" is, or where to get this value when adding my own custom traders.

In this (http://epochmod.com/forum/index.php?/topic/970-custom-trader-cities/)  explanation, it's suggested that the number is to be found in the custom map you create when you make your traders, but my saved map contains no such number. (!?)  All my traders in my mission.sqf file have different values set here.  What ARE these numbers?

Would someone PLEASE explain this to me?

Link to comment
Share on other sites

"_this setDir 34.525925;"

 

Basically, it's the direction something is facing. So if you wanted to place a trader NPC in a certain place (I use infiSTAR) I would stand exactly where I want the trader NPC to be, then press F2 and "Copy Worldspace Co-Ords to RPT". They would look something like this : [61.7218,[2049.03,11807,0.00144958]]

To break those numbers down : 

61.7218 = Direction the trader is facing in the world.

2049.03 = The "X" co-ordinate.

11807 = The "Y" co-ordinate.

0.00144958 = The "Z" co-ordinate.

This gives an EXACT position to put something.

If you are adding stuff to your mission.PBO though, like markers or trader NPC's, you need to set them out X, Z, Y, like this, for it to work : 

[61.7218,[2049.03,0.00144958,11807]]

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If you are adding custom stuff in an SQF file serverside, you will see something like this : 

_vehicle_3301 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Mil_House", [2896.6016, 4503.7505, 0.23285694], [], 0, "CAN_COLLIDE"];
  _vehicle_3301 = _this;
  _this setDir -89.442787;
  _this setVehicleInit "this setvectorup [0,0,1]";
  _this setPos [2896.6016, 4503.7505, 0.23285694];
};

This is basically telling the server to spawn a Land_Mil_House at these co-ords, 2896.6016, 4503.7505, 0.23285694 and make sure it's facing this direction : _this setDir -89.442787;

 

 

Link to comment
Share on other sites

4 hours ago, ravenwolf said:

Sorry to resurrect an old topic but I've searched and searched and can find NO clarification on what the "_this setDir 34.525925;" is, or where to get this value when adding my own custom traders.

In this (http://epochmod.com/forum/index.php?/topic/970-custom-trader-cities/)  explanation, it's suggested that the number is to be found in the custom map you create when you make your traders, but my saved map contains no such number. (!?)  All my traders in my mission.sqf file have different values set here.  What ARE these numbers?

Would someone PLEASE explain this to me?

well.I was explained everything but.. now i see its a resurrected topic :D

Link to comment
Share on other sites

  • 4 weeks later...
On 3/5/2016 at 7:32 PM, ElDubya said:

"_this setDir 34.525925;"

 

Basically, it's the direction something is facing. So if you wanted to place a trader NPC in a certain place (I use infiSTAR) I would stand exactly where I want the trader NPC to be, then press F2 and "Copy Worldspace Co-Ords to RPT". They would look something like this : [61.7218,[2049.03,11807,0.00144958]]

To break those numbers down : 

61.7218 = Direction the trader is facing in the world.

2049.03 = The "X" co-ordinate.

11807 = The "Y" co-ordinate.

0.00144958 = The "Z" co-ordinate.

This gives an EXACT position to put something.

If you are adding stuff to your mission.PBO though, like markers or trader NPC's, you need to set them out X, Z, Y, like this, for it to work : 

[61.7218,[2049.03,0.00144958,11807]]

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

If you are adding custom stuff in an SQF file serverside, you will see something like this : 

_vehicle_3301 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Mil_House", [2896.6016, 4503.7505, 0.23285694], [], 0, "CAN_COLLIDE"];
  _vehicle_3301 = _this;
  _this setDir -89.442787;
  _this setVehicleInit "this setvectorup [0,0,1]";
  _this setPos [2896.6016, 4503.7505, 0.23285694];
};

This is basically telling the server to spawn a Land_Mil_House at these co-ords, 2896.6016, 4503.7505, 0.23285694 and make sure it's facing this direction : _this setDir -89.442787;

 

 

Thanks a LOT for this information.  Makes a lot more sense to me now.

Link to comment
Share on other sites

  • 10 months later...

Okay So I have Created I new trader...

I went into my Server Mission.sqf created the new unit at the location I wanted

Spoiler

_unit_134 = objNull; //Tulga Dealer
if (true) then
{
  _this = createAgent ["RU_Soldier_Crew_DZ", [12878.1,4437.06,0.00143433], [], 0, "CAN_COLLIDE"];
  _unit_134 = _this;
  _this setDir 349.301;
  _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;};

Then I went into my server Trader.sqf and added the trader to the bottom. and added his skin to the top of the file.

Spoiler

// Tulga Trader
menu_RU_Soldier_Crew_DZ = [
    [["Weapons",914],["Ammo",915],["Vehicles",916],["Thermals",917],["Rockets",693]"Rocket Ammo",694]],
    [],
    "neutral"
];   

I have the appropriate .hpp files for the categories he sells.  But when in the server, none of the trader including the one I added work, (no trader menu)

If I comment out the Tulga trader that I put in my server trader.sqf the rest of the traders work.

I cant figure out where im going wrong or what I am missing. I have been reading tutorials and watching all sorts of videos for info on how to add a custom trader, but it always come back to this...

Link to comment
Share on other sites

  • 3 weeks later...

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
  • Discord

×
×
  • Create New...