{"name":"openMap","operator":null,"title":"openMap","type":"command","url":"https://community.bistudio.com/wiki/openMap","revid":349654,"updated":"2023-11-18T17:02:30Z","groups":["Map","Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.03"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.03"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Opens or closes in-game map.\n\n> [!WARNING]\n> 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.\n> Make sure you provide scripted mechanics to resolve this, should you need to force the map.\n> 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.","syntaxes":[{"syntax":"openMap show","since":null,"effect":null,"exec":null,"params":[{"name":"show","type":"Boolean","optional":false,"default":null,"description":"if true opens map, if false closes map, provided it is not *forced*","types":["Boolean"],"since":null,"text":"show: Boolean - if true opens map, if false closes map, provided it is not *forced*"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"equivalent of visibleMap","text":"Boolean - equivalent of visibleMap"},"form":"unary","operator":null,"left":null,"right":{"text":"show","types":["Boolean"]}},{"syntax":"openMap [show, forced]","since":null,"effect":null,"exec":null,"params":[{"name":"show","type":"Boolean","optional":false,"default":null,"description":"if true opens map, if false closes map, provided it is not *forced*.","types":["Boolean"],"since":null,"text":"show: Boolean - if true opens map, if false closes map, provided it is not *forced*."},{"name":"forced","type":"Boolean","optional":false,"default":null,"description":"if true keeps map from closing when map is open. Arma 3 v2.06 if false, forces map to stay closed if *show* is false (see #Example 1)","types":["Boolean"],"since":null,"text":"forced: Boolean - if true keeps map from closing when map is open. Arma 3 v2.06 if false, forces map to stay closed if *show* is false (see #Example 1)"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"equivalent of visibleMap","text":"Boolean - equivalent of visibleMap"},"form":"unary","operator":null,"left":null,"right":{"text":"[show, forced]","types":["Array"]}}],"examples":[{"text":"```sqf\nopenMap [true, false];    // opens map normally\nopenMap [false, false];    // closes an opened map normally\nopenMap [true, true];    // force opens map and keeps it open (the user cannot close it on their own)\nopenMap [false, true];    // since Arma 3 2.06: prevents map from opening, closes open map and forces it to stay close (the user cannot open it on their own)\n```","code":["openMap [true, false];\t// opens map normally\nopenMap [false, false];\t// closes an opened map normally\nopenMap [true, true];\t// force opens map and keeps it open (the user cannot close it on their own)\nopenMap [false, true];\t// since Arma 3 2.06: prevents map from opening, closes open map and forces it to stay close (the user cannot open it on their own)"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["forceMap","forcedMap","visibleMap","showMap","shownMap"],"notes":[{"user":"Fraali","date":"2021-12-08T11:00:58Z","text":"(**As of Arma 3 ver.2.06.148470**)\n\nTrying to close a map using `openMap false` inside of a map event handler like\n\n```sqf\naddMissionEventHandler [\"Map\", { openMap false }];\n```\n\nwill cause the game to crash.\n\nTo fix this, please use it inside of a spawned script.\n\n```sqf\naddMissionEventHandler [\"Map\", { 0 spawn { openMap false }; }];\n```\n\nThis should stop any issue of crashing when you close the map."}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Command Group: Map","Introduced with Arma 2 version 1.03","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}