Page 1 of 5 12345 LastLast
Results 1 to 10 of 41

Thread: HELP: Spawn Vehicles /Planes

  1. #1

    Exclamation HELP: Spawn Vehicles /Planes

    Hi everyone,

    I am searching for a script to spawn vehicles/planes and halos (both west and east)

    After they are destoyed they spawn 3 times at base and move to certain point (marker)

    I know there is a spawn function but not sure how to use it to achive above.

    Any noobs guide showing how would be highly appreciated.

  2. #2

  3. #3
    Master Sergeant CaptainBravo's Avatar
    Join Date
    Nov 24 2005
    Location
    USA-UK
    Posts
    730
    Author of the Thread
    Thanks CryHavok. I have used that script to spawn infantry and it works great! However, it does not work for vehicles/planes ...

    Any other ideas?

    Thanks.

  4. #4
    Master Sergeant CaptainBravo's Avatar
    Join Date
    Nov 24 2005
    Location
    USA-UK
    Posts
    730
    Author of the Thread
    Anyone?

  5. #5
    Master Gunnery Sergeant norrin's Avatar
    Join Date
    Aug 30 2006
    Location
    Melbourne, Australia
    Posts
    1,129
    The fourth script down on this page creates respawning AI vehicles, which then use Kronzky's urban patrol script to patrol an area:

    http://www.ofpec.com/forum/index.php?topic=33732.0

    If you want a slightly simpler script so that the respawned vehicles just move to some waypoints, ie. not use Kronzky's UPS, let me know and I'll adapt the script for you.

    **[XDF]*****************************[AAW]**

  6. #6
    Master Gunnery Sergeant Wiggum's Avatar
    Join Date
    Jun 17 2009
    Location
    Germany
    Posts
    1,325

    Thumbs up

    That would be great norrin !

    But i have a problem:

    I want to spawn a unit during the mission with a trigger. and then they should move to waypoints.
    Last edited by Wiggum; Jul 14 2009 at 11:34.

  7. #7
    Master Gunnery Sergeant norrin's Avatar
    Join Date
    Aug 30 2006
    Location
    Melbourne, Australia
    Posts
    1,129
    AI vehicle respawn that moves to waypoint script

    ┬ę JULY 2009 - norrin

    Download
    http://norrin.org/downloads/ArmA2/AI...wn_WP.utes.rar

    To implement

    1. Copy AIvcl_respawn_WP folder to your mission directory
    2. Create a manned AI vehicle that will respawn in the editor
    3. in the init line of the vehicle put:

    nul = [this, 3, 10, "WS1","WP_scripts\WP1.sqf"] execVM "AIvcl_respawn_WP\AIvcl_respawn_WP_init.sqf";

    where:

    3 - is the number of times you want the AI unit to respawn;
    10 - is the delay in seconds after the unit dies that you want it to respawn in
    "WS1" - is the marker postion where you want the AI units to respawn
    "WP_scripts\WP1.sqf" - is the name of path and the script that will add the waypoints.

    In the test mission I have put the waypoint script in the directory called WP_scripts and the script that adds the waypoints is called "WP1.sqf". It commands the units to move to WPs created at markers. In the test mission the WP markers for AI units are called:"WP1" and "WP2" and the code looks like this:
    Code:
    _unit = _this select 0;
    _group = group _unit;
    
    _waypoint0 = _group addwaypoint[getmarkerpos"WP1",0];
    _waypoint0 setwaypointtype"Move"; 
    
    _waypoint1 = _group addwaypoint[getmarkerpos"WP2",0];
    _waypoint1 setwaypointtype"Move";
    Adapt this script to your own purposes. For instance you can add additional WP markers or you could have several of these scripts in the mission so different units moveTo different positions.

    Note
    * Each respawning AI vehicle needs to have the above code put in its init line.
    * The respawning AI vehicles are created as the same type and their skill is set to the same level as set in the editor

    Also in the test mission the player is setCaptive true so the enemy units will not shoot him.

    @Wiggum - what you are asking is different to this, what you need to do is when the trigger is activated run a script, which
    1. Creates an empty vehicle
    2. Creates some crew for the vehicle
    3. Moves the crew into the vehicle using the moveInDriver, moveINGunner etc
    4. adds the waypoints for the group

    EDIT
    Wiggum, here's a test mission where I've spawned a vehicle after a trigger is activated, which you can use as a guide:
    http://norrin.org/downloads/ArmA2/AI...igger.utes.rar

    Just run straight forward when the mission starts and a HMMWV will spawn and move off to two WPs. Open the mission up in the editor to see how its done! If you run into probs let me know and I'll post some explanatory notes.
    Last edited by norrin; Jul 14 2009 at 12:05.

  8. #8
    Master Sergeant CaptainBravo's Avatar
    Join Date
    Nov 24 2005
    Location
    USA-UK
    Posts
    730
    Author of the Thread
    Thanks norrin! I appreciate it. I use your other scripts and they are great (specially UPS)! All I needed was vehicle spawn and I will try yours when I get home.

    Would it also work for planes/halos? if yes, can they spawn flying mid air?

    Thanks for the great scripts!

  9. #9
    Master Gunnery Sergeant norrin's Avatar
    Join Date
    Aug 30 2006
    Location
    Melbourne, Australia
    Posts
    1,129
    The UPS and WP vehicle respawn scripts work for both planes and helos and there's examples of both in the test missions. At the moment I just spawn them on the ground but they will fly to waypoints, for planes and the UPS script just make sure that the patrol marker is nice and big.

    PS: Kronzky wrote the amazing UPS, I'm just responsible for the AI respawn part.
    Last edited by norrin; Jul 14 2009 at 12:17.

  10. #10
    Master Gunnery Sergeant Wiggum's Avatar
    Join Date
    Jun 17 2009
    Location
    Germany
    Posts
    1,325

    Thumbs up

    Thanks norrin !

    But if have a littel problem again:

    I changed some stuff in your script to get a Insurgent BMP2 that moves.

    // spawn_vcl.sqf
    // JULY 2009 - norrin

    if (!isServer) exitWith {};

    _type = _this select 0;
    _marker_pos = _this select 1;

    // Create Vehicle
    _vcl_new = _type createVehicle (getMarkerPos _marker_pos);

    // Create Crew
    _group = createGroup EAST;
    "Ins_Soldier_Crew" createUnit [(getMarkerPos _marker_pos), _group];
    "Ins_Soldier_Crew" createUnit [(getMarkerPos _marker_pos), _group];
    "Ins_Soldier_Crew" createUnit [(getMarkerPos _marker_pos), _group];

    _unitsGroup = units _group;

    // Move crew in Vehicle
    for [{ _loop = 0 },{ _loop < count _unitsGroup},{ _loop = _loop + 1}] do
    {
    _guy = _unitsGroup select _loop;
    _guy setSkill (_AI_skillArray select _loop);
    if (_loop == 0) then {_guy moveInDriver _vcl_new};
    if (_loop == 1) then {_guy moveInGunner _vcl_new};
    if (_loop == 2) then {_guy moveInCommander _vcl_new};

    sleep 0.1;
    };
    sleep 1;

    // Add waypoints
    _waypoint0 = _group addwaypoint[getmarkerpos"WP1",0];
    _waypoint0 setwaypointtype"Move";

    _waypoint1 = _group addwaypoint[getmarkerpos"WP2",0];
    _waypoint1 setwaypointtype"Move";
    But there are no Crew inside.
    If i change EAST to WEST it works but the tanks dont attack me.
    Last edited by Wiggum; Jul 14 2009 at 13:46.

Page 1 of 5 12345 LastLast

Posting Permissions

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