{"name":"BIS_fnc_missionSelector","operator":null,"title":"BIS fnc missionSelector","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_missionSelector","revid":349497,"updated":"2023-11-08T17:09:09Z","groups":["Systems"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.78"}],"since":{"game":"arma3","name":"Arma 3","version":"1.78"},"arma3_since":"1.78","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Function that draws clickable, hoverable and animated icons on the map that execute a user-defined code when pressed.","syntaxes":[{"syntax":"[area, mapCenter, missionsArray] call BIS_fnc_missionSelector","since":null,"effect":null,"exec":null,"params":[{"name":"area","type":"Array of Number","optional":true,"default":"[100,100]","description":"used to determine map's zoom, format [width, height]","types":["Array","Number"],"since":null,"text":"area: Array of Number - (Optional, default [100,100]) used to determine map's zoom, format [width, height]"},{"name":"mapCenter","type":"Position2D","optional":true,"default":"[0,0]","description":"center position where the map camera will be positioned","types":["Position2D"],"since":null,"text":"mapCenter: Position2D - (Optional, default [0,0]) center position where the map camera will be positioned"},{"name":"missionsArray","type":"Array","optional":true,"default":"`[]`","description":"list of selectable missions and their parameters, to format [pos, text, tooltip, picture, code]:\n- pos: Array - where the clickable marker will be placed\n- text: String - text that should be displayed next to the icon\n- tooltip: String - text to be displayed in the tooltip (on mouse over)\n- picture: String - location of the picture to be displayed in the tooltip\n- code: Code - code spawned when the icon is clicked","types":["Array"],"since":null,"text":"missionsArray: Array - (Optional, default `[]`) list of selectable missions and their parameters, to format [pos, text, tooltip, picture, code]:\n- pos: Array - where the clickable marker will be placed\n- text: String - text that should be displayed next to the icon\n- tooltip: String - text to be displayed in the tooltip (on mouse over)\n- picture: String - location of the picture to be displayed in the tooltip\n- code: Code - code spawned when the icon is clicked"}],"returns":{"type":"Number","types":["Number"],"description":"index of the chosen mission","text":"Number - index of the chosen mission"}}],"examples":[{"text":"```sqf\nprivate _area = [750, 400];\nprivate _missionsList =\n[\n    [\n        getMarkerPos \"BIS_briefMarkerINFANTRY\",\n        \"Infantry\",\n        \"Your mission is to do stuff\",\n        \"AnimBriefing\\intro_stage1a_CA.paa\",\n        { hint \"infantry mission selected\" }\n    ],\n    [\n        getMarkerPos \"BIS_briefMarkerSPECIALFORCES\",\n        \"Special Forces\",\n        \"Your mission is to do stuff but in a more special way\",\n        \"AnimBriefing\\intro_stage1a_CA.paa\",\n        { hint \"special forces mission selected\" }\n    ]\n];\n\nprivate _index = [_area, getMarkerPos \"BIS_cameraCenter\", _missionsList] call BIS_fnc_missionSelector;\nprivate _missionDetails = _missionsList select _index;\n```","code":["private _area = [750, 400];\nprivate _missionsList =\n[\n\t[\n\t\tgetMarkerPos \"BIS_briefMarkerINFANTRY\",\n\t\t\"Infantry\",\n\t\t\"Your mission is to do stuff\",\n\t\t\"AnimBriefing\\intro_stage1a_CA.paa\",\n\t\t{ hint \"infantry mission selected\" }\n\t],\n\t[\n\t\tgetMarkerPos \"BIS_briefMarkerSPECIALFORCES\",\n\t\t\"Special Forces\",\n\t\t\"Your mission is to do stuff but in a more special way\",\n\t\t\"AnimBriefing\\intro_stage1a_CA.paa\",\n\t\t{ hint \"special forces mission selected\" }\n\t]\n];\n\nprivate _index = [_area, getMarkerPos \"BIS_cameraCenter\", _missionsList] call BIS_fnc_missionSelector;\nprivate _missionDetails = _missionsList select _index;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["playMission"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Systems","Functions","Functions: Local Effect","Introduced with Arma 3 version 1.78"],"docblock":null,"filled_from_docblock":[]}