{"name":"getMissionPath","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.96"}],"since":{"game":"arma3","name":"Arma 3","version":"1.96"},"arma3_since":"1.96","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"filename","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"filename: String"}],"returns":{"type":"String","types":["String"],"description":"absolute path","text":"String - absolute path"},"form":"unary","operator":null,"left":null,"right":{"text":"filename","types":["String"]}}],"examples":[{"text":"```sqf\n// 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\n```","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"]},{"text":"```sqf\n// returns e.g \"C:\\Users\\Username\\Documents\\Arma 3\\missions\\MissionName.Altis\\\" with the trailing \\\nprivate _root = getMissionPath \"\";\n```","code":["// returns e.g \"C:\\Users\\Username\\Documents\\Arma 3\\missions\\MissionName.Altis\\\" with the trailing \\\nprivate _root = getMissionPath \"\";"]}],"multiplayer":null,"problems":null,"aliases":[],"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```"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Mission Information","Command Group: System","Introduced with Arma 3 version 1.96","Scripting Commands"]}