AI Spawn Script PackbyspunFIN 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. Package includes instructions and example missions for everything. Features: At the moment this pack contains 5 main scripts:
1 mission template:
Installation: See the included documentations. Usage: Package includes instructions and example missions for everything. Documentation also online here: HERE. Here is a Flash App which makes it whole lot easier for normal users to set up all calling lines! Note: If you dont use all parameters while calling script, extra errors will appear in .rpt. To avoid this, set all parameters you dont need to their default values. Media: Sloppy video of v0.19: Notes: Version 0.90 notes: Includes now also Flash App which makes it whole lot easier for normal users to set up all calling lines! Version 0.80 notes: I left randomSector1 out of the 0.80 version since it needs some redesign to fit with the recent scripts & to get the tasks functional in mp. However, you can still use it with the 0.50 files which can be found here: AI Spawn Script Pack 0.50. - New parameters, so double check your calling lines! Credits & Thanks: zuff kemor ChrzRw79 Dirty Harry O.K vip3r75 JojoTheSlayer Gambit FocalFury Changelog: v1.0 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! v0.90 - 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. v0.80 - 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\ v0.50 - 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 v0.42 - 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 v0.40 - fixed parameters - you dont need anymore to use all parameters - replaced surfaceIsWater -loops with faster ones - renamed reinforcementKA60.sqf as reinforcementChopper.sqf
- 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. - 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 v0.36 - replaced setVehicleInit commands with execVM and LV_fnc_vehicleInit.sqf v0.35 added LV_fnc_removeGroup.sqf, which is used to remove units created via fillHouse or militarize all main scripts:
-custom init parameter, now you can add init commands to units
you can define ID for these now, and delete units by referring to that ID via LV_fnc_removeGroup.sqf
- parameter to define direction where ambient will flee when terminated with style 1 in LV_fnc_removeAC.sqf - removed useless parameter 0
v0.32 - 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 v0.30 - new main script; reinforcementKA60.sqf - added function to remove ambientCombat properly - added better patrol function for ambientCombat - lots of bug fixes, optimizations and lag reduced - added new parameters to every main script v0.23 - fixed stuck loop in militarize.sqf and adjusted patrol scripts Forum topic: - BI forums - Armaholic forums Enable javascript to be able to download from Armaholic please! |
this is GREAT! works like a dream but 1 bump.
The " spawned" men wont die. they cant die
Thanks for the feedback! Hmm, I'll check that problem later today, they should be able to die after 14secs of spawning (if you're talking about militarize.sqf) but if not, I'll fix it in couple of hours o/
how can i trigger this to save CPU power?
You can add to trigger's ON ACT -field for example: war = [this] execVM "ambientCombat.sqf"; and then it will start when trigger meets its conditions. This way if you use variable (like 'war' here) instead of nul, you can shut down the script with another trigger by typing to its ON ACT -fiel: terminate war; Remember you need to group triggers to player, not synchronize.
Forget that last comment, since recent version has external function for terminating ambientCombat properly.
Excellent scripts! I'm very excited to see how I can use these in my missions.
Nice.
Already made a mission with this.
http://www.armaholic.com/page.php?id=20590
-----------------------
Constructive criticism:
-----------------------
1.
The minor things I had issues with was that, as a none coder, I had a slight issue understanding the [10, 10] in spawn %.
The readme should have a practical example with that as well as the stock one. It was only later I saw that the other options. Ending with ID where after the [] AI skills... Was a little confusing.
A section with a bunch of copy paste stuff would also be nice. Like. This gives 10 AI, 5 random medium skill etc. Not overkill, but enough for new guys like me to connect the dots on why X is not Y.
2.
The practical issue I had with using one of the scrips was using indoor stationary AI. They some times tended to be placed watching a wall like a retard. If its possible to make them default to "scan horizon", watch the door in the room or a option between the two. That would make more sense, I think.
Otherwise I had allot of fun with the scripts.
JojoTheSlayer, thanks for feedback! Good ideas indeed, I'll promise to put some effort to the documentation in future and see what I can do with those retarted indoor AI's ;)
Thanks for the script~

This will save many usage of size to create a mission .
And the "ambient combat" will bring the mission into a sense of battlefield !!!
Anyway , thanks for making this script .
I am having an issue with the militarize.sqf script. I am using it to spawn a group of civilians, and then running a suicide bomber script which selects a random civ and "should" send them running to their target.
In the script, I am using:
_unit SetSpeedMode "Full";
_unit SetBehaviour "Careless";
but the civilian is still walking towards their target. I can't for the life of me get them to run towards me. If I manually place the civilians and get them to patrol using waypoints or some other method, they seem to run just fine. Any ideas?
Solved!!
I had to use "[_unit] join grpNull;" to make the unit leave his group, then used "_unit forcespeed 4;" and all works great now!
Is there a way to use the units spawned with militarize.sqf with UPSMON without using the custom init parameter? Doing it this way assigns the UPSMON script to each unit individually which makes them not patrol as a group.
UPSMON can take a group leader as a parameter which i was i need to use. I have been trying to figure out how to either get, or assign a group leader the group spawned with militarize.sqf. Is it possible to do this?
Simple solution found was to add
_group = createGroup WEST;
then call militarize using _group as the group parameter. I found i had to add a "sleep" after the call, then use "leader _group" in my call to UPSMON. Without the sleep it was not working.
Cheers for the great scripts!
moved to forum. sorry :D
just a small note am using the fill house and militarize scripts for my mission at the min I realized u put a min and max distance for the ambient combat script to activate but why on earth would u leave these settings out of the militalrize and fillhouse scripts, maybe ther maybe more than wat meets the eye as am very new to mission making, u see wat am trying to do is have ur scripts activate wen say someone from west side is 1000 meters away, cos if u have multiple locations with these scrips running the server lags big time as ther r too many units, so the plan would be the map is empty but if ur say 1000 meters from girna the script will activate and spawn the units. anybody who can help me please email me I have all my mission planned out but just need a way to activate ur scripts with distance, and please dnt say triggers cos they nt work tried for days with triggers
Total comments : 26, displayed on page: 15