Jump to content
Sign in to follow this  
undercoverbrother

Problem with spawning script (ArmA 2 OA)

Recommended Posts

G'day everyone,

I've spent quite a while trying to write script to spawn 5 units. So far this what I've got:

_pos = getMarkerPos "MarkerOne"
_s1 = "Graves"
_s2 = "US_Delta_Force_SD_EP1";
_s3 = "US_Delta_Force_Medic_EP1";
_s4 = "US_Delta_Force_Night_EP1";
_plane = "C130J_US_EP1";

for [{_counter = 0}, {_counter < 5}, {_counter = _counter + 1}] do {
_units = [_s1,_s2,_s3,_s4,_plane] select _counter;
_spawngroup = [_pos, West, _units, [],[],[0.5,0.8],[]] call BIS_fnc_spawnGroup;
};

On my map I have a marker named "MarkerOne" and a functions module. I know there are a lot of threads on this already but none of them seem to work for me; which is really strange as they work for the people who post them :confused:. Please help.

thanks,

Edited by undercoverbrother

Share this post


Link to post
Share on other sites

Notice the missing ; after the first two lines? :)

You can rewrite it like this:

_pos = getMarkerPos "MarkerOne";
_units = ["Graves","US_Delta_Force_SD_EP1","US_Delta_Force_Medic_EP1","US_Delta_Force_Night_EP1","C130J_US_EP1"];

_spawngroup = [_pos, West, _units, [],[],[0.5,0.8]] call BIS_fnc_spawnGroup;

However the plane starts on the ground, running all the units over and killing them before finally crashing into something itself...

Something like this might be more what you're intending to do:

// Defaults

_pos = getMarkerPos "MarkerOne";

_units = ["Graves","US_Delta_Force_SD_EP1","US_Delta_Force_Medic_EP1","US_Delta_Force_Night_EP1"];

_plane = "C130J_US_EP1";

// Spawn your plane and fly it at 800m up.

_spawnplaneArray = [_pos, 90, _plane, WEST] call bis_fnc_spawnvehicle;

_spawnplane = _spawnplaneArray select 0;

_spawnplane flyInHeight 800;

_spawnplane setPos [getPos _spawnplane select 0, getPos _spawnplane select 1, 800];

// Create your group...

_spawngroup = [[1,1,1], WEST, _units, [],[],[0.5,0.8]] call BIS_fnc_spawnGroup;

// and make them board the plane.

{_x moveInCargo _spawnplane} forEach units _spawngroup;

Just give _spawnplane some waypoints where you want it to drop _spawngroup off at.

Edited by kylania

Share this post


Link to post
Share on other sites

Thanks Kylania, but its still not working. Am I calling the script incorrectly or something? I placed the marker and the functions module, I just don't know why my script never works. Could it possibly be a problem with my version of ArmA 2 OA.

Share this post


Link to post
Share on other sites

Problem was that you were calling the script incorrectly. To call an SQF use this format:

_nil = [] execVM "spawn1.sqf";

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
Sign in to follow this  

×