Jump to content
Arquilius

[SOLVED] Ace Medical Full Heal in Vehicle

Recommended Posts

Good evening everyone, I was making a mission but i'm kinda stuck at some point of the code. Would really appreciate some help ^^.

 

Idea of the code:

- Create an addAction on a vehicle instantly healing the crew (or just the injured soldier inside the vehicle),

- addAction should only be visible (or activated) by medics who should be inside the vehicle to activate (that last part works with a 2m radius for the addAction),

- Code for a multiplayer mission.

 

Current code (in the init of the vehicle, vehicle name : "healing_vec_2") :

this addAction  
[  
 "Heal",  
 {  
 {[objNull, player] call ace_medical_treatment_fnc_fullHeal} forEach crew healing_vec_2; 
 },  
 nil,  
 1.5,  
 true,  
 true,  
 "",  
 "true",  
 2,  
 false,  
 "",  
 ""  
];

 

Current issues:

- I have absolutly no idea how to condition on being a medic in order to see the action,

- (Only tested it on an IA inside the vehicle), apparently it only works on the player activating the action, the AI still had the legs injured.

 

Any idea how i could rewrite this code to make it work? Thks for the help everyone!

Share this post


Link to post
Share on other sites

Ok i'm just gonna keep posting my progress (if it can help people). So I've decided to switch to a holdaction in the init of the healing vehicle. 

 

[this, 
"Heal soldiers", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",     
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa", 
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)", 

                           // Condition to show the action the caller (_this) needs to be a medic AND needs to be inside the vehicle (_target)
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)",  

                           // Condition to progress in the action the caller (_this) needs to be a medic AND needs to be inside the vehicle (_target)
{hint format ["%1 is providing medical care inside the vehicle.", name player]},  

                           // Code once the caller starts the interaction : general hint informing that medical care is performed (the original idea is that I did not want to have people

                           loading up wounded people while the action is performed, normaly the healing comes at the completion of the action so it should not be an issue but just in

                           case...)
{format ["%1, you're providing medical care inside the vehicle.", name player] remoteExec ["hintSilent", _this select 1]},  

                           // Code for each progression tile : Silent hint informing the caller (_this select 1 (Object)) that the interaction is working so far.                                                   
{[player, player] call ace_medical_treatment_fnc_fullHeal;},

                           // Right now this is only healing the caller however i need to heal all the crew in _target (I know i could try to heal only the injured but the ACE injuries status is

                           quite complexe for me. Having some typo issues with 

                                                      {

                                                                {[player, _x] call ace_medical_treatment_fnc_fullHeal;} forEach crew _target;

                                                      },
{format ["%1, medical care was not provided!", name player] remoteExec ["hintSilent", _this select 1]}, 

                           // Code for each progression tile : Silent hint informing the caller (_this select 1 (Object)) that the interaction is working so far.                                                   
[],     
10,     
0, 
false,

                           // Making the action repeatable 
false  
] call bis_fnc_holdActionAdd;

Share this post


Link to post
Share on other sites

Ok so this seems to work :

 

[this, 
"Heal soldiers", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",     
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa", 
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)", 
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)", 
{hint format ["%1 is providing medical care inside the vehicle.", name player]}, 
{format ["%1, you're providing medical care inside the vehicle.", name player] remoteExec ["hintSilent", _this select 1]},
{
    {[player, _x] call ace_medical_treatment_fnc_fullHeal;} forEach crew _target; format ["%1, you've provided medical care.", name player] remoteExec ["hintSilent", _this select 1]; 
}, 
{format ["%1, medical care was not provided!", name player] remoteExec ["hintSilent", _this select 1]}, 
[],     
10,     
0, 
false, 
false  
] call bis_fnc_holdActionAdd;

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

×