Jump to content
Sign in to follow this  
Jimi Markkanen

Script showing unconcious units on map

Recommended Posts



I'm trying to create a script which would show ACE-unconcious units on the map within a certain radius as markers. This is for a medical scenario to act as a way for the AI groups to ask for medical support, to let the player be aware of unconcious AI units on the field.


Quickly going through ace github I found "IS_UNCONCIOUS(_unit)" which could be helpful but to be honest, my scripting knowledge is quite narrow. I hope someone can be of help to me.


Share this post

Link to post
Share on other sites

Really could use some help here. If someone can help even with having a marker appear on condition that would be helpful. 

Share this post

Link to post
Share on other sites

@Jimi Markkanen, I don't use ACE but I can provide some code.

First, add this code to some of event scripts (e. g., initPlayerLocal.sqf):

drawUnconsciousUnitIcons = compileFinal (preprocessFileLineNumbers "drawUnconsciousUnitIcons.sqf");

_display = displayNull;

waitUntil {
    _display = findDisplay 12;

    !(isNull _display)

(_display displayCtrl 51) ctrlAddEventHandler ["Draw", { call drawUnconsciousUnitIcons; }];

Second, create drawUnconsciousUnitIcons.sqf file and add this content into it:

params ["_control"];

    if ((_x getVariable ["IS_UNCONCIOUS", false]) and { (vehicle _x) == _x }) then {
        _control drawIcon [
            getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "icon"),
            [1, 0, 0, 1],
            getPosASLVisual _x,
            getDirVisual _x,
            name _x,
} forEach allPlayers;

It's all.

  • Like 1

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