Jump to content
Sign in to follow this  
SirMrE

Overwriting FirstAidKits' action

Recommended Posts

Hi everyone,

 

I am trying to figure out how to either overwrite the action of a FirstAidKit.

Currently the FirstAidKit will heal you to n% and can be used by everyone. I want to either overwrite the FirstAidKits to do a custom action which I will be scripting or somehow make the "heal" action from the FirstAidKit not show in the player's action menu's when hurt.

 

Is this possible or will I need to, somehow, create my own item to achieve this? I am trying to avoid having to make any client-side mods, and only rely on the vanilla (incl. expansions) version of ARMA 3.

 

Appreciate any help with this!

Share this post


Link to post
Share on other sites

You cannot remove actions which are in ArmA by default, just as you can't remove the "open/close door" action, because they are not added by SQF.

 

Concerning overwriting the healing though, have a look at the "HandleHeal" event handler. It has an example which you can easily adapt for your needs.

Share this post


Link to post
Share on other sites

From A3 1.50:

// initPlayerLocal.sqf
 

inGameUISetEventHandler [
     "Action", 
     "
          _target = _this select 0;
          if ((_this select 3) in ['HealSoldier','HealSoldierSelf']) then {
               [player,_target,_this select 3] spawn TAG_fnc_myCustomHealFunction;
               true;
          };
     "
];

Further reading:

 

https://community.bistudio.com/wiki/inGameUISetEventHandler

https://community.bistudio.com/wiki/Arma_3_Actions#Heal

 

Enjoy :)

 

  • Like 2

Share this post


Link to post
Share on other sites

Thank you soo much for the help, I appreciate it! :)

Share this post


Link to post
Share on other sites

From A3 1.50:

// initPlayerLocal.sqf
 

inGameUISetEventHandler [
     "Action", 
     "
          _target = _this select 0;
          if ((_this select 3) in ['HealSoldier','HealSoldierSelf']) then {
               [player,_target,_this select 3] spawn TAG_fnc_myCustomHealFunction;
               true;
          };
     "
];

Further reading:

 

https://community.bistudio.com/wiki/inGameUISetEventHandler

https://community.bistudio.com/wiki/Arma_3_Actions#Heal

 

Enjoy :)

To all viewing this post, keep in mind that the current stable version of arma 3 is 1.48, in which this command does nothing. You must use the dev branch (99% of players don't even know this exists btw).

Share this post


Link to post
Share on other sites

To all viewing this post, keep in mind that the current stable version of arma 3 is 1.48, in which this command does nothing. You must use the dev branch (99% of players don't even know this exists btw).

 

That would be 1.50 yes?

 

Thanks for that additional titbit of info.

Share this post


Link to post
Share on other sites

Dev branch is currently 1.51.

Ah gotcha, thanks.

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
Sign in to follow this  

×