Arma 3 Scripting

Command in Map, Interaction

visibleMap

Also available as Markdown and JSON, or read the original wiki page.

Description

Return true if the main map is shown (active). In Arma 3 it also returns true if the respawn screen map is visible.

Syntax

visibleMap

Returns: Boolean

Examples

Example 1

if (visibleMap) then { hint "You're showing the map !" };

See also

forceMap · openMap

Community notes

3.JgKp James

visibleMap does not work in all cases where a map might be part of a dialog like in a uav terminal or in a artillery computer dialog. Some of these cases can be covered with an addMissionEventHandler of type "Map". Just use the two magic variables 'mapIsOpened' and 'mapIsForced'. Skeleton might look something like:

// update marker as long as map is open (works for UAV stations as well)
J_myGPSEH = addMissionEventHandler ["Map", {

    params ["_mapIsOpened", "_mapIsForced"];

    if (_mapIsOpened) then
    {
        systemChat "GPS active";
        J_var_GPSOn = true;

        // no sheduled environment -> create one
        /* Triggered when map is opened or closed either by user action or script command openMap. */
        0 spawn {
            waitUntil { 
                // ... // do something as long as map is open
                not J_var_GPSOn;
            };
        };
    }
    else
    {
        J_var_GPSOn = false;
        systemChat "GPS inactive";
    };
}];