Results 1 to 4 of 4

Thread: Problem with spawning script (ArmA 2 OA)

  1. #1

    Problem with spawning script (ArmA 2 OA)

    G'day everyone,

    I've spent quite a while trying to write script to spawn 5 units. So far this what I've got:
    Code:
    _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 . Please help.

    thanks,
    Last edited by undercoverbrother; Dec 7 2010 at 05:48.
    Chuck Inglish, Mikey Rocks = COOL KIDS = good music (look them up)

  2. #2
    Notice the missing ; after the first two lines?

    You can rewrite it like this:

    Code:
    _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_M edic_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.
    Last edited by kylania; Dec 7 2010 at 06:12.

  3. #3
    Corporal undercoverbrother's Avatar
    Join Date
    Oct 3 2010
    Location
    I'm at grid 010Y7901
    Posts
    92
    Author of the Thread
    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.

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

    Code:
    _nil = [] execVM "spawn1.sqf";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •