Jump to content

[RELEASE] Sanford and Son Salvage (new trader)


theduke

Recommended Posts

--------------
Created by: Theduke™ Payden and Spider from Elite SLK Gaming
--------------

Welcome to Sanford and Son Trader.

Sadly this trader does not accept gold, only coins

"Hero or not, we buy just about everything
you can bring us. Certainly at a discounted price.
We will pay you 75% of what the other guys
give you. But I can guarantee you’ll never
unload everything all at once if you visit them!"

Video

https://www.youtube.com/watch?v=5qIS9V0lLHw

The Idea was to create a trader where you could sell EVERYTHING...well, just about everything ;)

 

New players sometimes arn't able to sell hero items, or maybe you have a vehicle full of junk
you might not want anymore and why not make a bit of cash from it, right?

This trader will NOT be a install and go type of mod.
You will need to take YOUR server items from the trader files, and change the price at the discount you choose.
(you can leave your prices the same if you want, completely up to you)

This is because every server most likely has different prices on items.
Going through each file and changing each price manually just isnt feasible.
How to do this will be explained later in the post. (its not as scary as it sounds)

Many thanks to @Payden for creating the run.bat  file and doing the leg work for creating the sanfordandson.hpp file and instructions.

Many thanks to Spider for creating the trader buildings.

DOWNLOAD
https://github.com/theduke77/Sanford-and-Son-Salvage-Trader

Tools you will need.

Notepad++
PBO Manager
Excel
...Maybe a sandwich and a drink lol

 

FOR NOW WE WILL ONLY USE CHERNARUS - WE HAVE LINGOR WORKING ALSO

Lets start with the easy part, server sided

1. Open your dayz_server\traders\chernarus11.sqf

Anywhere in the middle, add this

//Sandford and son Salvage
    ["Gangsta_merc7", [9910.58,5432.17,0.00143433],106.201],

   
2. Still in the dayz_server folder, put the sanford.sqf from the download in the objects folder.  If you don't have the objects folder create one.

So the sanford.sqf should be in a folder path like this. dayz_server\objects\sanford.sqf

3. Open the init folder, then server_functions.sqf

Look for this
 

spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";

Add this bellow
 

execVM "\z\addons\dayz_server\objects\sanford.sqf";

Thats it for the server sided

 

Now for the mission

1. Open your server_traders.sqf

At the top you will see a list of traders,
add this, but make sure if its your last entry, there shouldn't be a comma at the end

"Gangsta_merc7",

2. still in server_traders.sqf

Add this at the bottom
 

//Sanford and Son Trader
menu_Gangsta_merc7 = [
    [["Sanford And Son Salvage",666]],
    [],
    "neutral"
];

Save and close the file.

4. Put the sanford folder from the download in your custom folder in your mission. If you dont have a custom folder create one.

5. Open your description.ext

Look for

