AISSP is a collection of scripts offering dynamic experiences with AI, dynamic scenarios and versatile customizations with just a few lines of code.
These scripts can be initilized from almost anywhere; init fields, Game Logics, triggers, other scripts, etc. This documentation also includes easy-to-use setup tool for each script - simply adjust everything to your likings and copy-paste the final init code into your mission.
Main scripts:
AmbientCombat | Creates madness all around you! AmbientCombat can be adjusted in many ways and also ended from a trigger or script. |
AmbientExplosions | Creates explosions all around, avoiding units and areas you want it to avoid. Can be brought to scene by planes or artillery. |
Militarize | Fills defined area with patrolling units and vehicles. |
FillHouse | Fills building or buildings in radius with patrolling infantry units. |
ReinforcementChopper | Spawns a chopper which brings infantry group to target landing zone. |
HeliParadrop | Spawns a chopper which brings paradrop group to target location. |
SimpleCache | Caches (despawns) AI units of FillHouse and Militarize once they are far enough from player(s) and respawns them when player(s) gets near enough. |
SimpleCacheV2 | Caches (despawns) AI units of FillHouse and Militarize once they are far enough from player(s) and respawns them when player(s) gets near enough. This V2 version (by Na_palm) also takes care of FillHouse and Militarize without a need to initialize them separately. |
Each script has loads of parameters to be customized and even possibility to use AI's individual init fields to customize things even further. We included a few premade scripts that can be set to custom init in each scripts setup tool.
With custom init you basicly can extend everything. Important thing is to note that custom init content will have to be wrapped in "quotes". (Setup tools on this documentation will do the wrapping for you.) This means that inside of it you can not use these same "double quotes" - instead you must use 'single quotes' or ""double-double quotes"".
Example:
"this addEventHandler ['killed',{_this execVM 'UnitWasKilled.sqf'}];"
However, for complex stuff it is recommended that you use Custom init just to initialize external script, where you actually do all the magic, for example:
"nul = [this] execVM 'customScript.sqf';"
Then in customScript.sqf you can refer the individual unit with:
_individualUnit = _this select 0;
class aissp_configs{ #include "LV\config_aissp.hpp" };
Old versions:
If everything is ok, your missions folder should look more or less like this:
Creates dynamic ambient combat around defined object/unit(s). AI created by this script will patrol in random places around the center unit(s) of ambient combat, and engages each others and players. Basic idea is to define how many groups of AI will be created, and separated ratios for each side. Once a group dies or goes out of dissapearDistance and despawns, a new random group will be spawned.
How to use Ambient Combat?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you may define parameters to customize the script.)
nul = [] execVM "LV\ambientCombat.sqf";
Parameter | Description | Default |
---|---|---|
1: Min range | 1-2000 (meters, minimum range from player/centerUnit for AI to spawn) | 450 |
2: Max range | 2-9999 (meters, maximum range from player/centerUnit for AI to spawn) | 900 |
3: Min delay | 0-3599 (seconds, minimum spawning delay for AI) | 30 |
4: Max delay | 1-3600 (seconds, maximum spawning delay for AI) | 30 |
5: Groups | 1-20 (how many AI groups can be alive at the same time) | 6 |
6: Side ratios | array ([west ratio, east ratio, ind ratio], each ratio value is number between 0.0 - 1.0) | [1,1,1] |
[0,1,1] spawns only East and Independent units [1,0.5,0.5] spawns 50% West units, 25% East and 25% Independent units |
||
7: Center unit | unit/array of units (unit or units which are the center of all action) | player |
player = use this in SP, and you will be the Center unit [pl1,pl2,pl3,pl4,pl5] = with array format you can define multiple named units to be Center units |
||
8: Vehicle chance | 0-100 (%-chance for vehicles to spawn) | 40 |
9: Air vehicle chance | 0-100 (%-chance for air vehicles to spawn) | 20 |
10: Water units | true/false (will water units spawn?) | false |
11: AI skills | 0-1.0 or "default" or array of individual skill values (AIs skills) | "default" |
"default" leaves AI skills to default 0.75 makes all AI skill levels to 0.75 (75%) [0.75,0.8,0.9,1,1,1,1,1,0.9,1] adjusts skill levels separately, as in: [aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed] |
||
12: Communication | true/false (if true, then AI groups will communicate and inform each others about enemy contacts) | true |
13: Dissapear distance | 100-10000 (meters, distance from Center unit where AI units/groups will despawn and trigger new group to be spawn) NOTE: Must be bigger than Max range parameter |
2500 |
14: Custom init | If you want to add something in units init lines, add it here in "quotes". If you need to use quotes inside the init itself, use ' or "" instead of ", or use this parameter to init external script | nil |
"hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;" "nul = [] execVM 'customScript.sqf';" |
||
15: Patrol type | 1 or array (1 = doMove for each unit individually, array = waypoints for whole group) | 1 |
1 = units moves to target location individually without group behaviour ["AWARE","SAD"] = units moves as a group to target location, behaviour is AWARE and waypoint type is Search&Destroy WaypointBehaviour options: "CARELESS","SAFE","AWARE","COMBAT","STEALTH" WaypointType options: "MOVE","DESTROY","SAD"NOTE: CARELESS WaypointBehaviour is bugged and might prevent new waypoints. |
||
16: MP | true/false (true = Center unit will automatically be an array of all alive non-captive playableUnits) | false |
17: Cleanup | true/false (true = automatic cleanup for dead units) | true |
18: Classes | array (classes from config_aissp.hpp, defines which unit classnames are being used) | ["ALL"] |
You can make markers where units wont be spawned and which they will try to avoid during their patrolling. This can be done with normal markers (RECTANGLE & ELLIPSE). Name the first one to ACavoid and just copy & paste it, so that next ones will have names like ACavoid_1, ACavoid_2, etc, up to ACavoid_30. These can also be created on the fly, and Ambient Combat will notice them.
Ambient Combat can also be stopped via scripts or triggers. If you wish to do this, you must first assign a unique handle for the Ambient Combat script, instead of nul:
uniqueHandle = [] execVM "LV\ambientCombat.sqf";
Parameter | Description |
---|---|
1: Handle | Handle which was used to initialize Ambient Combat |
2: Style | 0 / 1 / 2 (0 = units despawn straight away, 1 = units flee and dissapear after Range, 2 = units dies after random Delay) |
3: Synced unit | Center unit of Ambient Combat. Style 1 uses this for its calculations |
4: Range / Delay | Range in meters / max Delay in secs (if used Style 1, units will dissapear after moving Range from Synced unit) OR (if used Style 2, units will die after random Delay) |
5: Flee direction | nil or 0-360 (direction where AI forfeits when Style 1 is being used. nil = dynamically away from Synced unit) |
Creates dynamic ambient explosions around defined object/unit(s). Explosions can be brought to scene by airplanes or artillery (distant sfx). You can easily define which units and/or areas are avoided from exploding.
How to use Ambient Explosions?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you may define parameters to customize the script.)
nul = [] execVM "LV\ambientExplosions.sqf";
Parameter | Description | Default | |
---|---|---|---|
1: Center | array (units / objects that are the center of explosions) | [player] | |
2: Amount | number (average explosions amount per minute) | 10 | |
3: Duration | number (seconds, duration of Ambient Explosions) | 30 | |
4: Max distance | number (meters, maximum distance from center object(s) where explosions occur) | 600 | |
5: Min Distance | number (meters, maximum distance from center object(s) where explosions occur == safe radius) | 100 | |
6: Avoid players | boolean (if true, explosions will avoid center units/objects (-> Min Distance)) | true | |
7: Avoid AI | boolean (if true, explosions will avoid all AI units (-> Min Distance)) | false | |
8: Planes | false | array (plane parameter array, or false if planes not needed) | default: | |
[2,["ambientExplosionsPlanes"],1500,300,"random"] |
|||
1: Side | 1 = west, 2 = east, 3 = resistance | 2 | |
2: Classname class | Classes for planes. New example class "ambientExplosionsPlanes" added to LV/config_aissp.hpp | ["ambientExplosionsPlanes"] | |
3: Distance | Distance from which the planes comes from | 1500 | |
4: Altitude | Flying altitude for the planes | 300 | |
5: Direction | "random" | number (Direction from where the planes comes from) | "random" | |
9: Artillery SFX | boolean (true will cause distant artillery sfx 5 seconds before each explosion) | false | |
10: MP | boolean (true = Center will automatically be an array of all alive non-captive playableUnits) | false |
You can make markers where units wont be spawned and which they will try to avoid during their patrolling. This can be done with normal markers (RECTANGLE & ELLIPSE). Name the first one to ACavoid and just copy & paste it, so that next ones will have names like ACavoid_1, ACavoid_2, etc, up to ACavoid_30. These can also be created on the fly, and Ambient Explosions will notice them.
Populates area with infantry units and/or vehicles and makes them patrol in defined area. Adds also possibility for infantry units to correctly close doors behind them and to use smokes when engaging battle.
How to use Militarize?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you may define parameters to customize the script.)
nul = [this] execVM "LV\militarize.sqf";
Parameter | Description | Default |
---|---|---|
1: Target | Center point (object/unit/marker/position array, note: remember to use "quotes" with marker names) | this |
2: Side | 0 / 1 / 2 / 3 (0 = civilian, 1 = blue, 2 = red, 3 = green) | 2 |
3: Radius | meters (from center point) | 150 |
4: Spawn infantry | [boolean, boolean] - spawn land units, spawn water units | [true,false] |
5: Spawn vehicles | [boolean, boolean, boolean] - spawn land vehicles, spawn water vehicles, spawn air vehicles | [true,false,false] |
6: Still | true / false (if false, units will patrol in radius, checking also buildings) | false |
7: Infantry ratio | decimal / array (amount of spawning infantry = Radius * Infantry ratio) | 0.3 |
0.2 = will spawn 50 units if radius is 250 (250 * 0.2 = 50) [10,12] = will spawn 10 units AND random 1-12 units |
||
8: Vehicle ratio | decimal / array (amount of spawning vehicles = Radius * Infantry ratio) | 0.3 |
0.1 = will spawn 25 vehicles if radius is 250 (250 * 0.1 = 25) [3,2] = will spawn 3 vehicles AND random 1-2 vehicles |
||
9: AI skills | 0-1.0 or "default" or array of individual skill values (AIs skills) | "default" |
"default" leaves AI skills to default 0.75 makes all AI skill levels to 0.75 (75%) [0.75,0.8,0.9,1,1,1,1,1,0.9,1] adjusts skill levels separately, as in: [aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed] |
||
10: Group | nil / Group name (if you want units in existing group, set it here. if nil, new group is made) | nil |
11: Custom init | If you want to add something in units init lines, add it here in "quotes". If you need to use quotes inside the init itself, use ' or "" instead of ", or use this parameter to init external script | nil |
"hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;" "nul = [] execVM 'customScript.sqf';" |
||
12: ID | number (if you want to delete units this script creates, you'll need to set a unique ID number) | nil |
13: Smokes | true / false (true will make AI to use smokes and chemlights when in action) | true |
14: Doors | true / false (true will make AI close doors behind them while patrolling in buildings) | true |
15: Classes | array (classes from config_aissp.hpp, defines which unit classnames are being used) | ["ALL"] |
To remove Militarize units, you must make sure you have set the ID parameter when initializing Militarize. When you do that, the script forms an name for the Militarize group, which is basicly LVgroup + ID you defined. After that you simply initialize the following script anywhere you want, and for its only parameter set LVgroupID where ID id the ID you defined for this particular Militarize instance.
nul = [LVgroupID] execVM "LV\LV_functions\LV_fnc_removeGroup.sqf";
Populates buildings in defined area with infantry units. You can also set units to patrol inside and outside of buildings.
How to use FillHouse?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you may define parameters to customize the script.)
nul = [this] execVM "LV\fillHouse.sqf";
Parameter | Description | Default |
---|---|---|
1: Target | Center point (if called from a Game Logic, then simply this, and if called from trigger and targeting a Game Logic, then that particular Game Logics' name) | this |
2: Side | 1 / 2 / 3 (1 = blue, 2 = red, 3 = green) | 2 |
3: Patrol | true / false (if true, units will patrol) | true |
4: Patrol type | 1 / 2 (1 = only inside building, 2 = also outside of buildings) | 2 |
5: Spawn percentage | 1-100 OR Array (on how many percentage of possible positions are soldiers spawned) | 50 |
50 = will spawn units into 50% of available building positions in defined radius [10,12] = will spawn at least 10 units + random 1-12 units |
||
6: Radius | 1 or larger number (1 = nearest building. if larger number, then all buildings in radius) | 1 |
7: AI skills | 0-1.0 or "default" or array of individual skill values (AIs skills) | "default" |
"default" leaves AI skills to default 0.75 makes all AI skill levels to 0.75 (75%) [0.75,0.8,0.9,1,1,1,1,1,0.9,1] adjusts skill levels separately, as in: [aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed] |
||
8: Group | nil / Group name (if you want units in existing group, set it here. if nil, new group is made) | nil |
9: Custom init | If you want to add something in units init lines, add it here in "quotes". If you need to use quotes inside the init itself, use ' or "" instead of ", or use this parameter to init external script | nil |
"hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;" "nul = [] execVM 'customScript.sqf';" |
||
10: ID | number (if you want to delete units this script creates, you'll need to set a unique ID number) | nil |
11: Classes | array (classes from config_aissp.hpp, defines which unit classnames are being used) | ["ALL"] |
To remove FillHouse units, you must make sure you have set the ID parameter when initializing FillHouse. When you do that, the script forms an name for the FillHouse group, which is basicly LVgroup + ID you defined. After that you simply initialize the following script anywhere you want, and for its only parameter set LVgroupID where ID id the ID you defined for this particular FillHouse instance.
nul = [LVgroupID] execVM "LV\LV_functions\LV_fnc_removeGroup.sqf";
Spawns a chopper which will transport a group of infantry to target location.
How to use ReinforcementChopper?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you may define parameters to customize the script.)
nul = [this] execVM "LV\reinforcementChopper.sqf";
Parameter | Description | Default |
---|---|---|
1: Spot | Landing spot (object/unit/marker/position array, remember to use "quotes" with marker) | this |
2: Exact | true / false (true = tries to land exactly on Spot, false = finds a nearby place where chopper fits) | true |
3: Side | 1 / 2 / 3 (1 = blue, 2 = red, 3 = green) | 1 |
4: Chopper type | number (0 = random chopper, 1 = first element from available classname class [See AI Classnames for better understanding]) | 0 |
5: Captive | true / false (if true, enemies wont notice chopper before it has landed) | false |
6: Patrol | true / false (if false, units wont patrol in any way = useful if you want to make this group to join a player by setting (group player) as Group parameter) | true |
7: Target | (patrol target which infantry goes after) | player |
unit = units name, ex: enemyunit1 marker = markers' name, ex: "marker01" (remember quotes with markers!) marker array = array of markers in desired order, ex: ["marker01","marker02","marker03"] group = groups name, ex: (group enemy1) OR BlueGroup17 group array = ex: [(group player), (group blue2)] ["PATROL",center position,radius] = uses patrol-vD.sqf, ex: ["PATROL",(getPos player),150] (units patrols in radius, also checking buildings) |
||
8: Direction | "random" or 0-360 (direction where chopper comes from, use quotes with "random"!) | "random" |
9: Distance | meters (from how far the chopper comes from) | 1500 |
10: Precise | true / false (true = heli will land even in the middle of war, false = heli might have air fights etc before landing) | true |
11: Cycle | true / false (if true and Target is an array of markers, units will cycle these markers) | false |
12: Group size | 1-8 (infantry groups' size) | 8 |
13: AI skills | 0-1.0 or "default" or array of individual skill values (AIs skills) | "default" |
"default" leaves AI skills to default 0.75 makes all AI skill levels to 0.75 (75%) [0.75,0.8,0.9,1,1,1,1,1,0.9,1] adjusts skill levels separately, as in: [aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed] |
||
14: Smoke | [LZ smoke, cover smokes, flares, chemlights] (should chopper use these on landing zone) | [false,false,false,false] |
15: Group | nil / Group name (if you want units in existing group, set it here. if nil, new group is made) | nil |
16: Custom init | If you want to add something in units init lines, add it here in "quotes". If you need to use quotes inside the init itself, use ' or "" instead of ", or use this parameter to init external script | nil |
"hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;" "nul = [] execVM 'customScript.sqf';" |
||
17: ID | number (if you want to delete units this script creates, you'll need to set a unique ID number) | nil |
18: MP | true / false (true = Landing spot will automatically be one from an array of all alive non-captive playableUnits) | false |
19: Doors | true / false (true will make AI close doors behind them if patrolling in buildings) | true |
20: Classes | array (classes from config_aissp.hpp, defines which unit classnames are being used) | ["ALL"] |
If you set Patrol to false, units will idle (if not joined to another group), and then you can extend the script and make them to do some custom stuff. (I commented the location in script, line ~347)
LV_fnc_follow.sqf has been changed a lot, and there's also things you can customize pretty easily. If you target inf group to go after another group or array of groups, there's maximum distance for them to action. (Gives more mission options for MP)
Max distance is defined in reinforcementChopper.sqf on lines ~326 and ~341 (mDis = 1000m as default), and if inf group is that far away from its target group (or target group -array), it will stay idling, and those idling positions are commented in LV_fnc_follow.sqf on lines ~73 and ~103. There you can add custom stuff.
Spawns a chopper which will deliver a paradrop group to stage.
How to use HeliParadrop?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you may define parameters to customize the script.)
nul = [this] execVM "LV\heliParadrop.sqf";
Parameter | Description | Default |
---|---|---|
1: Spot | Drop spot (object/unit/marker/position array, remember to use "quotes" with marker) | this |
2: Side | 1 / 2 / 3 (1 = blue, 2 = red, 3 = green) | 2 |
3: Allow damage | true / false (allow damage for the chopper) | true |
4: Captive | true / false (if true, enemies wont notice chopper) | false |
5: Distance | meters (from how far the chopper comes from) | 1500 |
6: Direction | "random" or 0-360 (direction where chopper comes from, use quotes with "random"!) | "random" |
7: Flyby | true / false (true = chopper just flies through target, false = stays still while dropping units) | true |
8: Flight altitude | number (how high the chopper flies) | 200 |
9: Jump distance | number (how many meters before the target location units starts jumping out from the heli) | 150 |
10: Group size | 1-8 (infantry groups' size) | 8 |
11: Jump delay | number (how many seconds is the delay between each units jump) | 0.5 |
12: Parachute altitude | number (in which altitude units will open their parachutes) | 50 |
13: Smokes | true / false (will units throw cover smokes, at around 10m height) | false |
14: Flares | true / false (will units throw flares, at around 30m height) | false |
15: Chems | true / false (will units throw chemlights, at around 30m height) | false |
16: Patrol | true / false (if false, units wont patrol in any way = useful if you want to make this group to join a player by setting (group player) as Group parameter) | true |
17: Target | (patrol target which infantry goes after) | player |
unit = units name, ex: enemyunit1 marker = markers' name, ex: "marker01" (remember quotes with markers!) marker array = array of markers in desired order, ex: ["marker01","marker02","marker03"] group = groups name, ex: (group enemy1) OR BlueGroup17 group array = ex: [(group player), (group blue2)] ["PATROL",center position,radius] = uses patrol-vD.sqf, ex: ["PATROL",(getPos player),150] (units patrols in radius, also checking buildings) |
||
18: Cycle | true / false (if true and Target is an array of markers, units will cycle these markers) | false |
19: AI skills | 0-1.0 or "default" or array of individual skill values (AIs skills) | "default" |
"default" leaves AI skills to default 0.75 makes all AI skill levels to 0.75 (75%) [0.75,0.8,0.9,1,1,1,1,1,0.9,1] adjusts skill levels separately, as in: [aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed] |
||
20: Group | nil / Group name (if you want units in existing group, set it here. if nil, new group is made) | nil |
21: Custom init | If you want to add something in units init lines, add it here in "quotes". If you need to use quotes inside the init itself, use ' or "" instead of ", or use this parameter to init external script | nil |
"hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;" "nul = [] execVM 'customScript.sqf';" |
||
22: ID | number (if you want to delete units this script creates, you'll need to set a unique ID number) | nil |
23: MP | true / false (true = Landing spot will automatically be one from an array of all alive non-captive playableUnits) | false |
24: Doors | true / false (true will make AI close doors behind them if patrolling in buildings) | false |
25: Classes | array (classes from config_aissp.hpp, defines which unit classnames are being used) | ["ALL"] |
Makes FillHouse & Militarize -units to spawn when player is near, and to despawn when player is further away.
How to use SimpleCache?This script can be initialized from any object, unit, or trigger. Default init line is:
(Between [ and ] you must define parameters for the script.)
nul = [] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";
Parameter | Description |
---|---|
1: ID's | array of FillHouse and/or Militarize script ID's (NOTE: Remember to set unique ID parameters when initializing FillHouse/Militarize) |
2: Players | array of players (doesnt matter what you set here if you use MP parameter) |
3: Distance | distance between player(s) and Militarize/FillHouse spots where units will be spawned/despawned |
4: Keep count | true / false (true = script will count & save exact AI amounts, false = AI amount will be reseted on each time units are spawned again) |
5: MP | true / false (true = all alive non-captive playableUnits will activate the script, false = only units in players-array) |
You can find _excludeSingleHeliPilot in the script file. (true = if single player flies over area as pilot, area wont trigger (reduces possible lag spikes))
Makes FillHouse & Militarize -units to spawn when player is near, and to despawn when player is further away. This V2 version also handles the actual initialization of FillHouse and Militarize. This makes it easier for you; just place Game Logics/Markers/etc to map, name them, and use SimpleCacheV2 setup tool to generate a simple script snippet that does all the work for you.
How to use SimpleCacheV2?This script can be initialized from any object, unit, or trigger. For actual missions the preferred method is to use for example init.sqf in your mission root and initialize this script there.
nul = [] execVM "LV\LV_functions\LV_fnc_simpleCacheV2.sqf";
Parameter | Description | |
---|---|---|
1: Scripts | array of FillHouse / Militarize script arrays, which consists of: | |
1: Type (number) | 1 = Militarize, 2 = FillHouse | |
2: Script params (array) | Either FillHouse or Militarize parameters, depending on which Type was defined | |
NOTE: You must set ID parameter in every instance of FillHouse / Militarize and it must be unique. | ||
2: Players | array of players (doesnt matter what you set here if you use MP parameter) | |
3: Distance | distance between player(s) and Militarize/FillHouse spots where units will be spawned/despawned | |
4: Keep count | true / false (true = script will count & save exact AI amounts, false = AI amount will be reseted on each time units are spawned again) | |
5: MP | true / false (true = all alive non-captive playableUnits will activate the script, false = only units in players-array) |
To make it look more clear, we define the first parameter, which contains the initializations for Militarize and FillHouse, separately. Its first subarray is for Militarize:
[1, [p1, 2, 150, [true, false], [true, false, false], false, [20, 20], [1, 2], "default", nil, nil, 1, true, true, ["ALL"]]],
- 1 = Militarize
- Normal parameters for Militarize
- Target location, in this case a Game Logic. When using markers, remember to use quotes with "markerName" here.
This is a simple mission script which uses many of the AISSP script files. It creates continuous "clear area" type of a missions randomly in pre-placed GameLogics/Objects, and has also functionality to create random "defend area" type of a mission after each area is cleared first. Enemies randomly gets also air and infantry reinforcements. Clear area -tasks uses Militarize and Fillhouse scripts, and additional Defend area -tasks uses EeinforcementChopper and MenGroup scripts.
Example mission is fairly simple, and the script is called from players init field. The script itself is commented pretty accurately to make it easy to use and modify, but here's also some of the most important stuff:
Activating the mission:
nul = [Radius, [Game Logics]] execVM "LV\randomSectors1.sqf";
Parameter | Description |
---|---|
1: Radius | Radius from GameLogics/Objects where enemies will patrol |
2: Game Logics | array (all GameLogics/Objects you want to use as a hostile areas / mission objective locations) |
Example:
nul = [100, [gameLogic01,gameLogic02,gameLogic03]] execVM "randomSectors1.sqf";
This mission runs as loop forever, but you can stop it from any script or trigger etc, by simply calling:
LVSspots = nil;
After this the script will end when currently activated task has been completed.
LINES 94-95: in SP use line 95, in MP line 94
//_players = playableUnits; //MP (takes automatically all playable units)
_players = [player]; //SP (fill this manually in SP)
LINE 91: this defines the delay between tasks
_sleepDelay = 5+(random 2); //random sleep time before new task
There's two radio triggers in the mission. With first one (Alpha, press 0 0 1) you can toggle statistics for this script. It shows amount of units from different scripts and average fps. Second one (Bravo, press 0 0 2) just executes "LVSspots = nil;" and makes the script end after current task.
You can also tweak a lot of settings in the actual script file, for example:
"_backupPercentage" - when hostile units is only this % alive, possible reinforcements will engage the area
"_engagePercentage" - when hostile units is only this % alive, they will attack player group
"_updateTask" - show or do not show update task -notification when reinforcements engages area
allmost all parameters for other scripts!
All available classnames are included in classes at LV\config_aissp.hpp. Scripts has Classes-parameter, which is an array of classes from this .hpp file (with exception of "ALL", which includes all default classes to the array).
By using Classes-parameter you can filter classnames, for example:
["BLU_CTRG","IND_C_F","OPF_T_F"]
See config_aissp.hpp for better understanding.
Inside of it you can also create your own custom classes. There is an empty example which you can fill with any classnames you want (even 3rd party mods). You may have as many custom classes as you wish, and you can use them the same way as default classes, via Classes-parameter.
When you save your mission in editor, it will most likely be saved into C:\Users\YOUR_NAME\Documents\Arma 3\missions\MISSION_NAME\ and in that folder you should extract LV folder.
Remember also to extract the description.ext into your mission folder, or copy it's contents into yours, if you already have one.
When scripts init line is for example: nul = [this, ...] execVM "...sqf", you usually can just paste it into Triggers' ON ACT field and replace this with the desired target objects name.
For example: add a Game Logic where ever you want this script to be located at and name it to gamelog01. Then call the script from trigger or any init line with: nul = [gamelog01, 1, 50..] execVM "...sqf";. In Militarize, FillHouse, ReinforcementChopper and HeliParadrop the first argument is always the target location/object/marker.
Custom init executes on every unit, but you can also use it to execute something only for a group leader, like this:
"if(this==(leader(group this)))then{nul = [this] execVM 'leaderScript.sqf'};"
Most likely you have forgotten to use quotes with marker name when you refer to it. If you name your marker as marker1, in scripts and calling lines you must use quotes: "marker1".
Use FillHouse & Militarize in Game Logics and give these Game Logics unique names.
If this happens, check if you have defined the target this way: (group player). If so, name the group and replace (group player) with that name you defined.
How to name a group? Set in units init field: groupName = group this;
Make sure you have ended every sentence with a semicolon, and that you have NOT used normal quotes (") inside "custom init line". Instead of "normal quotes" use 'single quotes' or ""double-double quotes"".
For example:
"hint 'this is custom init';"
If problem occurs when you try to use EventHandlers -> do NOT include any conditions inside the EventHandler. Use it to execVM your own script file which has the conditions inside it.
If you feel like you want to offer me a beer, you surely can! The easiest way is to throw a few bucks for a pint via PayPal: