Jump to content
Sign in to follow this  
Frascione

Spawning and Despawning AI (using AI Spawn Script Pack)

Recommended Posts

Hi, im trying to make a mp mission and im using the "AI Spawn Script Pack" to fill all bases of stratis. Since i dont wanna any lag related problem i using triggers to spawn and despawn at certain range. This is how the triggers looks like:

spawn trigger: linked to group leader and activates on "Any Group member" present radius x

despawn trigger: linked to group leader and activates on "Whole group" not present radius x+1

when im on the game it only works if team leader is chosen...

If i group the trigger with every playable unit i think it'll spawn 10 (since i have 9 playable + 1 player) times the amount of AI i wanna... anyone can help me?

Obs.: i don't know how to make scripts i just downloaded and installed it...

Share this post


Link to post
Share on other sites

Check out my EOS script. Does exactly what you are trying to do.

Also has some detailed instructions.

Share this post


Link to post
Share on other sites

Yeah i already tried yours but it was no good for the patrols i wanted wandering through the map... any idea on how to use yours to patrol or to make the one im using work with everyone?

Share this post


Link to post
Share on other sites

If you name the player units you could use something like this in trigger condition:

({_x in thisList} count [(vehicle playerunit1),(vehicle playerunit2),(vehicle playerunit3)]) > 0;

And the same way for the trigger that removes units:

({_x in thisList} count [(vehicle playerunit1),(vehicle playerunit2),(vehicle playerunit3)]) == 0;

Easier way is also coming soon. o/

Share this post


Link to post
Share on other sites

Managed to make it work by ungrouping the trigger and making it activates on Faction present and not present... but know i have the problem that if i already killed everyone in a determined base they ll respawn if i go to that area again...

If you name the player units you could use something like this in trigger condition:

({_x in thisList} count [(vehicle playerunit1),(vehicle playerunit2),(vehicle playerunit3)]) > 0;

And the same way for the trigger that removes units:

({_x in thisList} count [(vehicle playerunit1),(vehicle playerunit2),(vehicle playerunit3)]) == 0;

Easier way is also coming soon. o/

are you going to add those features in your script? O.o do u have any idea when u ll finish if so?^^ and if not what did u meant by that? =p

Share this post


Link to post
Share on other sites

I made a simple "cache" script for militarize & fillhouse, here's all updated files within an simple example mission: http://lostvar.com/arma3/cache.Stratis.rar

This will spawn AI when any player is in defined range, and despawn when there's no players in range. It also keeps track of alive AI in every fillHouse & militarize.

So place your fillhouse & militarize scripts the same way as before, but set individual ID for each. Also name the objects where you call fillhouse and militarize from.

Then call LV_fnc_simpleCache.sqf with this syntax:

nul = [[iD's],[players],distance] execVM "LV_functions\LV_fnc_simpleCache.sqf";

* ID's = ID's which you defined in all fillhouse & militarize script calls

* players = player units

* distance = distance between players and script target locations where scripts will spawn and despawn units

Example:

nul = [[1,2,3,4,15,16,17],[playerUnit1,playerUnit2],300] execVM "LV_functions\LV_fnc_simpleCache.sqf";

For mp you could also try:

nul = [[1,2,3,4,15,16,17],playableUnits,300] execVM "LV_functions\LV_fnc_simpleCache.sqf";

Known issues:

This first version does not count vehicles, it's only ment for infantry. But will be implemented soon!

Share this post


Link to post
Share on other sites

Mate again another great script to add to your pack ! Any change you can add an option to stop fly over spawn ?? that way pilots do not set them off all the time :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×