Ramsen III 0 Posted October 13, 2019 Hi. Having issues with the ModuleCAS_F - see the script below first: _pos = position player; //debug player position for test purposes player sidechat format ["Air support required at coordinates %1", _pos]; _marker = createMarker ["target", _pos]; _marker setMarkerType "mil_circle"; _marker setMarkerColor "colorORANGE"; "target" setMarkerText format ["%1", _pos]; _center = createCenter sideLogic; _group = createGroup _center; _tar = _group createUnit ["ModuleCAS_F", _pos, [], 0, ""]; _tar setDir 000; _tar setVariable ["vehicle","B_Plane_Fighter_01_Cluster_F"]; _tar setVariable ["type", 3]; systemchat "script complete" // debug This script works perfectly when placed in the init.sqf directly, the markers show, the text displays and the F/A 181 turns up and drops a cluster bomb (or what ever i define in "type" variable) .... all good. HOWEVER....if i place this EXACT script in my 'support.sqf' or 'justworkffs.sqf' or whatever and then execute it from say an 'add action' or even directly from the init.sqf itself the AIRCRAFT DOES NOT TURN UP!! The script completes though and the markers and text display? Have tested this well over 15 times. The aircraft shows when executed in init.sqf but nowehere else? Baffled by this. Please help cheers. Share this post Link to post Share on other sites
Larrow 2823 Posted October 13, 2019 _pos = position player; player sideChat format[ "Air support required at coordinates %1", _pos ]; _marker = createMarker[ "target", _pos ]; _marker setMarkerType "mil_circle"; _marker setMarkerColor "colorORANGE"; "target" setMarkerText format[ "%1", _pos ]; _group = createGroup sideLogic; "ModuleCAS_F" createUnit[ _pos, _group, " this setDir 0; this setVariable[ 'vehicle','B_Plane_Fighter_01_Cluster_F' ]; this setVariable[ 'type', 3 ]; this setVariable[ 'BIS_fnc_initModules_disableAutoActivation', false ]; "]; systemChat "script complete"; Share this post Link to post Share on other sites
Ramsen III 0 Posted October 13, 2019 @Larrow Thx bro. Worked perfectly with external sqf now. But why did my previous script not work properly outside the init.sqf? Also, i kinda know what setVariable is but never used it, but why was it needed/used in this case? anyway thx again. cheers. p.s ignore previous question i looked up 'BIS_fnc_initModules_disableAutoActivation' i understand it now. cheers. Share this post Link to post Share on other sites