Page 1 of 19 1234511 ... LastLast
Results 1 to 10 of 188

Thread: Simple Vehicle Respawn Script [Arma3]

  1. #1
    Master Gunnery Sergeant Tophe's Avatar
    Join Date
    Jun 4 2004
    Location
    Örebro/Sweden
    Posts
    1,034

    Post Simple Vehicle Respawn Script [Arma3]

    Simple Vehicle Respawn Script v1.8 [Arma 3]
    by Tophe of Östgöta Ops [OOPS]



    >> DOWNLOAD TAKEN DOWN WHILE FIXING SCRIPT <<


    This script will respawn a vehicle when it is destroyed or left empty in the battlefield.
    It will be respawned to the position where it first stood when the mission started.
    Works with any vehicle.

    Just put this in the vehicles init line:
    veh = [this] execVM "vehicle.sqf"

    Default settings are:
    30 seconds respawn delay after destruction
    120 seconds respawn delay after deserting a vehicle (leaving it empty after driving it).
    Unlimited respawns
    No special effect when respawning
    Static respawn.



    OPTIONS:
    There are some optional settings. The format for these are:
    veh = [this, Delay, Deserted timer, Respawns, Effect, Static, "INIT"] execVM "vehicle.sqf"
    If you don't use any additional settings the default settings will be used, they look like this:
    veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"


    Respawn Delay:
    Default respawn delay is 30 seconds, to set a custom respawn delay time, put that in the init as well.
    This one will respawn in 15 seconds:
    veh = [this, 15] execVM "vehicle.sqf"

    Deserted Vehicle Respawn:
    Default respawn time when vehicle is deserted, but not destroyed is 120 seconds.
    To set a custom timer for this first put the respawn delay, then the deserted vehicle timer.
    The value 0 will disable the timer and the vehicle will not respawn when deserted.
    This one will respawn in 15 seconds if destroy, and in 50 seconds if left empty in the field.
    veh = [this, 15, 50] execVM "vehicle.sqf"

    Respawn limit:
    By default the number of respawns is unlimited. To set a limit, first set the other values
    then the number of respawns you want (0 = infinite).
    veh = [this, 15, 10, 5] execVM "vehicle.sqf"

    Effect:
    Set this value to TRUE to add a special explosion effect to the wreck when respawning.
    Default value is FALSE, which will simply have the wreck disappear.
    veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf"

    Dynamic Respawn:
    By default the vehicle will respawn to the point where it first was when the mission started (static). This can be changed to dynamic.
    Set it to TRUE to get the vehicle to respawn to the position where it was destroyed. FALSE makes it use the default static setting.
    veh = [this, 15, 10, 5, FALSE, TRUE] execVM "vehicle.sqf"

    INIT field:
    If you you want to set the INIT field of the respawned vehicle, first set all other
    values, then set init commands. Those must be inside quotations.
    veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf"

    if you need to use quotations in your init, use double. like this:
    veh = [this, 15, 10, 5, TRUE, FALSE, "hey = [this] execVM ""loadout.sqf"""] execVM "vehicle.sqf"

    Also, remember that you need to put your init outside the vehicles script as well if you want
    it to run initially:
    hey = [this] execVM "loadout.sqf"; veh = [this, 15, 10, 5, TRUE, FALSE, "hey = [this] execVM ""loadout.sqf"""] execVM "vehicle.sqf"

    Change log:
    v1.8
    * Updated for Arma 3

    v1.7
    * Added function to disable deserted vehicle respawn.

    v1.6
    * Fixed serious bug introduced in v1.5, where respawn timer was disabled.
    * The script will no longer try to reset the name of vehicles originally unnamed.
    * Added check if deserted vehicle is destroyed.

    v1.5
    * Option to set the INIT of the respawned vehicle.
    * Vehicle now respawns with original name.

    v1.4
    * Fixed some bad code that ended up in error codes. Script should be less heavy now. (thanks Xeno!)
    * Fixed bug where a vehicle that moved by an explosion would trigger the deserted timer.

    v1.3:
    * Support added for vehicles placed on hangars (with setPosASL).
    * Added optional respawn limit.
    * Added optional respawn effect (explosion).
    * Better damage checking. Now the vehicles shouldn't respawn when units are in them.

    v1.2:
    * Script now fully support any vehicle, including bícycles.
    * Fixed positioning for vehicles close to other objects.
    * Improved stability. The script runs much better with large amounts of vehicles.

    v1.1:
    * Rewrote most of the the script.
    * Added respawn for vehicles left empty in the field. The delay can be set.
    * Added dynamic respawn option. The vehicles can now be spawned where it was destroyed.

    v1.0
    * First release.


    Future plans:
    The dynamic setting is experimental. Works fine on land, but might cause trouble if a vehicle
    crashes into water. This will be fixed in a future version.



    // Tophe of Östgöta Ops [OOPS]

  2. #2

  3. #3
    I'm fairly new to making my own missions so I apologize if this is a noob mistake but I downloaded the script, put it in the missions folder and set the init field for a helicopter but it won't let me get in as pilot but will let me access the gear. I'm also using a crate filling script that is working fine so I figure I'm not doing something right. This is what I've done, step by step.

    1) Created a player
    2) Created an empty helicopter
    3) Set the init field to read: veh = [this] execVM "vehicle.sqf"
    4) Created a weapons crate
    5) Applied the init field for that script
    6) Save and hit preview


    Any idea's?

  4. #4
    Sergeant xx-LSD-xx's Avatar
    Join Date
    Jan 21 2011
    Location
    Menifee,California U.S.A
    Posts
    141
    Quote Originally Posted by HughMadBro View Post
    I'm fairly new to making my own missions so I apologize if this is a noob mistake but I downloaded the script, put it in the missions folder and set the init field for a helicopter but it won't let me get in as pilot but will let me access the gear. I'm also using a crate filling script that is working fine so I figure I'm not doing something right. This is what I've done, step by step.

    1) Created a player
    2) Created an empty helicopter
    3) Set the init field to read: veh = [this] execVM "vehicle.sqf"
    4) Created a weapons crate
    5) Applied the init field for that script
    6) Save and hit preview


    Any idea's?
    Set the heli to empty and as non playable. Select non playable option first to open the empty option.

    I almost forgot. Great script Tophe thank you.
    Last edited by xx-LSD-xx; Mar 7 2013 at 19:12.

  5. #5
    Quote Originally Posted by xx-LSD-xx View Post
    Set the heli to empty and as non playable. Select non playable option first to open the empty option.
    That's how I have it now.

    ---------- Post added at 20:21 ---------- Previous post was at 20:11 ----------

    Ok, I think I got it. I went in and changed them to not being in formation and set it to "unlocked" instead of "default" and now I can hop in.

    Thanks for the help guys.

  6. #6
    Sergeant xx-LSD-xx's Avatar
    Join Date
    Jan 21 2011
    Location
    Menifee,California U.S.A
    Posts
    141
    @HughMadBro

    You have it like this?
    Side = Empty?
    Faction = Blank?
    Class = Air?
    Unit = Ah9?
    Special = None or Formation?
    Control = Non playable?
    Vehicle lock = default?
    Name = Whatever I have ch1?

    I just did that to check and it works for me.

  7. #7
    That's exactly how I had it (except for the name, I'm not that experienced enough to even know why I should name things) and I couldn't enter it. I changed formation to none and vehicle lock to unlocked and now I can get in. Not sure why but it works now .

  8. #8
    Hey guys, currently working on "ARMEX3", practically the ARMA 3 version of ARMEX. Not many vehicles, tried using this script, it just says that script is missing, to make sure I am installing it right, can you explain it to me?

  9. #9
    Thanks for the update Used 1.7 for a few days, was working aswel(as far i could see).

  10. #10
    Master Gunnery Sergeant Tophe's Avatar
    Join Date
    Jun 4 2004
    Location
    Örebro/Sweden
    Posts
    1,034
    Author of the Thread
    Quote Originally Posted by m0nkm0nk View Post
    Thanks for the update Used 1.7 for a few days, was working aswel(as far i could see).
    Yeah, works for the most part, but some options call for stuff with new classnames A3. So that's fixed now.

    Quote Originally Posted by Xotodazo View Post
    Hey guys, currently working on "ARMEX3", practically the ARMA 3 version of ARMEX. Not many vehicles, tried using this script, it just says that script is missing, to make sure I am installing it right, can you explain it to me?
    Make sure you put it in the root folder of your mission. If you don't know how to do that, search the forum for some mission editing and scripting tutorials.

Page 1 of 19 1234511 ... LastLast

Similar Threads

  1. Simple Vehicle Respawn Script
    By Tophe in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 179
    Last Post: Feb 20 2014, 11:44
  2. Simple Mobile Respawn Script
    By Iceman77 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Nov 29 2012, 18:58
  3. Please.... Help? Vehicle Respawn issue... Also, automatic Vehicle Repair Script help.
    By SoggyMilk in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 0
    Last Post: May 2 2010, 20:14
  4. Simple script for unit to respawn with 'original' custom load-out?
    By CyOp in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Mar 7 2010, 04:14
  5. How do I insert simple vehicle respawn script into a spawned (createvehicle) init
    By CombatComm in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Oct 29 2009, 12:49

Posting Permissions

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