Description
I didn't find ACM from editor so I decided to do something "similar" and ended up building a pack of scripts I use in my own missions. These scripts can be called from init fields, Game Logics, triggers, almost from anywhere.
Package includes extremely simple example missions. Extract them to C:\Users\YOUR_NAME\Documents\Arma 3\missions\ and open in Editor.
NOTE: If you dont care how these scripts function or dont want to explore/modify them, it's 600% easier for you if you just use AISSP CALLING LINES App to setup calling lines.
I dont want to ask for anything, but if you find this project useful and desire to show any support, you can donate what ever you wish. Every buck if highly respected, and ensures me some extra time with Arma3 (mostly becouse my wife really hates me spending time with this stuff and keeps nagging "why do you keep doing that bullshit, are you like 13 years old, you can never earn anything with that crap") ;D
Remember to include your nick to gain some credits! If you have any ideas or questions etc, my steam nick is: fdsspun
NOTE: You can also do many things via customized init commands-parameter. It runs individually for every unit, but you can still for example give global name for a group:"MYgroupName = (group this);"Or add event handler for every unit:
"this addEventHandler ['killed',{_this execVM 'SoldierDies.sqf'}];"
Features
- Main scripts:
- ambientCombat.sqf - Creates Ambient Combat
- militarize.sqf - Fills building or buildings in radius with patrolling soldiers
- fillHouse.sqf - Fills area with patrolling units
- reinforcementChopper.sqf - Spawns chopper which brings infantry group to stage
- heliParadrop.sqf - Spawns chopper which brings paradrop group to stage
- 1 mission template:
- randomSectors1.sqf - creates "clear area" type of missions randomly in pre-placed GameLogics/Objects, and has also functionality to create random "defend area" type of mission after area is cleared first (Enemies gets air- and inf-reinforcements). Clear area -tasks uses militarize and fillhouse scripts, and additional Defend area -tasks uses reinforcementChopper and menGroup scripts.
IMPORTANT:
This version requires you to include this into you description.ext:class aissp_configs { #include "LV\config_aissp.hpp" };
AmbientCombat
Creates ambient combat around defined object/unit.
Calling AmbientCombat
Syntax:
nul = [] execVM "LV\ambientCombat.sqf";
Customized:
nul = [min range, max range, min delay, max delay, groups, side ratios, center unit, vehicle chance, air vehicle chance, water units, AI skills, communication, dissapear distance, custom init, patrol type, MP, clean, classes] execVM "LV\ambientCombat.sqf";
- Parameters:
- minRange = 1-2000 (meters, minimum range from player/centerUnit for AI to spawn) DEFAULT: 450
- maxRange = 1-2400 (meters, maximum range from player/centerUnit for AI to spawn) DEFAULT: 900
- minDelay = 0-3600 (seconds, minimum spawning delay for AI) DEFAULT: 30
- maxDelay = 1-3600 (seconds, maximum spawning delay for AI) DEFAULT: 300
- groups = 1-20 (how many AI groups can be alive at the same time) DEFAULT: 6
- side ratios = array ([west ratio, east ratio, ind ratio], each ratio value is number between 0.0 - 1.0) DEFAULT: [1,1,1]
- centerUnit = unit/array of units (unit or units which are the center of all action) DEFAULT: player
- vehicle chance = 0-100 (%-chance for vehicles to spawn) DEFAULT: 40
- air vehicle chance = 0-100 (%-chance for air vehicles to spawn) DEFAULT: 20
- water units = true/false (will water units spawn?) DEFAULT: false
- AIskills = 0-1.0 or "default" (AIs skills) DEFAULT: "default"
+NOTE: AIskills can also be defined individually with syntax:
[aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed]
- communication = true/false (if true, then AI groups will communicate and informs each others about enemies, atm only BLU & OPF) DEFAULT: 0
- dissapearDistance = meters (distance from centerUnit where AI units/groups will dissapear) DEFAULT: 2500
+NOTE: Make sure this is bigger than maxRange! - custom init = "custom init lines" (if you want to add something in units init lines, add it here in "quotes". if you need to use quotes with some commands, use ' or "" instead of ") DEFAULT: nil
Examples: "hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;"
- patrol type = 1 or array (1 = doMove for each unit individually, array = waypoint for group) DEFAULT: 1
Array syntax: ["waypointBehaviour","waypointType"]
Examples: 1 old way, units moves to target location kinda like guerrilla forces ["AWARE","SAD"] units moves as military group to target location, behaviour is AWARE and WP type Search&Destroy
WaypointType options: "MOVE","DESTROY","SAD" - MP = true/false (true = 'center unit' will automatically be an array of alive non-captive playableUnits) DEFAULT: false
- clean = true/false (true = automatic cleanup for dead units) DEFAULT: true
- classes = array (classes from config_aissp.hpp, defines which unit classnames are being used) DEFAULT: ["ALL"]
Examples: player [pl1,pl2,pl3,pl4,pl5]
Examples: 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 "default" leaves AI skills to default
Fully customized example:
nul = [150,600,10,30,8,[0,1,1],player,50,10,false,[0.2,0.3,0.1,0.55,0.25,1,1,0.25,1,1],true,800,"hint format['spawning unit: %1',this];",["AWARE","SAD"],false,true,["ALL"]] execVM "LV\ambientCombat.sqf";
Avoid areas
You can also make markers where Ambient Combat should not spawn units and which they will try to avoid during their patrolling. This can be done by making markers (RECTANGLE & ELLIPSE). Name the first one as ACavoid and just copy it so that next ones will have name like ACavoid_1 etc, up to ACavoid_30. These can be created on the fly, and AC will notice them.
Removing AmbientCombat
To remove AmbientCombat properly, you must use custom handle when calling it, not nul, f.ex:
war = [this,150,600,10,30,8,player,"default",1,800,nil["AWARE","SAD"]] execVM "LV\ambientCombat.sqf";
After that you can remove AmbientCombat by using LV_fnc_removeAC.sqf easily for example from trigger.
Syntax:
nul = [handle,style,syncedUnit,range/delay,flee direction] execVM "LV\LV_functions\LV_fnc_removeAC.sqf";
- Parameters:
- handle = handle of ambientCombat, in this example: war
- style = 0 or 1 or 2 (0 = units dissapear straight away, 1 = units forfeit and dissapear after *range, 2 = units die after random *delay)
- syncedUnit = centerUnit of ambientCombat (in this example: player)
- range/delay = range in meters / max delay in secs (if used style 1, units will dissapear after moving *range from *syncedUnit) OR
(if used style 2, units will die after random *delay) - flee direction = 0-360 (direction where ai will forfeit if style 1 is used) DEFAULT: nil (=away from syncedUnit)
Example:
nul = [war,1,player,600,180] execVM "LV\LV_functions\LV_fnc_removeAC.sqf";
FillHouse
Fills single house or multiple buildings in defined range with soldiers.
Syntax:
nul = [this] execVM "LV\fillHouse.sqf";
Customized:
nul = [target, side, patrol, patrol type, spawn rate, radius, skills, group, custom init, ID, classes] execVM "LV\fillHouse.sqf";
- Parameters:
- target = center point (if called from game logic, then this, or if called from trigger and targeted to game logic, then game logics' name)
- side = 1 or 2 or 3 (1 = blue team, 2 = red team, 3 = green team) DEFAULT: 2
- patrol = true or false (if true, units will patrol) DEFAULT: true
- patrol type = 1 or 2 (1=only inside building, 2=also outside of building) DEFAULT: 2
- spawn % = 1-100 OR Array (on how many percentage of possible positions are soldiers spawned) DEFAULT: 50
+NOTE: Array - you can also use following syntax: [amount,random amount]
Examples: 50 will spawn unit into 50% of available building positions in building/area [10,12] will spawn at least 10 units + random 1-12 units
- radius = 1 or larger number (1=nearest building. if larger number, then all buildings in radius) DEFAULT: 1
- skills = 0-1.0 or "default" (AIs skills) DEFAULT: "default"
+NOTE: AIskills can also be defined individually with syntax:[aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed]
- group = group name OR nil (if you want units in existing group, set it here. if nil, new group is made) DEFAULT: nil
EXAMPLE: (group player) - custom init = "custom init lines" (if you want to add something in units init lines, add it here in "quotes". if you need to use quotes with some commands, use ' or "" instead of ") DEFAULT: nil
Examples: "hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;"
- ID = number (if you want to delete units this script creates, you'll need to set ID number) DEFAULT: nil
- classes = array (classes from config_aissp.hpp, defines which unit classnames are being used) DEFAULT: ["ALL"]
Examples: 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 "default" leaves AI skills to default
Fully customized example:
nul = [this, 1, true, 2, 15, 150, [0.7,0.6,0.8,0.35,0.5,1,1,0.6,1,1],nil,nil,6,["ALL"]] execVM "LV\fillHouse.sqf";
Removing fillHouse units
To remove fillHouse units, you must make sure you have set ID number when calling fillHouse.sqf. At this point it will just simply remove all units, I'll add some other options later on.
After that you can use LV_fnc_removeGroup.sqf.
Syntax:
nul = [LVgroup+ID] execVM "LV\LV_functions\LV_fnc_removeGroup.sqf";
- Parameters:
- LVgroup+ID = LVgroup + ID number (For example: LVgroup6) DEFAULT: nil
Example:
nul = [LVgroup6] execVM "LV\LV_functions\LV_fnc_removeGroup.sqf";NOTE: You might want to use simpleCache with this!
Militarize
Militarizes area with infantry units and/or ground vehicles.
Syntax:
nul = [this] execVM "LV\militarize.sqf";
Customized:
nul = [target, side, radius, spawn men, spawn vehicles, still, men ratio, vehicle ratio, skills, group, custom init, ID, smokes, doors, classes] execVM "LV\militarize.sqf";
- Parameters:
- target = center point (object/unit/marker/position array, remember to use "quotes" with marker)
- side = 0 or 1 or 2 or 3 (0 = civilian, 1 = blue, 2 = red, 3 = green) DEFAULT: 2
- radius = meters (from center point) DEFAULT: 150
- spawn men = [boolean, boolean] - spawn land units, spawn water units - DEFAULT: [true,false]
- spawn vehicles = [boolean, boolean, boolean] - spawn land vehicles, spawn water vehicles, spawn air vehicles - DEFAULT: [true,false,false]
- still = true or false ( if false, then units will patrol in radius, checkin also buildings) DEFAULT: false
- men ratio = decimal OR Array (amount of spawning men = radius * men ratio) DEFAULT: 0.3
+NOTE: Array - you can also use following syntax: [amount,random amount] for example:
Examples: 0.2 will spawn 50 units if radius is 250 (250 * 0.2 = 50) [10,12] will spawn at least 10 units + random 1-12 units
- vehicle ratio = decimal OR Array (amount of spawning vehicles = radius * vehicle ratio, ie: 250 * 0.1 = 25 vehicles) DEFAULT: 0.1
+NOTE: Array - you can also use following syntax: [amount,random amount] just like in men ratio - skills = 0-1.0 or "default" (AIs skills) DEFAULT: "default"
NOTE: AIskills can also be defined individually with syntax:[aimingAccuracy,aimingShake,aimingSpeed,spotDistance,spotTime,courage,commanding,general,endurance,reloadSpeed]
- group = group name OR nil (if you want units in existing group, set it here. if nil, new group is made) DEFAULT: nil
EXAMPLE: (group player) - custom init = "custom init lines" (if you want to add something in units init lines, add it here in "quotes". if you need to use quotes with some commands, use ' or "" instead of ") DEFAULT: nil
Examples: "hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;"
- ID = number (if you want to delete units this script creates, you'll need to set ID number) DEFAULT: nil
- smokes = true/false (true will make AI use smokes and chemlights when in action) DEFAULT: true
- doors = true/false (true will make AI close doors behind them while patrolling) DEFAULT: true
- classes = array (classes from config_aissp.hpp, defines which unit classnames are being used) DEFAULT: ["ALL"]
Examples: 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 "default" leaves AI skills to default
Fully customized example:
nul = [this,2,350,[true,true],[true,true,false],false,[25,25],0.1,[0.2,0.2,0.2,0.85,0.9,0.75,0.1,0.6,1,1],nil,nil,61,true,true,["ALL"]] execVM "LV\militarize.sqf";
Removing militarize units
To remove militarize units, you must make sure you have set ID number when calling militarize.sqf. At this point it will just simply remove all units, I'll add some other options later on.
After that you can use LV_fnc_removeGroup.sqf.
Syntax:
nul = [LVgroup+ID] execVM "LV\LV_functions\LV_fnc_removeGroup.sqf";
- Parameters:
- LVgroup+ID = LVgroup + ID number (For example: LVgroup6) DEFAULT: nil
Example:
nul = [LVgroup61] execVM "LV\LV_functions\LV_fnc_removeGroup.sqf";NOTE: You might want to use simpleCache with this!
ReinforcementChopper
Spawns chopper which transports infantry group to stage.
Syntax:
nul = [this] execVM "LV\reinforcementChopper.sqf";
Customized:
nul = [spot,exact,side,type,captive,patrol,target,direction,distance,precise,cycle,groupSize,skills,smoke,group,custom init,ID,MP,doors,classes] execVM "LV\reinforcementChopper.sqf";
- Parameters:
- spot = landing spot (object/unit/marker/position array, remember to use "quotes" with marker)
- exact = true or false (true = tries landing exactly on *spot, false = finds place where chopper fits) DEFAULT: true
- side = 1 or 2 or 3 (1 = west, 2 = east, 3 = independent) DEFAULT: 1
- type = number (Depends on config) DEFAULT: 0
See AI Classnames for further information!0 = random 1 = first element of available classname class
- captive = true or false (if true, enemies wont notice chopper before it has landed) DEFAULT: false
- patrol = true or false (if false, units wont patrol in any way = handy if you set (group player) as *group) DEFAULT: true
- target = (patrol target which infantry goes after) DEFAULT: player
Choises: 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)
- direction = "random" or 0-360 (direction where chopper comes from, use quotes with random!) DEFAULT: "random"
- distance = number (from how far chopper comes from) DEFAULT: 1500
- precise = true or false (true = heli will land even in middle of war, false = heli might have air fights etc before landing) DEFAULT: true
- cycle = true or false (if true and target is array of markers, unit will cycle these markers) DEFAULT: false
- groupSize = 1-8 (infantry groups' size) DEFAULT: 8
- skills = 0-1.0 or "default" (AIs skills) DEFAULT: "default"
NOTE: AIskills can also be defined individually with syntax:[aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed]
- smoke = [LZ smoke, cover smokes, flare, chemlights] (if chopper uses these on landing spot) DEFAULT: [false,false,false,false]
- group = group name OR nil (if you want units in existing group, set it here. if nil, new group is made) DEFAULT: nil
EXAMPLE: (group player) - custom init = "custom init lines" (if you want to add something in units init lines, add it here in "quotes". if you need to use quotes with some commands, use ' or "" instead of ") DEFAULT: nil
Examples: "hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;"
- ID = number (if you want to delete units this script creates, you'll need to set ID number) DEFAULT: nil
- MP = true/false (true = 'landing spot' will automatically be an array of alive non-captive playableUnits) DEFAULT: false
- doors = true/false (true will make AI close doors behind them while patrolling) DEFAULT: false
- classes = array (classes from config_aissp.hpp, defines which unit classnames are being used) DEFAULT: ["ALL"]
Examples: 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 "default" leaves AI skills to default
Fully customized example:
nul = [this,false,1,3,false,true,["marker01","marker02","marker03"],"random",1000,true,true,5,[false,true,false,true],0.85,(group player),nil,33,false,false,["ALL"]] execVM "LV\reinforcementChopper.sqf";Spawns chopper in random direction, 1000m away from game logic. It lands somewhere near game logic, uses cover smokes & chemlights, 5 infantry units joins players group, gets out and moves first to marker01, then marker02 and finally to marker03 and continues cycling them.
Additional stuff:
If you set patrol to false, units will idle (if not joined to another group), and you can extend the script and make them 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.
HeliParadrop
Spawns chopper which delivers paradrop group on stage.
Syntax:
nul = [this] execVM "LV\heliParadrop.sqf";
Customized:
nul = [spot, side, allowDamage, captive, distance, direction, flyby, fly height, jump distance, group size, jump delay, open height, smokes, flares, chems, patrol, target, cycle, skills, group, custom init, ID, MP, doors, classes] execVM "LV\heliParadrop.sqf";
- Parameters:
- spot = drop spot (object/unit/marker/position array, remember to use "quotes" with marker)
- side = 1 or 2 or 3 (1 = west, 2 = east, 3 = independent) DEFAULT: 2
- allowDamage = true/false (allow or disallow damage for chopper) DEFAULT: true
- captive = true/false (if true, enemies wont notice chopper) DEFAULT: false
- distance = number (from how far chopper comes from) DEFAULT: 1500
- direction = "random" or 0-360 (direction where chopper comes from, use quotes with random!) DEFAULT: "random"
- flyby = true/false (true = chopper just flies thru target, false = stays still while dropping units) DEFAULT: true
- fly height = number (how high chopper flies) DEFAULT: 200
- jump distance = number (how many meters before target location units starts jumping out of heli) DEFAULT: 150
- group size = number (how many units is in para drop group) DEFAULT: 8
- jump delay = number (how many seconds is the delay between jumps) DEFAULT: 0.5
- open height = number (in which height units opens their parachutes) DEFAULT: 50
- smokes = true/false (will units throw cover smokes (on 10m height)) DEFAULT: false
- flares = true/false (will units throw flares (on 30m height)) DEFAULT: false
- chems = true/false (will units throw chemlights (on 30m height)) DEFAULT: false
- patrol = true or false (if false, units wont patrol in any way = handy if you set (group player) as *group) DEFAULT: true
- target = (patrol target which infantry goes after) DEFAULT: player
Choises: 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)
- cycle = true or false (if true and target is array of markers, unit will cycle these markers) DEFAULT: false
- skills = 0-1.0 or "default" (AIs skills) DEFAULT: "default"
NOTE: AIskills can also be defined individually with syntax:[aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, endurance, reloadSpeed]
- group = group name OR nil (if you want units in existing group, set it here. if nil, new group is made) DEFAULT: nil
EXAMPLE: (group player) - custom init = "custom init lines" (if you want to add something in units init lines, add it here in "quotes". if you need to use quotes with some commands, use ' or "" instead of ") DEFAULT: nil
Examples: "hint format['this is custom init from unit %1',this];" "hint 'Spawning!'; this setCaptive true;"
- ID = number (if you want to delete units this script creates, you'll need to set ID number) DEFAULT: nil
- MP = true/false (true = 'landing spot' will automatically be an array of alive non-captive playableUnits) DEFAULT: false
- doors = true/false (true will make AI close doors behind them while patrolling) DEFAULT: false
- classes = array (classes from config_aissp.hpp, defines which unit classnames are being used) DEFAULT: ["ALL"]
Examples: 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 "default" leaves AI skills to default
Fully customized example:
nul = [player, 2, false, true, 1000, "random", true, 500, 200, 6, 1, 50, true, false, true, true, player, false, 0.75, nil, nil, 1, false, false, ["ALL"]] execVM "LV\heliParadrop.sqf";
simpleCache (for fillHouse & militarize)
Makes fillHouse and militarize -units spawn when player is near, and despawn when player is further.
Syntax:
nul = [[ID's],[players],distance,keep count,MP] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";
- Parameters:
- ID's = array of script ID's
- players = array of players (doesnt matter what you set here if you use MP mode)
- distance = distance between player(s) and militarize/fillHouse on where scripts will be activated
- keep count = true/false (true = script will count & save AI amounts, false = AI amount will be reseted on each time it activates again)
- MP = true/false (true = all alive non-captive playableUnits will activate scripts, false = only units in players-array)
Fully customized example:
nul = [[13,14],[playerUnit1],500,true,false] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";
Extra options:
You can find _excludeSingleHeliPilot in the script file. (true = if single player flies over area as pilot, area wont trigger (reduces lag))
Mission Templates
Misc scripts & mission templates which uses my other scripts.
randomSectors1.sqf
This is mission script which uses many of my other script files. It creates "clear area" type of missions randomly in pre-placed GameLogics/Objects, and has also functionality to create random "defend area" type of mission after area is cleared first (Enemies gets air- and inf-reinforcements). Clear area -tasks uses militarize and fillhouse scripts, and additional Defend area -tasks uses reinforcementChopper and menGroup scripts.
Example mission is very simple, this script is called from players init. I commented script file pretty accurately to make it easy to use and modify, but here's also some most important stuff to notice:
# Syntax:
nul = [radius, [game logics]] execVM "randomSectors1.sqf";
- radius = radius from GameLogics/Objects inside where enemies patrols
- [game logics] = put all GameLogics/Objects you want to use as hostile areas in this array
Example:
nul = [100, [gameLogic01,gameLogic02,gameLogic03]] execVM "randomSectors1.sqf";
# Other information:
This mission runs as loop forever, but you can stop it with (from script or trigger or anywhere):
LVSspots = nil;
After this the script ends 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 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 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!
AI Classnames
I included all classnames 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. I included an empty example that you can fill with any classnames you want. You may have as many custom classes as you wish, and you can use them the same way as default classes, via classes-parameter.
FAQ
Q: Where to put script files?
When you save your mission in editor, it will be saved to C:\Users\YOUR_NAME\Documents\Arma 3\missions\MISSION_NAME\ and into that folder you should put LV folder.
Remember to include my class into missions description.ext!
Q: How to add script in Trigger?
If script's calling line goes like: nul = [this,1,50..] execVM... then usually you can just put the same line into Triggers' ON ACT -field and replace this with target objects name.
Add for example Game Logic there where you want this script to be located and name it gamelog01, and then call the script from trigger: nul = [gamelog01,1,50..] execVM.... In militarize, fillHouse and reinforcementChopper the first argument is target location/object/marker.
Q: How to execute a script only for group leader?
Custom init executes on every unit, but you can also use it to execute something only for leader, like this:
"if(this==(leader(group this)))then{nul = [this] execVM 'leaderScript.sqf'};"
Q: I'm getting error when I use markers, what to do?
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".
Q: Getting errors when using simpleCache?
Use fillHouse & militarize in gamelogics, and name the gamelogics.
Q: Getting error when targeting inf group to hunt player group?
If this happens, check if you have set the target like: (group player). If so, name the group and replace (group player) with that name.
How to name it? Set in unit's init: groupName = group this;
Q: CustomInit wont work! What to do?
Make sure you have ended every sentence to semicolon, and you have NOT used normal quotes (") inside "custom init line". Instead of " use ' or "".
For example: "hint 'this is custom init';"
If problem occurs when you try to use EventHandler -> do NOT include any conditions inside EventHandler. Use it to execVM your own script file which has the conditions inside it.
Changelog
- 1.0 (19.3.17):
- So many changes and improvements that I can't even list them up for you!
- Special thanks to Haz for pushing me into using .hpp's!
- 0.90 (22.9.13):
- File structure changed! Same as before, but EVERYTHING is finally inside LV-folder.
- Included AISSP CALLING LINES App
- Updated all classnames
- LV_fnc_nearestBuilding - building reference changed from "house" to "building" - should find more buildings now
- Militarize: spawn men -parameter is now [boolean, boolean] - spawn land units, spawn water units - default: [true,false]
- Militarize: spawn vehicles -parameter is now [boolean, boolean, boolean] - spawn land vehicles, spawn water vehicles, spawn air vehicles - default: [true,false,false]
- FillHouse is fixed and works at Altis (removed nearestBuilding from its patrols)
- AmbientCombat: You can now define areas where AC groups wont spawn and which they try to avoid during patrolling.
This can be done by making markers (RECTANGLE & ELLIPSE). Name the first one as ACavoid and just copy it so that next ones will have name like ACavoid_1 etc, up to ACavoid_30. These can be created on the fly, and AC will notice them. - Fixed vehicle positioning bug in LV_fnc_fullLandVehicle.sqf
- Many minor fixes like isServer -check in removeAC, expanded nearestBuilding to work better, removeDead removes empty groups, etc..
- 0.80 (4.8.13):
- Added new main script: heliParadrop.sqf which creates AI paradrops with many features
- Added caching script for fillHouse and militarize
- New parameters in AmbientCombat: side ratio, mp
- Changed main functionality in AmbientCombat, includes now water units and is really MP compatible
- Militarize units can now close doors and use smokes & chemlights (can be disabled in militarize.sqf)
- CloseDoors script is binded to patrol-vD, so it can be used also within chopper scripts
- Militarize "center" is movable
- ReinforcementChopper can now use LZ smoke, cover smokes, flare and chemlights
- HeliParadrop & ReinforcementChopper has also MP parameter
- Replaced all nearestBuilding commands with custom function
- Many smaller changes and fixes +new files in LV_functions\
- 0.50 (25.6.13):
- ARMA 3 Beta compatibility
- Fixed ambientCombat example mission (waypointType was set to RED insted of SAD)
- Added beta units in all scripts, subdividing normal & recon groups (support units will mix randomly to both)
- Changed fillHouse parameter "side": 1 or 2 or 3 (1 = blue team, 2 = red team, 3 = green team)
- Changed militarize parameter "side": 0 or 1 or 2 or 3 (0 = civilians, 1 = blue team, 2 = red team, 3 = green team)
- Changed reinforcementChopper parameter "side": 1 or 2 or 3 (1 = blue team, 2 = red team, 3 = green team)
- Changed reinforcementChopper parameter "type":
If "side" = 1: 1 = B_Heli_Light_01_armed_F, 2 = B_Heli_Light_01_F, 3 = B_Heli_Transport_01_F
If "side" = 2: 1 = O_Heli_Attack_02_F, 2 = O_Heli_Attack_02_black_F, 3 = O_Heli_Light_02_F, 4 = O_Heli_Light_02_unarmed_F
If "side" = 3: 1 = I_Heli_Transport_02_F
- 0.42 (5.6.13):
- added snipers and spotters in every script
- fixed bug in reinforcementChopper.sqf -> chopper stayed hovering in some locations
- added ID parameter to reinforcementChopper.sqf
- changed AI behaviour of infantry group in reinforcementChopper.sqf to "COMBAT" to gain some realism
- fillHouse.sqf can now be targeted to a marker
- fixed patrol-vD which had bad typo, it shouldnt give any errors anymore
- LV_fnc_menGroup.sqf has now also ID parameter, and group size can be set with syntax [amount,random amount]
- LV_fnc_randomSpot.sqf has now minimum distance and avoid array -parameters. syntax: [center pos,range,min distance,[avoid array]]
- fixed LV_fnc_vehicleInit -> you can now set eventhandlers to init of units (before this the script considered "_this" as "this" and therefore failed to pass information
- added first mission/task template: randomSectors1.sqf
- 0.40 (10.5.13):
- fixed parameters - you dont need anymore to use all parameters
- replaced surfaceIsWater -loops with faster ones
- renamed reinforcementKA60.sqf as reinforcementChopper.sqf
- new parameter: type - you can now select any of the choppers in game (AH9 can also have 1 passenger)
- new parameter: captive - whole group is captive until chopper has landed (makes sure it wont get shot down "too early")
- new parameter: patrol - you can no disable infantrys patrol (handy if you want to join group to some other group)
+commented place in script where you can easily write custom script to replace patrolling - landing spot can now be: object/unit, marker, or position array
- patrol target can now be: unit/object, marker, array of markers, group, array of groups, or it can be directed to patrol-vD.sqf
+new LV_fnc_follow.sqf, which has maximum patrol distance in cases of group/array of groups ("mDis0" in reinforcementChopper.sqf).
++there's commented places where max patrol distance fills up, so you can extend the script easily in those cases.
- fixed fillHouse error - when found only buildings which has no building positions
- new parameter in ambientCombat: patrol type - you can use the old method where units moves independently (doMove) to their target location,
or you can make them use waypoints as group and define waypointType & waypointBehaviour. - militarize.sqf: target -parameter can now be: unit/object, marker, or position array
- little fixes & cleanups
- 0.36 (29.4.13):
- replaced setVehicleInit commands with execVM and LV_fnc_vehicleInit.sqf
- 0.35 (21.4.13):
- added LV_fnc_removeGroup.sqf, which is used to remove units created via fillHouse or militarize
- all main scripts:
-skills parameter can now be set to "default" when it wont touch the ai skills at all
-custom init parameter, now you can add init commands to units - fillHouse & militarize & reinforcementKA60:
-parameter to define existing group instead of creating new one (so people can target other scripts and stuff to that group) - fillHouse & militarize:
-unit amounts can now be set also with syntax: [amount,random amount] ( [10,5] = 10+random 5 )
-you can define ID for these now, and delete units by referring to that ID via LV_fnc_removeGroup.sqf - militarize & reinforcementKA60:
-these can now be targeted also to a marker, as long as you remember to use "quotes" with markers - ambientCombat:
-choppers spawn in air now to prevent the ai heli bug in recent A3
-parameter to define direction where ambient will flee when terminated with style 1 in LV_fnc_removeAC.sqf
-removed useless parameter 0 - militarize:
-ground vehicles behaviour set to "SAFE" to make them drive better - reinforcementKA60:
exits script if driver or chopper is shot down - all patrol scripts:
-if unit < 2m from its waypoint, new location is added (prevents the bug where unit walks small circle around wp)
- 0.32 (12.4.13):
- MP fix in militarize.sqf, fillHouse.sqf and reinforcementKA60.sqf
- added "exact" parameter into reinforcementKA60.sqf, which (when set to false) fixes the bug when KA60s stays hovering near landing spot if there's more than one chopper around
- updated LV_fnc_follow.sqf: now if units are targeted to another unit, in friendly-friendly case they will patrol around target unit, and in hostile case they will go straight to target units' position
- added LV_fnc_randomSpot.sqf, which is now required by reinforcementKA60.sqf
- 0.30 (7.4.13):
- new main script; reinforcementKA60.sqf
- added function to remove ambientCombat
- added better patrol function for ambientCombat
- lots of bug fixes, optimizations and lag reduced
- added new parameters to every main script
- 0.23 (30.3.13):
- fixed stuck loop in militarize.sqf
- fine tuning of patrol scripts
Thanks
zuff
kemor
ChrzRw79
Dirty Haz
O.K
vip3r75
JojoTheSlayer
Gambit
FocalFury
mikey74
tomturner
MeatballCB
FX2K
F2kSel
DaSkunk
psvialli
[GITS]
[1PARA]
Buster0083
Guts4401
[2RIMa]Xunga
Gary
Chris
Francois
Daniel
And everyone else who has supported and given feedback!