visibleMap: Difference between revisions
Jump to navigation
Jump to search
3.JgKp James (talk | contribs) (added example of EH) |
Lou Montana (talk | contribs) m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>") |
||
(56 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma2 |= | |game1= arma2 | ||
|version1= 1.00 | |||
|1. | |game2= arma2oa | ||
|version2= 1.50 | |||
| | |game3= tkoh | ||
|version3= 1.00 | |||
| | |game4= arma3 | ||
|version4= 0.50 | |||
| | |gr1= Map | ||
| | |gr2= Interaction | ||
| | |descr= Return true if the main map is shown (active). In {{arma3}} it also returns true if the respawn screen map is visible. | ||
| [[ | |s1= [[visibleMap]] | ||
|r1= [[Boolean]] | |||
|x1= < | |x1= <sqf>if (visibleMap) then {hint "You're showing the map !"};</sqf> | ||
|seealso= [[forceMap]] [[openMap]] | |||
| [[forceMap]] | |||
}} | }} | ||
<dl class="command_description"> | |||
<dl class= | |||
<dd class="notedate">Posted on 13 November 2017 | <dt><dt> | ||
<dt class="note> | <dd class="notedate">Posted on 13 November 2017</dd> | ||
<dt class="note">[[User:Jamesadamar|James]]</dt> | |||
<dd class="note"> | <dd class="note"> | ||
[[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 | [[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: | |||
<sqf> | |||
// update marker as long as map is open (works for uav stations as well) | // update marker as long as map is open (works for uav stations as well) | ||
J_myGPSEH = addMissionEventHandler ["Map", { | 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"; | |||
}; | |||
}]; | |||
</sqf> | |||
</dd> | |||
</dl> | </dl> | ||
Latest revision as of 19:43, 3 September 2024
Description
- Description:
- Return true if the main map is shown (active). In Arma 3 it also returns true if the respawn screen map is visible.
- Groups:
- MapInteraction
Syntax
- Syntax:
- visibleMap
- Return Value:
- Boolean
Examples
- Example 1:
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on 13 November 2017
- 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"; }; }];