BIS fnc missionSelector: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.78|Game version=
|1.78


|gr1 = Systems |GROUP1=
|gr1 = Systems


<!---|arg= local |Multiplayer Arguments=--->
<!---|arg= local |Multiplayer Arguments=--->
Line 11: Line 11:
|eff= local |Multiplayer Effects=
|eff= local |Multiplayer Effects=


| Function that draws clickable, hoverable and animated icons on the map that execute a user-defined code when pressed. |Description=
| Function that draws clickable, hoverable and animated icons on the map that execute a user-defined code when pressed.


| [area, mapCenter, missionsArray] call [[BIS_fnc_missionSelector]] |Syntax=
| [area, mapCenter, missionsArray] call [[BIS_fnc_missionSelector]]


|p1= area: [[Array]] of [[Number]] - (Optional, default [100,100]) used to determine map's zoom, format [width, height] |Parameter 1=
|p1= area: [[Array]] of [[Number]] - (Optional, default [100,100]) used to determine map's zoom, format [width, height]


|p2= mapCenter: [[Position2D]] - (Optional, default [0,0]) center position where the map camera will be positioned |Parameter 2=
|p2= mapCenter: [[Position2D]] - (Optional, default [0,0]) center position where the map camera will be positioned


|p3= missionsArray: [[Array]] - (Optional, default []) list of selectable missions and their parameters, to format [pos, text, tooltip, picture, code]:
|p3= missionsArray: [[Array]] - (Optional, default []) list of selectable missions and their parameters, to format [pos, text, tooltip, picture, code]:
Line 25: Line 25:
* picture: [[String]] - location of the picture to be displayed in the tooltip
* picture: [[String]] - location of the picture to be displayed in the tooltip
* code: [[Code]] - code spawned when the icon is clicked
* code: [[Code]] - code spawned when the icon is clicked
|Parameter 3=


| [[Number]] - index of the chosen mission |Return value=
 
| [[Number]] - index of the chosen mission


|x1= <code>[[private]] _area = [750, 400];
|x1= <code>[[private]] _area = [750, 400];
Line 49: Line 49:


[[private]] _index = [_area, [[getMarkerPos]] "BIS_cameraCenter", _missionsList] [[call]] [[BIS_fnc_missionSelector]];
[[private]] _index = [_area, [[getMarkerPos]] "BIS_cameraCenter", _missionsList] [[call]] [[BIS_fnc_missionSelector]];
[[private]] _missionDetails = _missionsList [[select]] _index;</code> |Example 1=
[[private]] _missionDetails = _missionsList [[select]] _index;</code>


|exec= call |Execution=
|exec= call |Execution=


| [[playMission]] |See also=
| [[playMission]]
}}
}}



Revision as of 23:12, 17 January 2021

Hover & click on the images for description

Description

Description:
Function that draws clickable, hoverable and animated icons on the map that execute a user-defined code when pressed.
Execution:
call
Groups:
Systems

Syntax

Syntax:
[area, mapCenter, missionsArray] call BIS_fnc_missionSelector
Parameters:
area: Array of Number - (Optional, default [100,100]) used to determine map's zoom, format [width, height]
mapCenter: Position2D - (Optional, default [0,0]) center position where the map camera will be positioned
missionsArray: Array - (Optional, default []) list of selectable missions and their parameters, to format [pos, text, tooltip, picture, code]:
  • pos: Array - where the clickable marker will be placed
  • text: String - text that should be displayed next to the icon
  • tooltip: String - text to be displayed in the tooltip (on mouse over)
  • picture: String - location of the picture to be displayed in the tooltip
  • code: Code - code spawned when the icon is clicked
Return Value:
Number - index of the chosen mission

Examples

Example 1:
private _area = [750, 400]; private _missionsList = [ [ getMarkerPos "BIS_briefMarkerINFANTRY", "Infantry", "Your mission is to do stuff", "AnimBriefing\intro_stage1a_CA.paa", { hint "infantry mission selected" } ], [ getMarkerPos "BIS_briefMarkerSPECIALFORCES", "Special Forces", "Your mission is to do stuff but in a more special way", "AnimBriefing\intro_stage1a_CA.paa", { hint "special forces mission selected" } ] ]; private _index = [_area, getMarkerPos "BIS_cameraCenter", _missionsList] call BIS_fnc_missionSelector; private _missionDetails = _missionsList select _index;

Additional Information

See also:
playMission

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


Notes


Bottom Section