Tags: No tags
Description: 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" Usage: There are some optional settings. The format for these are: veh = [this, Delay, Deserted timer, Respawns, Effect, Static, "INIT"] 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. Settings: 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, Then the vehicle will respawn to the position where it was destroyed. First set the respawn delay and the deserted timer then put 1 for dynamic. Don't put anything at all for default static. This one will respawn in 15 seconds if destroyed, 50 seconds if deserted. It will spawn to the latest position of the vehicle: veh = [this, 15, 10, 1] 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" Change log: 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 reset 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. 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. Forums Topic: - BIS Enable javascript to be able to download from Armaholic please!
Tags: No tags
|
Your script looks like it only supports one map and since the documentation that comes along with it doesn't come with any instructions I can't even attempt to use it without worrying what might happen if I don't place it in the right directory or don't execute it properly. Perhaps you can write up a simple set of instructions on exactly how to get this working thanks...
I suggest you read the BIS forum and the BIKI
http://community.bistudio.com/wiki/Category:ArmA:_Mission_Editing
and learn the basics of mission editing.
Also you can click the link to forum thread for this script and read there.
http://forums.bistudio.com/showthread.php?t=77526
Hi matey,

I'm using this respawn script to have a mess about with planes. However, when I place the plane in editor I remove all the weapons for each plane but, when the plane spawns back it has all its weapons as well....
Basically, how can I spawn the planes back with no ammo?
Thanks
Oh.. I'll look into it. Have to see if I can get the script to run any init lines.
Otherwise you might try doing it with triggers that removes weapons from any present vehicle.
It'll be easier if you feedback in the BIS thread so we may pick up the discussion.
Thanks for the heads up on this man...
// Tophe
Works great for my carrier missions. Originally I couldn't spawn aircraft back on the deck as they would appear on the water, but with your code, they place themselves exactly where I placed them in the editor! Beautiful job!
I'm trying to get a vehicle to respawn with infinite ammo. Can't figure out how to get <<< this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}] >>> to stick in the vehicle init after it respawns. This is the full code I'm trying to use <<< veh = [this, 1, "this addEventHandler [""Fired"",{(_this select 0) setVehicleAmmo 1}]"] execVM "vehicle.sqf" >>>
Hi mate
I am using this in arma 3 and before the last update it was working great.
No I have a black box in the centre of the screen saying the following:
Vehicle distance undefined
Params_vehiclerespawndistance
Vehicle.sqf line 94
Have you come across this yourself?
I've had a look at the vehicle.sqf and found the relevant line but it just says the code shown below and not sure what to do with it LOL.
{
if ((_x distance _unit) < PARAMS_VehicleRespawnDistance) exitWith { _nearPlayers = true; };
} forEach playableUnits;
if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8) and !_nearPlayers) then
Total comments : 8, displayed on page: 8