Author: ArmAIIholic
Author Website:

Requirements: No addons required

Version: 8b

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

Date: 2011-03-03 16:43

Comments: (4)


Editor based AI script by trigger

Murklor & ArmAIIholic

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!

ArmAIIholic remark : from v8 you can get your mission copied to Clipboard exactly as you made it in the editor. But would it be useful if this script doesn't come with loader, right? Check demo missions!

How it works:
- Deletes units on mission starts and save them for later usage and/or copy to Clipboard
- Spawn them again based on a trigger
- Unlike my sample mission, the AI should be given more time to get "accustomed" to the world. Spawning enemies too close to each other can cause wierd behaviour.

- Any unit
- Any group (infantry, land vehicle and air vehicle groups)
- Many waypoints supported, unfortunetly not all types and combos (synching a get in and load wont work and I dont really know why ). I recommend keeping it simple.
- "once" mode (one shot), "repeated" mode (respawn), "wave" mode (fixed delay then respawn all), "reset" mode (units can be called again at will)
- Any kind of unit/trigger variable combo (ie you can have units going once together with respawning units and wave units etc on the same trigger variable)

The sample missions should give everything needed to use in any mission. How to use the mission: Approach each sandbag wall and it will trigger a group of AI units going about their buisness: whatever they where supposed to do when you placed them in the editor. Note on the one of the triggers: This uses units in reset spawn mode, move to the wall then back out. You can trigger it at will again some 15 secs later.

- placement radius workaround is now properly working (thanx to psvialli persistence)

v8 (ArmAIIholic)
No groups
Mission on clipboard - Units and waypoints are saved as they were in SQM.

- Waypoints are also remembered -- no dummy groups at all!!!
- You get the output on Clipboard you can paste and execute. Added loader for Clipboard missions -- test demo_2.utes.

Caution :
a) be careful with waypoint statements >> they need to be between " ", so you have to use ' '. Look at the examples in demo_1.utes.
b) waypoints don't have placement radius when saved to clipboard, they will be saved with position they've got from the editor

- Triggers are now plain variables (catch_trigger) and they use publicVariable
a) simpler to manipulate, no initialization in init.sqf
b) they are remembered and copied to Clipboard

- Scripts are waiting with waitUntil rather than while (different "busy waiting" approach)

Demo missions:
Demo_1 is classic Murklor's example, the one that you have also in v7, but with corrections for waypoint statements
Demo_2 is loaded from Clipboard >>> loader.sqf >>> murk_spawn_loaded.sqf ---- you won't see any units on the map!
That mission has 23KB

Capturing mission:
Mission is captured from every murk_spawn.sqf, so give it some time to spawn everything and copy it to Clipboard. The more units you have on the map, the more time it will take for those scripts to save everything to clipboard.
IMHO, using loaded missions will solve problems with other scripts (like Norrin's revive etc.) -- though didn't test that yet myself.

V7 (ArmAIIholic)
- Added GameLogic center to reduce number of dummy groups at the beginning, and in modes repeated and reset ***
- Changed beginning scope to isServer, rather than using exitWith
- Shortened initializing trigger part in init.sqf
- Added original instructions and examples, adapted for v7
- SQM is from v5 with some groups added
- Functions module is not needed, but I placed it anyway (habit when making missions)

- Murklor's experiment with functions

- Change: Removed group and function scripts, everything done in a single file
- Change: Spawn trigger variable is now a setVariable of the trigger instead of a global variable
- Add: Option to enable removal of dead units, eventhandler attached to everyone spawning
- Fix: Should now work in multiplayer on a dedicated server (only tested on a local dedicated/join setup however)
- Fix: Performance issues with helos from V4 resolved, was a mistake on the example mission and not the script
- Fix: Some minor bugs with the optional parameters
- Fix: Now properly support crews in turrets-on-turrets (had to bring in some BIS made functions)

- Change: No longer requires the BIS functions module
- Add (again): Like V2, it saves the weapons and magazines and restore them
- Fix: squad leader init is now fired after the creation of the entire group, can manipulate squad members with init
- Change: Removed the external paradrop script, its down with a [] spawn in the waypoint. Just trying out different things

- Fixes the mistake with the vehiclevarname

- Added types of spawns: "once", "repeated", "wave" and "reset"
- Cleaned up the script to make use of functions, much shorter group scripts this way and easier to add new modes
- Can now be used on flying vehicles
- Made use of define to set the global trigger variable, easier user editing
- Made use of BIS functions, can now recreate groups of vehicles instead of just one (much less scripts running)
- Removed the need for a vehicle boolean

- First basic script, place units in the editor and link to a spawn trigger

Forum topic:
- BI forums

Enable javascript to be able to download from Armaholic please!

Tags: Spawn,   Trigger