Author: Tophe
Author Website:


Version: 1.81

Short description: This script will respawn a vehicle when it is destroyed or left empty in the battlefield.

Date: 2013-03-12 19:46

Comments: (4)


Simple Vehicle Respawn [ALPHA]

Tophe of Östgöta Ops

This script does no longer work in Arma 3! At some point the author will release an updated version.

This script will respawn a vehicle when it is destroyed or left empty in the battlefield.
It will respawn with its original name. Works with any vehicle.

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

There are some optional settings. The format for these are:
veh = [object, Delay, Deserted timer, Respawns, Effect, Dynamic, "INIT"] execVM "vehicle.sqf"
Default settings are:
veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"
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.

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"

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. The vehicle will then respawn to the position where it was destroyed.
Like this:
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.
Like this:
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"

* Removed bad debug code

* Updated for Arma 3

* Added function to disable deserted vehicle respawn.

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

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

* 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.

* 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.

* 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.

* 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.

Forums Topic:

Enable javascript to be able to download from Armaholic please!

Tags: Respawn,   Simple,   Vehicle