Jump to content
3l0ckad3

Looping an action through a trigger ?

Recommended Posts

I've been trying to figure this out, and I'm aware this might not be the best way to negotiate this, but while a heli is in the list of a trigger, I want him to fire off flares, the situation will be dynamic, so sometimes there could be a threat, and sometimes it is just to be on the safe side, and, well, emersion for landing in a potential killzone. This is also a learning experience for me. I'm normally okay reading script, but I struggle to write it sometimes, however, to the point(s) of interest.

1) Can you use while commands in a trigger to negotiate its condition like while alive, or while in this list, execute the script in the act:. ??

 so while heli alive
or
while heli in thisList

execute:

heli action ["useWeapon",heli,driver heli,1];

and it needs to have a sleep of about 3 between bursts, and the asset is B_Heli_Transport_01_F.

2) Would it be best to run it from an sqf ? or in game ? this script could be played on both MP or SP ?

3) and may I ask what [] or {} means ?

I normally don't ask for the negotiation outright, I like to learn, but, this is something I've never really grasped, and something to play around with would be a great place to start.
I've always wanted to learn how to loop triggers to fire syntax multiple times, I could just never make sense of how to go about it.

This is something to help the community as well, because a lot of people are always asking how to land aircraft under fire while returning fire, I got it all sorted out, I'm just stuck on this atm, and once I iron this out, I'm going to run it in an sqf pending advice. 
thnx for any help, you guys have been good to me over the years

Cheers
Q

 

Share this post


Link to post
Share on other sites

1. yes in activation and deactivation fields you are able to use code. If this is more than one line then a script execution would be the cleaner way.

    When using loops or suspension like sleep then you have to care bout that it is executed in scheduled environment

2. I generally prefer execution in a sqf file because for readability and the possibility to precompile the code. MP/SP depends on your code. just write it and we ll see how to get it work in MP.

3. Described here.

 

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

×