Freddywall 11 Posted September 23, 2019 Hello, i'd like to increase damage by bullets to player how i can do that? Share this post Link to post Share on other sites
gokitty1199 225 Posted September 23, 2019 a lazy way is with a hit event handler kind of like so. is it possible to alter the damage done by weapons without altering configs? player addEventHandler ["Hit", { params ["_unit", "_source", "_damage", "_instigator"]; if (alive _unit) then { _currentDamage = getDammage _unit; _newDamage = _currentDamage + 0.1; _unit setDamage _newDamage; }; }]; 1 Share this post Link to post Share on other sites
killzone_kid 1326 Posted September 24, 2019 If you are going to use getDammage might as well use setDammage for consistency 1 Share this post Link to post Share on other sites
gokitty1199 225 Posted September 24, 2019 1 hour ago, killzone_kid said: If you are going to use getDammage might as well use setDammage for consistency question, whats the difference? ive always wondered if there was a difference between setDamage and setDammage Share this post Link to post Share on other sites
killzone_kid 1326 Posted September 24, 2019 Sorry, I can’t tell you more than what it already says on wiki Share this post Link to post Share on other sites
haleks 8204 Posted September 24, 2019 Don't use setdamage/setdammage, it has a very simplistic behaviour and should not be used for units with multiple hitpoints. HandleDamageEH is preferable IMO : params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; if (_projectile isEqualTo "") exitWith {false}; _original_damage = if (_selection isEqualTo "") then {damage _unit} else {_unit getHit _selection}; _added_damage = _damage - _original_damage; _coef = 1;//change this to increase or decrease _final_damage = _original_damage + _added_damage*_coef; _final_damage 3 Share this post Link to post Share on other sites
Freddywall 11 Posted September 25, 2019 22 hours ago, haleks said: Don't use setdamage/setdammage, it has a very simplistic behaviour and should not be used for units with multiple hitpoints. HandleDamageEH is preferable IMO : params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; if (_projectile isEqualTo "") exitWith {false}; _original_damage = if (_selection isEqualTo "") then {damage _unit} else {_unit getHit _selection}; _added_damage = _damage - _original_damage; _coef = 1;//change this to increase or decrease _final_damage = _original_damage + _added_damage*_coef; _final_damage seems it doesn't work. Where should i put it? Share this post Link to post Share on other sites
haleks 8204 Posted September 25, 2019 3 hours ago, Freddywall said: seems it doesn't work. Where should i put it? Don't know where to put it? Spoiler Well, where did you put it? There're multiple ways for this, one of them being initPlayerLocal.sqf : player addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; if (_projectile isEqualTo "") exitWith {false}; _original_damage = if (_selection isEqualTo "") then {damage _unit} else {_unit getHit _selection}; _added_damage = _damage - _original_damage; _coef = 1;//change this to increase or decrease _final_damage = _original_damage + _added_damage*_coef; _final_damage }]; 1 3 Share this post Link to post Share on other sites
Freddywall 11 Posted September 28, 2019 On 9/25/2019 at 7:27 PM, haleks said: Don't know where to put it? Reveal hidden contents Well, where did you put it? There're multiple ways for this, one of them being initPlayerLocal.sqf : player addEventHandler ["HandleDamage", { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; if (_projectile isEqualTo "") exitWith {false}; _original_damage = if (_selection isEqualTo "") then {damage _unit} else {_unit getHit _selection}; _added_damage = _damage - _original_damage; _coef = 1;//change this to increase or decrease _final_damage = _original_damage + _added_damage*_coef; _final_damage }]; Working. Thank u 1 Share this post Link to post Share on other sites