{"name":"getMissionConfigValue","operator":null,"title":"getMissionConfigValue","type":"command","url":"https://community.bistudio.com/wiki/getMissionConfigValue","revid":352827,"updated":"2024-02-22T21:48:04Z","groups":["Config","Mission Information"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.56"}],"since":{"game":"arma3","name":"Arma 3","version":"1.56"},"arma3_since":"1.56","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns value of the given scenario attribute from the 1st tier. Since only config properties have values, the attribute should be config property.\nIf it is not found or config class is given, the return is nil. If the attribute defined in multiple places, the command checks them in the following order:\n1. Description.ext entry\n1. Eden Editor scenario attribute\n\nSo if an attribute exists in both places, the Description.ext value is used.\nPreviously, scenario attributes were extracted from Description.ext using missionConfigFile.\nThat still works, but it ignores attributes set directly in the editor and should not be used anymore.\n\n> [!IMPORTANT]\n> This command cannot force return type, it will return the value of the type given in config. Use isEqualType to additionally reaffirm the correct type if necessary to account for human error.","syntaxes":[{"syntax":"getMissionConfigValue attribute","since":null,"effect":null,"exec":null,"params":[{"name":"attribute","type":"String","optional":false,"default":null,"description":"attribute name","types":["String"],"since":null,"text":"attribute: String - attribute name"}],"returns":{"type":null,"types":["Number","String","Boolean","Array","nil"],"description":null,"text":"Number, String, Boolean or Array, depending on the attribute value type. Nil when the attribute is undefined."},"form":"unary","operator":null,"left":null,"right":{"text":"attribute","types":["String"]}},{"syntax":"getMissionConfigValue [attribute, defaultValue]","since":null,"effect":null,"exec":null,"params":[{"name":"attribute","type":"String","optional":false,"default":null,"description":"attribute name","types":["String"],"since":null,"text":"attribute: String - attribute name"},{"name":"defaultValue","type":"Anything","optional":false,"default":null,"description":"value used when the attribute is undefined","types":["Anything"],"since":null,"text":"defaultValue: Anything - value used when the attribute is undefined"}],"returns":{"type":null,"types":["Number","String","Boolean","Array"],"description":null,"text":"Number, String, Boolean or Array, depending on the attribute value type. Default value when the attribute is undefined."},"form":"unary","operator":null,"left":null,"right":{"text":"[attribute, defaultValue]","types":["Array"]}}],"examples":[{"text":"```sqf\nprivate _respawnDelay = getMissionConfigValue [\"respawnDelay\", 0];            // returns the real, defined respawn delay value\nprivate _respawnDelay = getNumber (missionConfigFile >> \"respawnDelay\");    // old approach, ignoring the Eden Editor-set value\n```","code":["private _respawnDelay = getMissionConfigValue [\"respawnDelay\", 0];\t\t\t// returns the real, defined respawn delay value\nprivate _respawnDelay = getNumber (missionConfigFile >> \"respawnDelay\");\t// old approach, ignoring the Eden Editor-set value"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getMissionConfig","missionConfigFile","BIS_fnc_getParamValue","Mission Parameters"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Config","Command Group: Mission Information","Introduced with Arma 3 version 1.56","Scripting Commands"]}