openMap: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}")
m (Text replacement - "\|x([0-9]) *= * <code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
(39 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.03


|1.03|Game version=
|game2= arma2oa
|version2= 1.50


|eff= local|Multiplayer Effects=
|game3= tkoh
|version3= 1.00


|gr1= Map |GROUP1=
|game4= arma3
|version4= 0.50


|gr2= Interaction |GROUP2=
|eff= local
____________________________________________________________________________________________


| Opens or closes in-game map.<br><br>
|gr1= Map
{{Warning | If <tt>forced</tt> param is set to [[true]], when map is opened it cannot be closed manually and the user can get stuck requiring the game restart. Make sure you provide scripted mechanics to resolve this, should you need to force the map.}} |DESCRIPTION=
____________________________________________________________________________________________


| [[openMap]] show |SYNTAX=
|gr2= Interaction


|p1= show: [[Boolean]] - if [[true]] opens map, if [[false]] closes map, provided it is not ''forced'' |PARAMETER1=
|descr= Opens or closes in-game map.{{Feature | Warning | If {{hl|forced}} param is set to [[true]] and map is set to open, when the map is opened it cannot be closed manually and the user can get stuck requiring the game restart. Make sure you provide scripted mechanics to resolve this, should you need to force the map. Useful when you wish to keep user for example on respawn screen, where they could still interact with the map but cannot enter the game until the time is up
<br>
Since Arma 3 v2.06.147984 the alternative syntax has the following functionality:
* [[openMap]] <nowiki>[</nowiki>[[true]], [[false]]] - opens map normally
* [[openMap]] <nowiki>[</nowiki>[[false]], [[false]]] - closes opened map normally
* [[openMap]] <nowiki>[</nowiki>[[true]], [[true]]] - force opens map and keeps open (the user cannot close it on their own)
''New''
* [[openMap]] <nowiki>[</nowiki>[[false]], [[true]]] - prevents map from opening, closes open map and forces it to stay close (the user cannot open it on their own)}}


| [[Boolean]] - equivalent of [[visibleMap]] |RETURNVALUE=
|s1= [[openMap]] show
____________________________________________________________________________________________


|s2= [[openMap]] [show, forced] |SYNTAX2=
|p1= show: [[Boolean]] - if [[true]] opens map, if [[false]] closes map, provided it is not ''forced''


|p21= show: [[Boolean]] - if [[true]] opens map, if [[false]] closes map, provided it is not ''forced''. |PARAMETER21=
|r1= [[Boolean]] - equivalent of [[visibleMap]]


|p22= forced: [[Boolean]] - if [[true]] keeps map from closing when map is open. |Parameter22=
|s2= [[openMap]] [show, forced]


|r2= [[Boolean]] - equivalent of [[visibleMap]]|RETURNVALUE2=
|p21= show: [[Boolean]] - if [[true]] opens map, if [[false]] closes map, provided it is not ''forced''.
____________________________________________________________________________________________


|x1= <code>[[openMap]] [[true]];</code> |EXAMPLE1=
|p22= forced: [[Boolean]] - if [[true]] keeps map from closing when map is open. Arma 3 v2.06.147984, if [[false]], forces map to stay closed if 'show' is [[false]] (see description)


|x2= <code>[[openMap]] [<nowiki/>[[true]], [[true]]];</code> |EXAMPLE2=
|r2= [[Boolean]] - equivalent of [[visibleMap]]


____________________________________________________________________________________________
|x1= <sqf>openMap true;</sqf>


| [[forceMap]], [[forcedMap]], [[visibleMap]], [[showMap]], [[shownMap]] |SEEALSO=
|x2= <sqf>openMap [true, true];</sqf>
 
|seealso= [[forceMap]] [[forcedMap]] [[visibleMap]] [[showMap]] [[shownMap]]
}}
}}


<h3 style='display:none'>Notes</h3>
{{Note
<dl class='command_description'>
|user= Fraali
<!-- Note Section BEGIN -->
|timestamp= 20211208110058
|text= ('''As of Arma 3 ver.2.06.148470''') <br>
Trying to close a map using 'closeMap false' inside of a map event handler like <br>
''''addMissionEventHandler["Map",{closeMap false}];'''' <br>
will cause the game to crash.<br>
To fix this, please use it inside of a spawned script.<br>
Ex. ''''addMissionEventHandler["Map",{[] spawn {closeMap false};}];''''<br>
<br>
This should stop any issue of crashing when you close the map.


<!-- Note Section END -->
}}
</dl>
 
<h3 style='display:none'>Bottom Section</h3>
 
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Revision as of 11:38, 13 May 2022

Hover & click on the images for description

Description

Description:
Opens or closes in-game map.
If forced param is set to true and map is set to open, when the map is opened it cannot be closed manually and the user can get stuck requiring the game restart. Make sure you provide scripted mechanics to resolve this, should you need to force the map. Useful when you wish to keep user for example on respawn screen, where they could still interact with the map but cannot enter the game until the time is up


Since Arma 3 v2.06.147984 the alternative syntax has the following functionality:

New

  • openMap [false, true] - prevents map from opening, closes open map and forces it to stay close (the user cannot open it on their own)
Groups:
MapInteraction

Syntax

Syntax:
openMap show
Parameters:
show: Boolean - if true opens map, if false closes map, provided it is not forced
Return Value:
Boolean - equivalent of visibleMap

Alternative Syntax

Syntax:
openMap [show, forced]
Parameters:
show: Boolean - if true opens map, if false closes map, provided it is not forced.
forced: Boolean - if true keeps map from closing when map is open. Arma 3 v2.06.147984, if false, forces map to stay closed if 'show' is false (see description)
Return Value:
Boolean - equivalent of visibleMap

Examples

Example 1:
openMap true;
Example 2:
openMap [true, true];

Additional Information

See also:
forceMap forcedMap visibleMap showMap shownMap

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
Fraali - c
Posted on Dec 08, 2021 - 11:00 (UTC)
(As of Arma 3 ver.2.06.148470)
Trying to close a map using 'closeMap false' inside of a map event handler like
'addMissionEventHandler["Map",{closeMap false}];'
will cause the game to crash.
To fix this, please use it inside of a spawned script.
Ex. 'addMissionEventHandler["Map",{[] spawn {closeMap false};}];'

This should stop any issue of crashing when you close the map.