{"name":"getMissionPath","title":"getMissionPath","type":"command","url":"https://community.bistudio.com/wiki/getMissionPath","revid":339107,"updated":"2023-04-26T10:54:34Z","groups":["System","Mission Information"],"status":"ok","games":{"arma3":"1.96"},"since":"arma3 1.96","arma3_since":"1.96","description":"Returns mission root plus the filename in a form of filepath to be used with commands requiring absolute path such as playSound3D, drawIcon3D, createSimpleObject, etc.\nAny leading \"\\\" in the filename will be stripped as the mission root includes one already.","syntaxes":[{"syntax":"getMissionPath filename","params":[{"name":"filename","type":"String","type_expr":"String"}],"returns":{"type":"String","type_expr":"String","description":"absolute path"},"form":"unary","right":{"text":"filename"}}],"examples":[{"code":["// returns e.g \"C:\\Users\\Username\\Documents\\Arma 3\\missions\\MissionName.Altis\\icons\\myIcon.paa\"\nprivate _path = getMissionPath \"icons\\myIcon.paa\";\nprivate _path = getMissionPath \"\\icons\\myIcon.paa\"; // leading \\ is also fine"]},{"code":["// returns e.g \"C:\\Users\\Username\\Documents\\Arma 3\\missions\\MissionName.Altis\\\" with the trailing \\\nprivate _root = getMissionPath \"\";"]}],"see_also":["missionConfigFile","playSound3D","drawIcon3D","createSimpleObject","Description.ext","playSoundUI"],"notes":[{"user":"Lou Montana","date":"2023-04-18T20:54:40Z","text":"Before the introduction of getMissionPath, absolute mission directory could be obtained as follow in config:\n\n```cpp\n__EXEC(MISSION_DIRECTORY = __FILE__ select [0, count __FILE__ - 15])\n// ...\ntexture = __EVAL(MISSION_DIRECTORY + \"subDirectory\\texture.paa\");\n```"}]}