Jump to content
Sign in to follow this  
Nephris1

AI reacting on flare

Recommended Posts

Probably not a good idea, at least at this stage :) This is just for experimenting and having some fun. There is nothing optimized about this system:

1) Script runs for every unit - bad. Should be a master script controlling it all at long intervals.

2). Every unit starts by sorting all units into friendly and enemy. Hardly a good way to do it :) A global resort should be done at given intervals, and each unit (or group rather) have a list of units in their vicinity to be updated.

But, feel free to experiment :)

Share this post


Link to post
Share on other sites

I am sorry, but I cant get the "new" to work...

They are not getting any ammo, and they are not shooting flares at all.

Do you have a sample mission on your new last posted script?

Share this post


Link to post
Share on other sites

No, sorry. With sounds and musics it's too big (about 20MB), it's still personal WIP, and it contains far too many bugs to be shared at this moment - probably ever.

It won't work "as is" because Equip.sqf is incomplete. I just show how to assign stuff to "_unit", but you'll have to create the setup that suits you. All my west units are now "named" and grouped properly, and equipped based on that, so it won't work for anyone else. See the original equip.sqf for pointers how to set it up.

Share this post


Link to post
Share on other sites

If I am use your "old" codes, how do I make AI to dont shoot up so many flares at the same time, what part of code do I change. Please show me =)

Share this post


Link to post
Share on other sites

I don't know. The "old" codes came from a Arma1 mission where the fight was based on one place at a time, hence the trigger usage. But, it's not that hard to use the new stuff. I'll simplify it a bit.

Use allUnits instead for EH and setVariable, script used will already exit if if wasn't a flare:

{_x addEventHandler ["fired", {_this execVM "scripts\EH-Fired.sqf"}]; _x setVariable ["flarefired", false]} forEach allUnits;

Now, the only thing you need to do is give the grenadiers (or anyone with a GL equipped weapon), some flares. You could even here do a forEach allUnits loop and check if the unit has a GL weapon, then check how many slots he has left for flare ammo, and add the flare ammo. Or skip the last check and allow overfilling, but might turn ugly.

But, I can't do this last step myself since everything for me is customized, and units get assigned flares based on their class and squad type they're assigned to.

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  

×