Jump to content
SeelieKnight

ACE Medical: Change Wound Type When Hit

Recommended Posts

I'm trying to come up with a way to change the wounds inflicted by bullets in the ACE medical system. For example, if shot with a bullet, change the possible wounds from 'avulsion'/'velocity wound'/etc. to 'bruise'/'crushed tissue'.  Ideally I'd like to alter the values that are passed to ACE woundsHandler function, but I'm not sure how all that is implemented. Anyone got insight on this? 

Share this post


Link to post
Share on other sites

You can overwrite ACE Medical with;
 

this removeAllEventHandlers "HandleDamage";
this addEventHandler
[
	"HandleDamage",
	{
		params ["_unit", "", "_damage", "", "", "", "_instigator", ""];
	}
];


The rest is up to you.

Share this post


Link to post
Share on other sites
21 minutes ago, Maff said:

You can overwrite ACE Medical with;
 


this removeAllEventHandlers "HandleDamage";
this addEventHandler
[
	"HandleDamage",
	{
		params ["_unit", "", "_damage", "", "", "", "_instigator", ""];
	}
];


The rest is up to you.


Thanks! I actually thought this wouldn't work because it didn't seem like the damage and hit part values matched up between HandleDamage and the ACE functions. But I just tried your suggestion of removing the existing Event Handler, then adding my own, and it actually seems to be working pretty great! For reference, here is the code I used to get the basic effect I wanted:

 

_unit = _this select 0;

sleep 1;
_unit removeAllEventHandlers "HandleDamage";

_unit addEventHandler ["HandleDamage", {
	private _unit = _this select 0;
	private _hitselection = _this select 1;
	private _damage = _this select 2;
	
	_damage = _damage * 0.05; //Modify incoming damage to reduce severity of injuries
	
	[_unit, _damage, _hitselection, "punch"] call ace_medical_fnc_addDamageToUnit; //Use ACE's manual method of adding damage to units, use damage type "punch" to get less serious injuries
	
	hint format ["%1 \n%2", _unit getVariable "ace_medical_openwounds", _unit getVariable "ace_medical_woundbleeding"];
	
	0
}];

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×