Author: Murklor
Author Website:

Requirements: No addons required

Version: 9

Short description: This script caches the units placed on the map and spawns them when needed.

Date: 2014-09-27 14:27


Comments: (0)
Rating:



 

Editor based AI script by trigger

by
Murklor


Description:
I searched around for such a script before and really failed to find anything something like it. Norrins AI/vehicle respawn script work great, but uses icky markers. Dont like filling my map with markers even if they are invisible. If a simple editor based triggered spawn script already have been done - well then this is a repost, lol!

To allow for simple trigger based spawning using editor placed units and waypoints. The script deletes all units when the mission start and the recreate them on command.


Installation / Usage:
Parameters:
_this select 0: OBJECT - unit name (this) 
_this select 1: STRING - spawn type ("once","repeated","wave" and "reset")
_this select 2 (optional): NUMBER - spawn lives (the amount of time the unit respawns, or wave number)
_this select 3 (optional): NUMBER - spawn delay
_this select 4 (optional): STRING - init string called for the leader of the group
_this select 5 (optional): NUMBER- will start removal sequence of all dead group members after X seconds (default 120)

Usage:
Example trigger: Anybody Once (or whatever you want), onActivation: triggername setVariable ["murk_spawn",true,true];
Unit (leader of group): nul = [this,"SPAWNTYPE",LIVES,DELAY] execVM "murk_spawn.sqf";

Example:
nul = [this,"once"] execVM "murk_spawn3.sqf";
Will spawn the editor unit once based on the trigger
Example:
nul = [this,"repeated",4,30] execVM "murk_spawn.sqf";
Will spawn the editor unit based on the trigger, then respawn it 4 times with a 30 second delay upon death
Example:
nul = [this,"wave",5,60] execVM "murk_spawn.sqf";
Will spawn the editor unit once based on the trigger, then respawn the entire group (regardless of deaths) 5 times with 60 seconds between
Example:
nul = [this,"reset",5] execVM "murk_spawn.sqf";
Will spawn the editor unit once based on the trigger, then reset the trigger after a preset time (15 seconds default). The unit will be created when trigger is true again, maximum number of lives.

Changelog:
v9
- Note: Initial Arma 3 test script. Note that some functionality from V8/V7 has been taken out because my brain is too foggy to understand everything, this is simplified. Sort of.
- Fix: setVehicleInit has been removed from A3, testing another way
- Add: New example mission on Stratis
- Change: The trigger variable is held in the object that is synchronized to the group for improved WYSIWYG. This means that the trigger argument is no longer needed.
- Change: Updated this readme to reflect the changes

v8b
- See older versions on the Arma 2 page of this script: Editor based AI script by trigger A2


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Spawn,   Trigger