class CfgSounds
{

add this before the closing bracket

class sanford
	{
		name = "sanford";
		sound[] = {custom\sanford\sanford.ogg,1.0,1};
		titles[] = {};
	};

6.Open your mission.sqm

look for

class Sensors

add this block of code, before the class sensors closing bracket.
Pay attention to the class item6. They need to be incremental and you will need to adjust the items6 to items 7 right bellow class sensors also.

class Item6
		{
			position[]={9910.58,0,5432.17}; 
			a=15;
			b=15;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonesanford";
			expCond="(player distance zonesanford) < 25;";
			expActiv="sanford = [] execVM ""custom\sanford\music.sqf"";";
			expDesactiv="terminate sanford; titleText [""Thanks For visiting us! Come Again"", ""PLAIN DOWN"", 3];";
			class Effects
			{
			};
		};

7. Still in the mission.sqm

look for

class Markers
{

add this before the closing bracket of class markers

class Item20
		{
			position[]={9910.58,5432.17};
			name="SanfordSonSalvage";
			text="Sanford & Son Salvage";
			type="mil_circle";
			colorName="ColorBlack";
		};

ALWAYS MAKE SURE your class item is incremental in number and make sure the Items right bellow class markers you increase it by 1. so if you have items18, it'll be items19.

Alright the easy part is done lol

Now is the time to configure your prices for the trader.

Optional/Disclaimer

Spoiler

Ultimately, if you want***, you can use our trader items.
Every item has been checked to make sure there were no dupes,
and if there was, like same ammo at different traders for example,
we made sure prices were the same.
We also spent alot of time re configuring the prices to try and make it more balanced.
This choice is completely up to you as the server owner,
but be warned if you use our prices on a existing server,
it could cause chaos for the players.  They are available in the
download in the "ESLK trader items" folder.

Also know that they have been personalized for our servers.
We are PVE, do not have bandit trader,
and have custom stuff available at trader that isnt in the default files.

This part Payden will take over the instructions

I decided to make a video based on what Payden explained to me

Video can be found bellow
****************************

Building the Scrap Trader File:

1. Put all trader files (YOUR MISSION\dayz_code\configs\Category) in a single directory. Rename any Hero or Epic Hero files to resolve duplicate names

2. Put the run.bat file from the download in that folder also.
Run the bat file, it will compile all your files into one and should create a file called "output.txt"

Now the fun part begins.

3. In order to import into excel and properly change the prices. You need to change the format of the files.

Open output.txt with notepad++.
In notepad++, click on view>Show Symbol>Show All Characters

This will show all spaces, tabs, line breaks...everything.

when done, it should look like this
class    G36C_DZ    {type=“trade_weapons";buy[]={    60000    ,”worth”};sell[]={    20000    ,”worth”};};

and not this

class G36C_DZ    {
type=“trade_weapons";
buy[]={    60000,”worth”};
sell[]={20000,”worth”};
};

- All whitespace is TAB characters.  Tabs between "class" and classname, between classname and {type=..., before and after buy price, before and after sell price.

4. Import the plain text file into Excel. You should end up with everything separated by columns:



    1. class and ClassName (e.g., M4A1_HWS_GL_camo)
    2. All before the buy price (e.g., {type=“trade_any_vehicle";buy[]={)
    3. Buy price
    4. All between buy price and sell price (e.g., ,”worth”};sell[]={)
    5. Sell price
    6. All after sell price (e.g., ,”worth”};};)
    
    If you're like me, you'll need to repeat this process several times to get everything correct.  Filters will help you find the oddball entries in each row.
    
5. Use Excel's conditional formatting to highlight duplicate classnames.  Compare prices, pick the one you will use, delete the other entry

6. Set all buy prices to -1

7. Decide on your discount (our scrap trader pays 75% of standard trader prices) and calculate/replace the original sell prices using excel formulas

8. Use Excel's filters to either hide or delete rows containing only classnames or filenames.  Also remove extra "};" where needed to make these lines a single class

8. Use Excel to save/export the file to Formatted Text (Space delimited).  You'll need to widen the Excel columns to ensure nothing is truncated.

9. If you're like me, you'll need to repeat this step also to ensure your class is correct and no data fields were truncated.

10. Change the filename extension from PRN to HPP if you haven't already.

VIDEO:

Spoiler

 


**************************

11. Now you need to navigate to your trader files, and drop the sanfordandson.hpp you just created with the rest of your trader files.
The path should be dayz_code\configs\category

12. Open your cfgServerTrader.hpp. Located in dayz_code\configs

add this in the middle anywhere

#include "category\SanfordAndSon.hpp"

Thats it you're done.

Hope you enjoy Sanford and Son Salvage Trader

Link to comment
Share on other sites

On 2017-05-24 at 11:20 PM, azzdayz said:

Little thing that threw me off. Your instructions in step 3 have "execVM "\z\addons\dayz_server\objects\sanford.sqf";" Your SQF is actually named sandford.sqf

Might want to either change the name in the download or in the instructions :)

nice catch. updated the git with the proper filename

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Hi Duke, very cool idea here, I will probably add all categories and set the same prices as the primary traders, but I'd like to set a humanity requirement of 10k or maybe 15k to talk to the trader, what's the most straightforward way to set a humanity requirement within this script/edits? I'm having trouble finding where the default hero trader setting is for comparison so that's not helping..

I see "neutral" in this snippet:

menu_Gangsta_merc7 = [
    [["Sanford And Son Salvage",666]],
    [],
    "neutral"
];

could I do something like "humanity=15000" instead of neutral?

Link to comment
Share on other sites

1 hour ago, _Lance_ said:

Hi Duke, very cool idea here, I will probably add all categories and set the same prices as the primary traders, but I'd like to set a humanity requirement of 10k or maybe 15k to talk to the trader, what's the most straightforward way to set a humanity requirement within this script/edits? I'm having trouble finding where the default hero trader setting is for comparison so that's not helping..

I see "neutral" in this snippet:


menu_Gangsta_merc7 = [
    [["Sanford And Son Salvage",666]],
    [],
    "neutral"
];

could I do something like "humanity=15000" instead of neutral?

Hey,

Here's an exerpt from my fn_selfActions.sqf (which is where you do this btw)

Find this code block in your fn_selfActions.sqf: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/compile/fn_selfActions.sqf#L928-L937

Replace it with this and modify the humanity values to your liking:

