{"name":"Arma 3: Virtual Reality Custom Courses","title":"Arma 3: Virtual Reality Custom Courses","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_Virtual_Reality_Custom_Courses","revid":351470,"updated":"2023-12-06T09:58:11Z","aliases":["Arma3: Virtual Reality Custom Courses"],"markdown":"Here is a basic guide on how to configure your own VR training courses. If there are some community Courses configured, a new selector will appear with a list of the Courses. This selector will have different colour than the official ones.\n\n#### Config\n\n```cpp\nclass CfgVRCourses\n{\n    class Default;\n    class MyCourse1 : Default\n    {\n        title = \"Course Name\";\n        icon = \"\\A3\\Structures_F_Bootcamp\\VR\\Helpers\\Data\\VR_Symbol_default_CA.paa\";\n        class Stages\n        {\n            class Stage1\n            {\n                title = \"Stage 1 Name\";\n                function = \"BIS_fnc_VRFunctionName1\";\n            };\n            class Stage2\n            {\n                title = \"Stage 2 Name\";\n                function = \"BIS_fnc_VRFunctionName2\";\n            };\n            class Stage3\n            {\n                title = \"Stage 3 Name\";\n                function = \"BIS_fnc_VRFunctionName3\";\n            };\n        };\n    };\n};\n```\n\n**icon:** Path to icon that will be shown on a billboard throughout the Course.\n\n**title:** Text that will be shown ingame during Course selection or when loading a Stage.\n\n**function:** Function to run for each Stage. Must be defined in cfgFunctions (see the Arma 3 functions library, VR functions are usually defined in category \"VR\").\n\n#### Functions\n\nStage functions are typically FSMs (you can get the FSM Editor here). There are certain **guidelines** to follow:\n\n- player's starting coordinates are always *markerPos \"BIS_center\"*\n  - you should use coordinates relative to this one for spawning your assets\n- there is a brief timeout before player gains control in a Stage - you can spawn all your assets during this period\n  - you can determinate the moment player gains control by checking variable *BIS_interruptable* for *TRUE*\n  - any mission tasks or hints should be created after this period, once player is actually ingame\n- there is a logic unit used for icon helper (group icon) - *BIS_icon* and its group, *BIS_iconGrp*\n  - do not delete these!\n    Example of use:\n\n    ```sqf\n    BIS_icon attachTo [BIS_UAV, [0, 0, -3.5]];\n    BIS_iconGrp setGroupIconParams [BIS_TT_colorWarning, \"\", 1, true];\n    ```\n- if player wanders too far away from his starting position, he is automatically moved back - default allowed radius is 100m\n  - this can be changed via variable *BIS_stageArea* in a Stage function.\n    Example of use:\n\n    ```sqf\n    BIS_stageArea = 150;\n    ```\n- any assets you spawn will be deleted automatically when the Stage ends\n- a Stage is completed by using this code:\n\n  ```sqf\n  call BIS_fnc_VR_stageDone;\n  ```\n- always make sure you've properly terminated your function upon Stage end; keep in mind player can fail a Stage too\n  - for Stage failure, use code before you terminate the function:\n\n    ```sqf\n    [] spawn BIS_fnc_VR_stageFailed;\n    ```\n  - condition to check player's \"death\" or him leaving the Stage:\n\n    ```sqf\n    damage player > 0.015 || !BIS_interruptable\n    ```\n  - you don't need to call any code in this case, just make sure to properly terminate the function\n\n#### Stage function example\n\nTo help you understand how a typical Stage FSM may look like, here's a link to a basic Stage function (it's a slightly tweaked Stage 2 of the Launchers Course):\n\n- https://www.dropbox.com/s/5429wbhsl4f0sky/fn_VRCourseExample.fsm\n\nThe End!\n\n> « I hope I covered everything here. Have fun creating your own VR Courses! » – Jezuro","sections":[{"heading":null,"level":1,"markdown":"Here is a basic guide on how to configure your own VR training courses. If there are some community Courses configured, a new selector will appear with a list of the Courses. This selector will have different colour than the official ones."},{"heading":"Config","level":4,"markdown":"```cpp\nclass CfgVRCourses\n{\n    class Default;\n    class MyCourse1 : Default\n    {\n        title = \"Course Name\";\n        icon = \"\\A3\\Structures_F_Bootcamp\\VR\\Helpers\\Data\\VR_Symbol_default_CA.paa\";\n        class Stages\n        {\n            class Stage1\n            {\n                title = \"Stage 1 Name\";\n                function = \"BIS_fnc_VRFunctionName1\";\n            };\n            class Stage2\n            {\n                title = \"Stage 2 Name\";\n                function = \"BIS_fnc_VRFunctionName2\";\n            };\n            class Stage3\n            {\n                title = \"Stage 3 Name\";\n                function = \"BIS_fnc_VRFunctionName3\";\n            };\n        };\n    };\n};\n```\n\n**icon:** Path to icon that will be shown on a billboard throughout the Course.\n\n**title:** Text that will be shown ingame during Course selection or when loading a Stage.\n\n**function:** Function to run for each Stage. Must be defined in cfgFunctions (see the Arma 3 functions library, VR functions are usually defined in category \"VR\")."},{"heading":"Functions","level":4,"markdown":"Stage functions are typically FSMs (you can get the FSM Editor here). There are certain **guidelines** to follow:\n\n- player's starting coordinates are always *markerPos \"BIS_center\"*\n  - you should use coordinates relative to this one for spawning your assets\n- there is a brief timeout before player gains control in a Stage - you can spawn all your assets during this period\n  - you can determinate the moment player gains control by checking variable *BIS_interruptable* for *TRUE*\n  - any mission tasks or hints should be created after this period, once player is actually ingame\n- there is a logic unit used for icon helper (group icon) - *BIS_icon* and its group, *BIS_iconGrp*\n  - do not delete these!\n    Example of use:\n\n    ```sqf\n    BIS_icon attachTo [BIS_UAV, [0, 0, -3.5]];\n    BIS_iconGrp setGroupIconParams [BIS_TT_colorWarning, \"\", 1, true];\n    ```\n- if player wanders too far away from his starting position, he is automatically moved back - default allowed radius is 100m\n  - this can be changed via variable *BIS_stageArea* in a Stage function.\n    Example of use:\n\n    ```sqf\n    BIS_stageArea = 150;\n    ```\n- any assets you spawn will be deleted automatically when the Stage ends\n- a Stage is completed by using this code:\n\n  ```sqf\n  call BIS_fnc_VR_stageDone;\n  ```\n- always make sure you've properly terminated your function upon Stage end; keep in mind player can fail a Stage too\n  - for Stage failure, use code before you terminate the function:\n\n    ```sqf\n    [] spawn BIS_fnc_VR_stageFailed;\n    ```\n  - condition to check player's \"death\" or him leaving the Stage:\n\n    ```sqf\n    damage player > 0.015 || !BIS_interruptable\n    ```\n  - you don't need to call any code in this case, just make sure to properly terminate the function"},{"heading":"Stage function example","level":4,"markdown":"To help you understand how a typical Stage FSM may look like, here's a link to a basic Stage function (it's a slightly tweaked Stage 2 of the Launchers Course):\n\n- https://www.dropbox.com/s/5429wbhsl4f0sky/fn_VRCourseExample.fsm\n\nThe End!\n\n> « I hope I covered everything here. Have fun creating your own VR Courses! » – Jezuro"}],"categories":["Arma 3: Editing"],"groups":["General"]}