mark88 Posted August 8, 2014 Report Share Posted August 8, 2014 I want to re-write the humanity system (with some success already)! First i overwrite the cliend-side fn_damageHandler.sqf, and removed following part: /* _canHitFree = player getVariable ["freeTarget",false]; _isBandit = (player getVariable["humanity",0]) <= -5000; _isPZombie = player isKindOf "PZombie_VB"; if (!_canHitFree && !_isBandit && !_isPZombie) then { //Process Morality Hit _myKills = 0 max (1 - (player getVariable ["humanKills",0]) / 5); _humanityHit = -100 * _myKills * _damage; if (_humanityHit != 0) then { [_source,_humanityHit] spawn { private ["_source","_humanityHit"]; _source = _this select 0; _humanityHit = _this select 1; PVDZE_send = [_source,"Humanity",[_source,_humanityHit,30]]; publicVariableServer "PVDZE_send"; }; }; }; */ I believe this is some epoch "wannabe" random humanity crap (never understood why). Now in server_playerDied.sqf i added following: (...) if ((owner _victim) == (owner _killer)) then { (...) _message = format["%1 killed himself",_victimName]; _loc_message = format["PKILL: %1 killed himself", _victimName]; } else { //custom humanity private ["_vichumanity","_killerhumanity"]; _vichumanity = _victim getVariable ["humanity",0]; _killerhumanity = _killer getVariable ["humanity",0]; //bandit/hero // level1 +/- 5000 // level2 +/- 10000 // level3 +/- 20000 // a hero who kills a hero, same loss of humanity at any time if((_vichumanity > 4999)) then { if(_killerhumanity > 4999) then { // lvl1 hero kille by lvl3 hero _killerhumanity = _killerhumanity - 800; _killer setVariable ["humanity",_killerhumanity,true]; _vichumanity = _vichumanity - 300; _victim setVariable ["humanity",_vichumanity,true]; }; }; //custom humanity _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance]; _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance]; }; (...) Tested with 2 Players, both had exactly 5000 humanity. Victim was killed by Killer. Victim humanity: 4700 (should be 4700) Killer humanity: 2987 (should be 4200) I dont get it, where else does epoch screw up the humanity? Anyone got any idea? Link to comment Share on other sites More sharing options...
0 rss_adm Posted September 4, 2014 Report Share Posted September 4, 2014 very interesting question! I would also like to know. how to add to hero humanity for kill bandits? Link to comment Share on other sites More sharing options...
0 rss_adm Posted September 10, 2014 Report Share Posted September 10, 2014 can do like this? but I don't understand coding.. https://github.com/joenilan/DayZOrigins/blob/master/@dayz_1.origins.tavi/addons/dayz_server/compile/disco_playerDeath.sqf Link to comment Share on other sites More sharing options...
0 js2k6 Posted September 10, 2014 Report Share Posted September 10, 2014 i don't have the answer you seek, I'm actually looking at changing the humanity gain/loss system also I just used windows grep on a de-pbo'd dayz_code and searched for humanity I suspect local_eventKill may be the one we're looking for. But I can't be certain just yet. (ninja edit: nope.. thats to do with zombie kills) Link to comment Share on other sites More sharing options...
Question
mark88
I want to re-write the humanity system (with some success already)!
First i overwrite the cliend-side fn_damageHandler.sqf, and removed following part:
I believe this is some epoch "wannabe" random humanity crap (never understood why).
Now in server_playerDied.sqf i added following:
Tested with 2 Players, both had exactly 5000 humanity.
Victim was killed by Killer.
Victim humanity: 4700 (should be 4700)
Killer humanity: 2987 (should be 4200)
I dont get it, where else does epoch screw up the humanity?
Anyone got any idea?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now