{"name":"userconfig","title":"userconfig","type":"topic","url":"https://community.bistudio.com/wiki/userconfig","revid":329122,"updated":"2022-07-22T15:45:59Z","aliases":[],"markdown":"## How to make a Userconfig:\n\nSome quick notes from what I learned while trying to use it for a mission.\n(a.k.a. What I wish somebody had written already) *--MaHuJa*\n\nThe **\\userconfig** folder should be located in the root Arma 3 game directory, typically in your main Steam folder, \\Steam\\steamapps\\common\\Arma 3\\\n\n**Description.ext**\n\n```cpp\nclass X\n{\n    #include \"\\userconfig\\MY_addon\\Somefile.hpp\"\n};\n```\n\n**\\userconfig\\MY_addon\\Somefile.hpp**\n\n```cpp\nclass Y\n{\n    key = value;\n};\n```\n\n**Use:**\n\n```sqf\n_userConfigValue = getNumber (missionConfigFile >> \"X\" >> \"Y\" >> \"key\");\n```\n\nSkipping class X means the user could introduce anything into the description.ext\nNote that #include WILL fail with a CTD if the somefile.hpp doesn't exist.\n\nmissionConfigFile is used when the mission does the include from description.ext\ncampaignConfigFile is similar but for a campaign\nconfigFile is about the \"global config\" of unit types, vehicle types, and so on - this is the area added to by addons.","sections":[{"heading":"How to make a Userconfig:","level":2,"markdown":"Some quick notes from what I learned while trying to use it for a mission.\n(a.k.a. What I wish somebody had written already) *--MaHuJa*\n\nThe **\\userconfig** folder should be located in the root Arma 3 game directory, typically in your main Steam folder, \\Steam\\steamapps\\common\\Arma 3\\\n\n**Description.ext**\n\n```cpp\nclass X\n{\n    #include \"\\userconfig\\MY_addon\\Somefile.hpp\"\n};\n```\n\n**\\userconfig\\MY_addon\\Somefile.hpp**\n\n```cpp\nclass Y\n{\n    key = value;\n};\n```\n\n**Use:**\n\n```sqf\n_userConfigValue = getNumber (missionConfigFile >> \"X\" >> \"Y\" >> \"key\");\n```\n\nSkipping class X means the user could introduce anything into the description.ext\nNote that #include WILL fail with a CTD if the somefile.hpp doesn't exist.\n\nmissionConfigFile is used when the mission does the include from description.ext\ncampaignConfigFile is similar but for a campaign\nconfigFile is about the \"global config\" of unit types, vehicle types, and so on - this is the area added to by addons."}],"categories":["Arma 2: Editing","Arma 3: Editing"],"groups":["Configuration"]}