This script randomly spawns enemy units in a random position (or positions) you define. These newly created groups will then move to a waypoint location that you specify as well.
The types of forces this script spawns are random with a percentage chance of being spawned. For example, Infantry might always spawn (100% chance) but the number of groups that are spawned may differ (random of max 10 groups - you can define this as well inside the script)
so you can specify and customize whatever types of units you want it to spawn, it supports custom factions as well, all you have to do is add that faction classname into the script (template already inside), and fill the arrays with the classnames of the groups there (individual units will not work)
You can adjust the amount of waves the script will produce (1 wave = 1 iteration of the script spawning stuff)
You can also adjust the timer before a new wave begins (old units that are alive will still stay on the field, but dead units and empty groups will be deleted to preserve cpu and space) - thanks demonized for the empty group feature
This script is Multiplayer compatible, works with both dedicated and listen servers (however the host will probably be lagging quite a bit with this script)
where:
RUguy - The name of a unit on the field, the script will take this units faction and side and spawn units of this type, works with BIS_US, USMC, RU, TAKI_INS, and Taki Army
[spawn1, ..... ] - the spawn locations on the map (best to use gamelogics with names here)
attackwp - an object or gamelogic where the units spawned will move to
spawntimer - the amount of time to wait before spawning new units (in seconds)
Scripttime - the amount of waves you wish the script to run
// RUIS script (Random Unit Invasion Script) v1.2
// changed attak waypoint to function as array - allows for spawned group to randomly select a position to move to
// example: nul = [RUguy, [spawn1, spawn2, spawn3], attackwp, spawntimer, Scripttime] execVM "RUIS.sqf"
// unit - this unit will be checked for what side and faction to spawn
// [spawn1, ...] - gamelogics for units to spawn on
// attackwp - an array of positions spawned units will move to (chosen randomly per group)
// spawntimer - amount of time to wait until the spawning of a new unit
// scripttime - the amount of waves this script will run (1 wave = 1 iteration of script spawning stuff)
if (isServer || isDedicated) then {
private ["_spawntime", "_logicS", "_logicE", "_temptime", "_scripttime", "_unit", "_perc", "_faction", "_side", "_MaxInf", "_MaxV", "_MaxLA", "_MaxArm", "_MaxAir", "_PInf", "_PV", "_PLA", "_PArm", "_PAir", "_EmptyGroups"];
_unit = _this select 0;
_logicS = _this select 1;
_logicE = _this select 2;
_spawntime = _this select 3;
_scripttime = _this select 4; // this sets the amount of waves the script will do
_faction = faction _unit;
_side = side _unit;
_EmptyGroups = 0;
// EDIT THESE VARIABLES TO CUSTOMIZE RUIS
_MaxInf = 10; // Maximum amount of infantry that can be spawned in a single wave
_MaxV = 3; // Max amount of vehicles to spawn
_MaxLA = 3; // Max amount of light armored in a single wave
_MaxArm = 1; // Max amount of armor
_MaxAir = 1; // Max amount of air
_PInf = 100; // Percentage chance of Infantry being spawned (100% = everytime, 0% = never)
_PV = 85; // Percentage chance of vehicles spawning
_PLA = 75; // Percentage chance of Light vehicles being spawned
_PArm = 25; // Percentage chance of Armor being spawned
_PAir = 5; // Percentage chance of Air being spawned
// DO NOT EDIT PAST THIS
// check what side was chosen, and assimilate proper values
Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.
Hm - Am I doing something wrong...? - no enemies in sight, just the VERY annoying 'pings' from the hints... - were're all the enemise...? - nothing happens... :|
"Retreating? Hell no, we're advancing in a different direction!" -- Marine Corps General, O. P. Smith
Hm - Am I doing something wrong...? - no enemies in sight, just the VERY annoying 'pings' from the hints... - were're all the enemise...? - nothing happens... :|
Really debug messages should be in text instead of hints. Any anything that repeatedly hints *must* use hintSilent. Either make that optional or remove it entirely.
I'm not seeing the script checking for and creating if necessary a center, so it's possible it won't work unless preexisting units of the side are already on the map. So either place people on the map first, or have the script check for a center to have been created first.