AI VEHICLE RESPAWN SP/MP
Hi all,
Did you ever try the BI respawn vehicle module? That works well on empty ones, as far as you linked the vehicles to the module.
With some disappointment trying to link a flying helicopter and see it (them!) falling to the ground.
A little code in the "expression field" and, yeah, you create a new crew and a helo just hovering now!
But, what if you want, not only the standard crew, but also the airborne assault squad into it? When? Where on helo track (waypoints)?
And, why not respawning a crate? and the loadout for any respawned vehicle/crate?
I suggest the following script to allow AI vehicle, manned or empty, but no player on board), respawning according to parameters. This works in SP or MP.
Only vehicles (+ full crew if any) / crates are concerned as far as the respawn for killed infantry AI units is the object of a this other script.
version April 29th 2020
Totally reworked for better reliability in heavy scenario (MP/SP)
This script is also available as module in MGI ADVANCED MODULES, with more possibilities.
parameters: VEHICLES / POSITIONS / DELAY / RESPAWN WHEN DISABLED / EMPTY VEHICLES (ALL)
Examples:
[] spawn MGI_fnc_vehicleRespawn // [] passed as parameter equals to [ [ ], "death", 10, false, true]
All empty vehicles can respawn on their position at death, after 10 sec delay, without possibility to respawn if just disabled.
[ [WEST,EAST], ["mrk1","death","start",""], nil, false,false ] spawn MGI_fnc_vehicleRespawn // equals to [ [WEST,EAST], ["myMrk1","death"], 15, false,false]
here, only WEST & EAST ai vehicles can respawn:
- on the marker "myMrk1" if any, (on death position if marker not present), for BLUFOR vehicles
- on the position of death for OPFOR vehicles,
(other strings in positions array are useless), 10 second delay (default), without respawn when disabled.
Code to be run on server (eventually on Headless Client). example: initServer.sqf if no HC.
or inside a simple trigger in 3den, server only, non-repeatable, condition true
___________________________________________________________________
SCRIPT
Enjoy!
Pierre MGI
Notes:
- If you choose to respawn the disabled vehicles, these will be destroyed (then respawned), probably earlier than for the normal destruction. Destruction occurs sooner but not before the crew leaves the vehicle. So, if you allow crew staying inside immobilized vehicle, this "respawn on disabled" is postponed until destruction by enemy or abandon.
- using the second script, some behaviors like custom loadout and actions menu needs to fire the EH handle damage. That is to say, you have to damage the vehicle in-game (firing at it), not using a simple setDamage via debug console (this command doesn't trigger the EH). Also, let some seconds after mission start (Arma engine actions menu returm something for the actionParams).
Version 13112018: added possibility to "respawn" the code written in init field of a vehicle.
Version 06122018: improved jets respawn.
Version 09102019: spawning vehicles on carrier at sea.
Version 13103019: fuel management and some extra cases
Version 26112019: all mags are restored with the exact ammo count.
Version 19122019: respawned vehicle is locked same as destroyed one.
Version 19042020: better reliability in heavy mission context. All in one script.
Version 21072020: repaired UAV respawn
AI VEHICLE RESPAWN SP/MP
Hi all,
Did you ever try the BI respawn vehicle module? That works well on empty ones, as far as you linked the vehicles to the module.
With some disappointment trying to link a flying helicopter and see it (them!) falling to the ground.
A little code in the "expression field" and, yeah, you create a new crew and a helo just hovering now!
But, what if you want, not only the standard crew, but also the airborne assault squad into it? When? Where on helo track (waypoints)?
And, why not respawning a crate? and the loadout for any respawned vehicle/crate?
I suggest the following script to allow AI vehicle, manned or empty, but no player on board), respawning according to parameters. This works in SP or MP.
Only vehicles (+ full crew if any) / crates are concerned as far as the respawn for killed infantry AI units is the object of a this other script.
version April 29th 2020
Totally reworked for better reliability in heavy scenario (MP/SP)
This script is also available as module in MGI ADVANCED MODULES, with more possibilities.
parameters: VEHICLES / POSITIONS / DELAY / RESPAWN WHEN DISABLED / EMPTY VEHICLES (ALL)
Examples:
[] spawn MGI_fnc_vehicleRespawn // [] passed as parameter equals to [ [ ], "death", 10, false, true]
All empty vehicles can respawn on their position at death, after 10 sec delay, without possibility to respawn if just disabled.
[ [WEST,EAST], ["mrk1","death","start",""], nil, false,false ] spawn MGI_fnc_vehicleRespawn // equals to [ [WEST,EAST], ["myMrk1","death"], 15, false,false]
here, only WEST & EAST ai vehicles can respawn:
- on the marker "myMrk1" if any, (on death position if marker not present), for BLUFOR vehicles
- on the position of death for OPFOR vehicles,
(other strings in positions array are useless), 10 second delay (default), without respawn when disabled.
Code to be run on server (eventually on Headless Client). example: initServer.sqf if no HC.
or inside a simple trigger in 3den, server only, non-repeatable, condition true
___________________________________________________________________
SCRIPT
Enjoy!
Pierre MGI
Notes:
- If you choose to respawn the disabled vehicles, these will be destroyed (then respawned), probably earlier than for the normal destruction. Destruction occurs sooner but not before the crew leaves the vehicle. So, if you allow crew staying inside immobilized vehicle, this "respawn on disabled" is postponed until destruction by enemy or abandon.
- using the second script, some behaviors like custom loadout and actions menu needs to fire the EH handle damage. That is to say, you have to damage the vehicle in-game (firing at it), not using a simple setDamage via debug console (this command doesn't trigger the EH). Also, let some seconds after mission start (Arma engine actions menu returm something for the actionParams).
Version 13112018: added possibility to "respawn" the code written in init field of a vehicle.
Version 06122018: improved jets respawn.
Version 09102019: spawning vehicles on carrier at sea.
Version 13103019: fuel management and some extra cases
Version 26112019: all mags are restored with the exact ammo count.
Version 19122019: respawned vehicle is locked same as destroyed one.
Version 19042020: better reliability in heavy mission context. All in one script.
Version 21072020: repaired UAV respawn