Jump to content
  • 0

Want to change humanity needed for bandit trader


ahughes3

Question

I am trying to work out how to change the bandit trader to a normal one. I'm running a non pvp server so there is no need for a bandit trader.

 

I've searched the database but can't find any reference to the bandit trader. I've looked in the server_traders.sqf and then searched the database by the skin, but still nothing comes up.

 

Anyone got any ideas how I edit it from hostile to neutral?

 

Cheers

Andy

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Try this

 

in your server_traders.sqf in your mission file

 

search for the word hostile, and change it to neutral or friendly.

This works fine. When you change it to neutral: all players can access the trader. When you change it to friendly: only people with positive humanity can access that trader.

Link to comment
Share on other sites

  • 0

Is it really as simple as that  :P doh! I feel such a noob now and I looked at that too.

 

So here's another question. Do you know what I would have to do to alter the amount of humanity needed to access the bandit or hero trader? I'm assuming there is a script somewhere that checks it?

Link to comment
Share on other sites

  • 0

You can change humanity values in fn_selfActions.sqf, obviously a custom file is needed unless you have one already.

 

Just find this part of the file and change it as you see fit

_low_high = "low";
_humanity_logic = false;
if((_traderMenu select 2) == "friendly") then {
_humanity_logic = (_humanity < -5000);
};
if((_traderMenu select 2) == "hostile") then {
_low_high = "high";
_humanity_logic = (_humanity > -5000);
};
if((_traderMenu select 2) == "hero") then {
_humanity_logic = (_humanity < 5000);
};
Link to comment
Share on other sites

  • 0

awesome thanks. So if I wanted a donator specific trader I could copy and paste the bottom one, call it "donator", set the humanity value and then just assign "donator" to my custom trader instead of "neutral" or whatever yes?

Maybe a better way for a donator trader:

if((_traderMenu select 2) == "donor") then {
_humanity_logic = ((getPlayerUID player) in Donator_UIDS);
};

Then define Donator_UIDS in Variables.sqf  with DonatorUIDS = ["123452362623","124125215123513","2451251252352"];

 

I did not try it. but it should work.

Link to comment
Share on other sites

  • 0

I know I'm being thick so please bear with me  :)

 

So you're saying that I go into my variables.sqf inside my dayz_code and add the variable "Donator_UIDS = ["123452362623","124125215123513","2451251252352];" then the code in the humanity part of the self actions (as per the example in your earlier post) would reference the variables.sqf?

Link to comment
Share on other sites

  • 0

You need to make a custom variables file if you already don't have one.

 

As in just create empty variables.sqf file, past that donator uid thing in there, save and and place it somewhere in your mission folder/pbo

 

then open up your init.sqf and add this line right below original call for variables file

call compile preprocessFileLineNumbers "custom\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)

So it looks like this

//Load In Compiled Functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "custom\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;

Not that empty custom file will work as long as you don't have a mod that requires you to overwrite a certain function, same goes with compiles.sqf file and when you decide to go that way just take those files from dayz_code.pbo and copy them over into your mission folder/pbo to modify (remember to change paths)

Link to comment
Share on other sites

  • 0

Ok so I have made a bit of progress with this. Entered a custom donator trader into my server_traders.sqf with "donor" as his type (normally where friendly, hostile etc goes), also added him into the mission.sqf. I then added him as a new trader into the database giving him a status of "donor". I then set him a TID which is also referenced in the server_trader.sqf and I added an item for him in the trader_data table.

 

That's it as far as I can see. When I go in game however, he is not showing up. So, if he's not showing it is either a wrong skin or a mismatch between what is in the server_trader.sqf and the mission.sqf yes?

 

The database entries are only to do with his trader menu unless I'm missing something?

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...