Author: Fiddi
Author Website:

Requirements: No addons required

Version: 1.0.1

Short description: I present to you the vehicle respawn that will change your life (probably not..), it has the capabilities to save much of the customization available in the Eden editor and apply it on respawn.

Date: 2017-02-12 13:07


Comments: (0)
Rating:



 







Light advanced vehicle respawn

by
Fiddi


Description:
I present to you the vehicle respawn that will change your life (probably not..), it has the capabilities to save much of the customization available in the Eden editor and apply it on respawn. You simply set up your vehicle how you want it in the editor and this applies whatever settings you want. I've made it as light as I can, it should not affect performance noticably (though with hundreds of respawnable vehicles, it could).


Features:
Multiplayer and singleplayer:
Init Support
Respawn Delay
Custom Loadout/Inventory
Custom Paints
Custom Parts
Respawn Limit
Wreck Disposal
Minimal Performance Impact


Installation / Usage:
For usage instructions and information of how to use the Light advanced vehicle respawn please refer to the included documentation and/or example mission.

1. Download the script in question (Included an example mission that have it set up ingame)
2. Copy over files to you mission:
Simply grab the "VehicleRespawn" folder from the archive (inside Example.VR) and place it in your mission folder.
3. Setting up to load ingame:
In your description.ext (if you don't have one, create it) add this:
class CfgFunctions {
	#include "VehicleRespawn\CfgFunctions.hpp"
};
4. Choosing which vehicles to respawn:
In the Init-field of the vehicle(s) you want to respawn put this:
[this] call FRED_fnc_vehicleRespawn;
This will respawn you vehicle when destroyed with default settings (details below).
Now you have a vehicle that will respawn when destroyed.

Additional customization:
There are options you can customize and disable at your leisure

Parameters:
0 : OBJECT (REQUIRED)
- Vehicle to be monitored for respawn.
1 : NUMBER (OPTIONAL)
- Respawn delay in seconds. +-5-10 seconds.
(Default: 5)
2 : CODE (OPTIONAL)
- Initialization for vehicle. (To call vehicle use: _this)
3 : NUMBER (OPTIONAL)
- Respawn Limit. Number of lives a vehicle has. Unlimited by default.
(Default: -1)
4 : BOOLEAN (OPTIONAL)
- Deletes wreck on respawn. Wrecks within
100m of respawn point is automatically deleted, regardless of setting.
(Default: false)
5 : BOOLEAN (OPTIONAL)
- Use Custom Loadout. Saves inventory and loads it on respawn.
(Default: true)
6 : BOOLEAN (OPTIONAL)
- Custom Paintjob. Saves the current paint on the vehicle and applies it on respawn.
(Default: true)

Example:
[this, 5, {_this allowDamage false;}, false] call FRED_fnc_vehicleRespawn;

There's also an option to quit respawn for a vehicle if the situation requires it. Simply execute this code on the vehicle:
Vehicle setVariable ["VRStop", true];

You can add vehicles for the function to respawn when the mission is already running.


Changelog:
v1.0.1
Fixed issue with missionNamespace variable.
Small readability tweaks.
Switched to uiSleep instead of Sleep.

v1.0
- Initial Release.


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Respawn,   Scripts,   Vehicle