I have a script that places units like so (small sample):
//keep private variables lower case
private["_gl","_trigger","_factory","_unit0","_unit1","_unit2","_unit3","_unit4","_unit5","_unit6","_unit7","_unit8","_unit9","_unit10","_unit11","_unit12","_unit13","_unit14","_unit15","_unit16","_unit17","_unit18","_unit19","_unit20","_unit21","_unit22","_unit23","_unit24","_unit25","_unit26","_unit27","_unit28","_unit29","_unit30","_unit31","_unit32","_unit33","_unitAT1","_unitAT2","_unitAT3","_specops"];
_gl=_this select 0;
sleep(.1);
// specops is the Group to be created. Your units will be part of this group.
_specops = createGroup east;
_factory = nearestBuilding _gl;
if (isNull _factory) then {
hintc "No building was found!!!";
} else {
_unit0 = _specops createUnit ["ACE_SoldierEAR_IRAQ_INS", getPos _factory, [] ,0 ,"seargent"];
[_unit0] join _specops;
_unit0 setDir 180;
_specops selectLeader _unit0;
_unit0 disableAI "MOVE";
_unit0 disableAI "TARGET";
_unit0 setUnitPos "down";
_unit0 allowfleeing 0;
_unit0 setBehaviour "AWARE";
_unit0 setPos [2436.4,2376.3,0]
};
This works fine. It gives me the ability to place the unit in a BuildingPos or setPos them where I want. I Call the script from a radio trigger "Radio Charlie", with this:
puhandle=[this] execVM "PlaceUnits.sqf";
After the units are created, I want to reposition them into they'er fighting positions. E.G. Machinegunners roll out right to their position in the street, AT guys go to kneeling position, ect...
This is the script I am writing for that:
_unit0 playMove "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr";
_unit20 playMove "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr";
_unitAT1 setUnitPos "MIDDLE";
_unitAT2 setUnitPos "MIDDLE";
_unitAT3 setUnitPos "MIDDLE";
I trying to call this from a radio trigger "Radio Delta." I've tried everything I can think of.
[]execVM "MyScript.sqf";
[this]execVM "MyScript.sqf";
mshandle=[]execVM "MyScript.sqf";
mshandle=[this]execVM "MyScript.sqf";
and even
[]exec "MyScript.sqs";
None of these produce any result. I know it has to do with carrying a variable or some such nonsense. Pulling hair out. Please help.