Jump to content

Recommended Posts

Hi. Having issues with the ModuleCAS_F - see the script below first:

 

  1. _pos = position player; //debug player position for test purposes
  2. player sidechat format ["Air support required at coordinates %1", _pos];
  3. _marker = createMarker ["target", _pos];
  4. _marker setMarkerType "mil_circle";
  5. _marker setMarkerColor "colorORANGE";
  6. "target" setMarkerText format ["%1", _pos];
  7. _center = createCenter sideLogic;
  8. _group = createGroup _center;
  9. _tar = _group createUnit ["ModuleCAS_F", _pos, [], 0, ""];
  10. _tar setDir 000;
  11. _tar setVariable ["vehicle","B_Plane_Fighter_01_Cluster_F"];
  12. _tar setVariable ["type", 3];
  13. 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
_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

@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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×