alleycat 28 Posted February 28, 2016 Trying to use description.ext parameters to control wether an object appears in the mission. So far I got this: description.ext: (params) class Defender { title = "Defending side"; values[] = {0,1,2}; texts[] = {"CSAT","AAF","NATO"}; default = 0; }; Then I tried in the presence condition: (paramsArray select 2 == 0) Did not work. Then I thought perhaps things intitialized in the editor might have issues with params so I wrote in the initserver.sqf def_csat = false; def_aaf = false; def_nato = false; if (paramsArray select 2 == 0) then { def_csat = true; }; Then in the presence condition: def_csat Did not work. What am I doing wrong? Share this post Link to post Share on other sites
alleycat 28 Posted February 28, 2016 Also tried hideobjectglobal, but that completely does not work at all: strat_csat_a hideObjectGlobal true; it can not find the object, but it is there. Share this post Link to post Share on other sites
NeoArmageddon 958 Posted February 28, 2016 Parameter initialisation only works in a real MP lobby. I wrote a script a while back that checks for MP or SP game and loads the defaults from the description.ext //Load default params for SP && Editor if (isNil "paramsArray") then { private ["_c", "_i", "_paramName"]; paramsArray=[]; if (isClass (missionConfigFile/"Params")) then { _c=count (missionConfigFile/"Params"); for [ {_i=0}, {_i<_c}, {_i=_i+1} ] do { _paramName = (configName ((missionConfigFile >> "Params") select _i)); paramsArray=paramsArray+[ getNumber (missionConfigFile >> "Params" >> _paramName >> "default") ]; }; }; }; AT_fnc_ParamsToVar = { //Compile params into real variables: private["_c","_paramName"]; _c=count (missionConfigFile/"Params"); for [ {_i=0}, {_i<_c}, {_i=_i+1} ] do { _paramName = (configName ((missionConfigFile >> "Params") select _i)); call compile format["%1 = %2;publicVariable '%1';",_paramName,paramsArray select _i]; }; }; //Compile Params into Variables call AT_fnc_ParamsToVar; The script also stores the parameter in their own variables. For example your param will be accessible as "Defender". (The script is quite old, thus the usage of some outdated commands... too lazy to change that right now). Pick from the script, what you need. The next problem is probably the initialization order. When used in a script, the parameters are parsed after the object is created, so the presence conditon is not the way to got. I had some problems with hideobjectglobal. Better try [_object,true] remoteexec ["hideObject",0,true] Share this post Link to post Share on other sites
alleycat 28 Posted February 28, 2016 Thanks for the tip, it appears to work in MP. About your script, how does one call and use it? Share this post Link to post Share on other sites
NeoArmageddon 958 Posted February 28, 2016 As function file or in init.sqf. Share this post Link to post Share on other sites