			if ((_traderMenu select 2) == "friendly") then {
				_humanity_logic = (_humanity < -5000);
			};
			if ((_traderMenu select 2) == "superbandit") then {
				_low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
				_humanity_logic = (_humanity > -100000);
			};			
			if ((_traderMenu select 2) == "bandit") then {
				_low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
				_humanity_logic = (_humanity > -5000);
			};
			if ((_traderMenu select 2) == "superhero") then {
				_humanity_logic = (_humanity < 60000);
			};				
			if ((_traderMenu select 2) == "hero") then {
				_humanity_logic = (_humanity < 5000);
			};

So I have my higher tiers called "superbandit" (-100k humanity) and "superhero" (+60k humanity), you then need to change your server_traders.sqf file to match your new tier traders:

https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/system/mission/server_traders/chernarus11.sqf#L4-L8

This example is the hero trader, I just copied that to be another trader (You MUST use a different NPC).

Here's my example for hero/super hero and bandit/super bandit:

menu_CDF_Soldier_Officer = [
	[["Rockets",750],["Rocket Ammunition",751]],
	[],
	"superhero"
];

menu_CDF_Commander = [
	[["Attachments",693],["Ammunition",478],["Overwatch Ammo",1006],["Currency and gems",1100],["Clothes",476],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",477],["LMG Variants",1008],["Sniper Variants",1001]],
	[],
	"hero"
];

// Bandit Traders
menu_GUE_Soldier_Scout = [
	[["Rockets",651],["Rocket Ammunition",652]],
	[],
	"superbandit"
];

menu_GUE_Soldier_MG = [
	[["Attachments",693],["Ammunition",577],["Overwatch Ammo",1006],["Currency and gems",1100],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627],["LMG Variants",1008],["Sniper Variants",1001]],
	[],
	"bandit"
];

Any new NPC you add needs to be in this array, too: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/system/mission/server_traders/chernarus11.sqf#L2

 

Link to comment
Share on other sites

1 minute ago, salival said:

Hey,

Here's an exerpt from my fn_selfActions.sqf (which is where you do this btw)

Find this code block in your fn_selfActions.sqf: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/compile/fn_selfActions.sqf#L928-L937

Replace it with this and modify the humanity values to your liking:


			if ((_traderMenu select 2) == "friendly") then {
				_humanity_logic = (_humanity < -5000);
			};
			if ((_traderMenu select 2) == "superbandit") then {
				_low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
				_humanity_logic = (_humanity > -100000);
			};			
			if ((_traderMenu select 2) == "bandit") then {
				_low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_HIGH";
				_humanity_logic = (_humanity > -5000);
			};
			if ((_traderMenu select 2) == "superhero") then {
				_humanity_logic = (_humanity < 60000);
			};				
			if ((_traderMenu select 2) == "hero") then {
				_humanity_logic = (_humanity < 5000);
			};

So I have my higher tiers called "superbandit" and "superhero", you then need to change your server_traders.sqf file to match your new tier traders:

https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/system/mission/server_traders/chernarus11.sqf#L4-L8

This example is the hero trader, I just copied that to be another trader (You MUST use a different NPC).

Here's my example for hero/super hero and bandit/super bandit:


menu_CDF_Soldier_Officer = [
	[["Rockets",750],["Rocket Ammunition",751]],
	[],
	"superhero"
];

menu_CDF_Commander = [
	[["Attachments",693],["Ammunition",478],["Overwatch Ammo",1006],["Currency and gems",1100],["Clothes",476],["Helicopter Armed",493],["Military Armed",562],["Trucks Armed",479],["Weapons",477],["LMG Variants",1008],["Sniper Variants",1001]],
	[],
	"hero"
];

// Bandit Traders
menu_GUE_Soldier_Scout = [
	[["Rockets",651],["Rocket Ammunition",652]],
	[],
	"superbandit"
];

menu_GUE_Soldier_MG = [
	[["Attachments",693],["Ammunition",577],["Overwatch Ammo",1006],["Currency and gems",1100],["Clothing",575],["Helicopter Armed",512],["Military Armed",569],["Trucks Armed",534],["Weapons",627],["LMG Variants",1008],["Sniper Variants",1001]],
	[],
	"bandit"
];

Any new NPC you add needs to be in this array, too: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/system/mission/server_traders/chernarus11.sqf#L2

 

Wow that's like the "endgame kit" for epoch right there. Thank you! Will load it tomorrow and try it out.

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

×
×
  • Create New...