Jump to content
Rawshark

Creating an ACE 3 unconscious player marker

Recommended Posts

 I was wondering if it was possible to create a script where, once a player goes down, their unconscious position could be marked on the map for all playable units to see. Scouring the internet I found a script where the positions would be revealed to the medics on the map

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    if ([player] call ace_medical_fnc_isMedic) then {
        {
            if (_x getVariable ["ACE_unconcious",false]) then {
                _this select 0 drawIcon ['\A3\ui_f\data\igui\cfg\actions\heal_ca.paa',[1,0,0,1],position _x,24,24,0,name _x,1,0.03,'TahomaB','right']
            };
            false
        } count allPlayers
    };
}]

So, to make modify it a bit further would it be possible to edit it like so to make the positions be visible to all playable units?
 

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    if (player) then {
        {
            if (_x getVariable ["ACE_unconcious",false]) then {
                _this select 0 drawIcon ['\A3\ui_f\data\igui\cfg\actions\heal_ca.paa',[1,0,0,1],position _x,24,24,0,name _x,1,0.03,'TahomaB','right']
            };
            false
        } count allPlayers
    };
}]

Share this post


Link to post
Share on other sites

Sorry for the bump. Would still love any help as I haven't been able to get it to work.

Share this post


Link to post
Share on other sites

player is not a boolean. So if (player) then { ...};   doesn't make sense.  Just remove this condition (mind for the both {} );

Share this post


Link to post
Share on other sites

Hey Pierre,

Thanks for the reply! Does the following look about right? I didnt get any errors when in the editor but haven't as of yet tested it in MP.

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
    {
		if (_x getVariable ["ACE_unconcious",false]) then {
		_this select 0 drawIcon ['\A3\ui_f\data\igui\cfg\actions\heal_ca.paa',[1,0,0,1],position _x,24,24,0,name _x,1,0.03,'TahomaB','right']
        };
        false
    } count allPlayers
}];

Also if I may ask, for a dedicated server would this be better off in an init.sqf or initPlayerLocal.sqf?
Thanks again for the help!

Share this post


Link to post
Share on other sites

I guess you want to draw icon for players... so, the initPlayerLocal is fine.

The init. sqf works also if you are waiting for !isNull findDisplay 12 (i.e. in mission screen) or other means.

On a dedicated server or headless clients, there is no interface (player), so findDisplay 12 displayCtrl 51 (in game) is probably never met. But no worry for playing clients.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you so much. Will just insert it to initPlayerLocal and see how it goes. 😀

Thanks again!

Share this post


Link to post
Share on other sites

Here is a nice script snippet that would allow quick revives like invade and annex when using ACE.

 

med = {

	if ( (typeOf player == "rhsusf_socom_marsoc_sarc") or (typeOf player == "rhsusf_army_ocp_medic") || (_this select 0 distance player) < 3 ) then {
		["Administering first aid.", 9, {true}, {}, {}] call CBA_fnc_progressBar;
		player playMove "AinvPknlMstpSnonWnonDr_medic5";
		sleep 13;
		[player, _this select 0] call ace_medical_treatment_fnc_fullHeal;
	};
};

myfnc_uncon_special = {
	params ["_unit", "_isUnconscious"];

	if ( (typeOf player == "rhsusf_socom_marsoc_sarc") or (typeOf player == "rhsusf_army_ocp_medic") ) then {
		private _action = _unit addAction ["Revive", {call med;}];
		_unit setUserActionText [_action , "Revive", "<img size='2' image='\A3\Ui_f\data\IGUI\Cfg\Revive\overlayIcons\r75_ca.paa'/>"];
	};

if (!_isUnconscious) then {
	removeAllActions _unit;
};

};

["ace_unconscious", myfnc_uncon_special] call CBA_fnc_addEventHandler;

This might be very useful for you as well. Give it a go and see what you think.

  • Like 1

Share this post


Link to post
Share on other sites
On 8/26/2020 at 3:37 PM, jakeplissken said:

Here is a nice script snippet that would allow quick revives like invade and annex when using ACE.

 


med = {

	if ( (typeOf player == "rhsusf_socom_marsoc_sarc") or (typeOf player == "rhsusf_army_ocp_medic") || (_this select 0 distance player) < 3 ) then {
		["Administering first aid.", 9, {true}, {}, {}] call CBA_fnc_progressBar;
		player playMove "AinvPknlMstpSnonWnonDr_medic5";
		sleep 13;
		[player, _this select 0] call ace_medical_treatment_fnc_fullHeal;
	};
};

myfnc_uncon_special = {
	params ["_unit", "_isUnconscious"];

	if ( (typeOf player == "rhsusf_socom_marsoc_sarc") or (typeOf player == "rhsusf_army_ocp_medic") ) then {
		private _action = _unit addAction ["Revive", {call med;}];
		_unit setUserActionText [_action , "Revive", "<img size='2' image='\A3\Ui_f\data\IGUI\Cfg\Revive\overlayIcons\r75_ca.paa'/>"];
	};

if (!_isUnconscious) then {
	removeAllActions _unit;
};

};

["ace_unconscious", myfnc_uncon_special] call CBA_fnc_addEventHandler;

This might be very useful for you as well. Give it a go and see what you think.

This is very helpful.
Is there a way to make this available for unconscious BLUFOR (west) only? I think now it recognizes any unconscious. Also, does this work for for MP dedicated (running from initPlayerLocal.sqf)?

Edited by Soapbox0331
Additional question

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

×