Draxanoth
Member
Has anyone seen a modification to the custom loadout code that will assign a loadout according to humanity levels? I'd like to solidify the choice between Bandits and Friendlies and I think this might work.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I'll give it a go. I'm not that well versed in whatever language ARMA uses unfortunately, but once I get a rough something maybe someone can help me tweak it.check out this link here: http://opendayz.net/threads/random-premade-starting-gear.6698/
you should be able to edit the code (_humanity > 5000) then { for heros and bandits. If i where you I'd try that out.
I haven't had a good chunk of time to dedicate to it yet.just kinda checking in did you ever get this figured out draxanoth?
Exactly. I would think that instead of simply reading the field that has a player's static loadout assignment I could modify it to evaluate their humanity, and then pick from a list of loadout codes. Then if you want to modify the loadout you just modify it in the DB instead of tinkering with the sqf again.I personally have no interest in this however i do agree. I would do it as database loadouts and find how it gives players custom UID loadouts and modify that code to be instead of custom UID be humanity. Of course everything is easier said than done! however, that's what i'd do.
If you need/want any help let me know and i'll do my best to help you with this when i get time in between my own personal coding projects![]()
If I still can't figure it out I may want you to flat out tell me anyway. lolI think i know how to do this now thanks to the insight you gave me in the other thread. I haven't tested it yet though. imma pass out for a while cause ive been up WAY to long. i'll test it later tonight and if it works point you in the right direction (i know you want to figure it out so i wont just flat out tell you just hint you back on track)
72 hours? Seriously? Might be time to take some benadryl and knock yourself out.Let me run some tests. i'm back from my nap non effective nap. Let me play and i'll let you know what i find
That's exactly the same method I was thinking would work. I tried the same thing, the game loaded fine, but I still got the default loadout instead of the one I wanted.ok so i've done a little work with it and it's still a dud. however i am making progress! i'm on the right track i'll keep working at it. basically in the database typing in a humanity value under unique id in custom_loadout_profile. and in the line you found about the server reading this i'm changing it from matching that number (that i've set to a humanity value) to the players UID (currently default) to matching it with the players humanity level.
like i said it doesn't work the way it should jsut yet but im making progress![]()
I gave that method an attempt blur but humanity is stored on a different table and I'm not sure how to load it. If I could it looks like it would work. Not as elegant as the normal load-out procedure, but it would work if I can pull the humanity value in. That of course has been my entire issue, reading and writing data to the database.check out this link here: http://opendayz.net/threads/random-premade-starting-gear.6698/
you should be able to edit the code (_humanity > 5000) then { for heros and bandits. If i where you I'd try that out.
//HUMANITY LOADOUTS - ADDED BY RT 1/9/2014
if (true) then {
diag_log ("FETCHING HUMANITY...");
_key = format["CHILD:999:select humanity from `profile` where `unique_id` = '?':[%1]:",str(_playerID)];
_data = "HiveEXT" callExtension _key;
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
if (_status == "CustomStreamStart") then {
if ((_result select 1) > 0) then {
_data = "HiveEXT" callExtension _key;
_result = call compile _data;
_humanity = _result select 0;
};
};
};
diag_log ("Humanity:" + str(_humanity));
_bandit = 100; //table id for bandit loadout
_hero = 101; //table id for hero loadout
if (_humanity >= 5000) then {
diag_log ("FETCHING HERO LOADOUT...");
_key = format["CHILD:999:select replace(`inventory`, '""', '\'') `inventory`, replace(`backpack`, '""', '\'') `backpack` from `loadouts` where `id` = ?:[%1]:",_hero];
_data = "HiveEXT" callExtension _key;
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
if (_status == "CustomStreamStart") then {
if ((_result select 1) > 0) then {
_data = "HiveEXT" callExtension _key;
_result = call compile _data;
_inventory = call compile (_result select 0);
_backpack = call compile (_result select 1);
};
};
};
if (_humanity <= -2500) then {
diag_log ("FETCHING BANDIT LOADOUT...");
_key = format["CHILD:999:select replace(`inventory`, '""', '\'') `inventory`, replace(`backpack`, '""', '\'') `backpack` from `loadouts` where `id` = ?:[%1]:",_bandit];
_data = "HiveEXT" callExtension _key;
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
if (_status == "CustomStreamStart") then {
if ((_result select 1) > 0) then {
_data = "HiveEXT" callExtension _key;
_result = call compile _data;
_inventory = call compile (_result select 0);
_backpack = call compile (_result select 1);
};
};
};
//END HUMANITY LOADOUTS BY RT
if (true) then {
_key = format["CHILD:999:select replace(`inventory`, '""', '\'') `inventory`, replace(`backpack`, '""', '\'') `backpack` from `instance` where `id` = ?:[%1]:",dayZ_instance];
_data = "HiveEXT" callExtension _key;
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
if (_status == "CustomStreamStart") then {
if ((_result select 1) > 0) then {
_data = "HiveEXT" callExtension _key;
_result = call compile _data;
_inventory = call compile (_result select 0);
_backpack = call compile (_result select 1);
};
};
};
//PLACE NEW CODE HERE
if (true) then {
_key = format["CHILD:999:select replace(cl.`inventory`, '""', '\'') inventory, replace(cl.`backpack`, '""', '\'') backpack, replace(coalesce(cl.`model`, 'Survivor2_DZ'), '""', '\'') model from `cust_loadout` cl join `cust_loadout_profile` clp on clp.`cust_loadout_id` = cl.`id` where clp.`unique_id` = '?':[%1]:",str(_playerID)];
_data = "HiveEXT" callExtension _key;
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
if (_status == "CustomStreamStart") then {
if ((_result select 1) > 0) then {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1", _data];
_inventory = call compile (_result select 0);
_backpack = call compile (_result select 1);
_model = call compile (_result select 2);
};
};
};
private ["_botActive","_doLoop","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_primary","_key","_charID","_playerName","_items","_magazines","_weapons","_backpack","_humanity","_hero","_bandit","_worldspace","_direction","_newUnit","_isNew","_inventory","_survival","_state","_model","_config","_mags","_wpns","_bcpk","_medicalStats","_tent","_newPlayer"];