Paco Posted June 19, 2011 Posted June 19, 2011 Can someone explain to me what flags do? I've been trying and can't figure it out. Thanks in advance. /r, Paco
EtherealN Posted June 19, 2011 Posted June 19, 2011 In geek-speak: they're a boolean variable. That means they are a condition that can have one of two values: true or false. (1 or 0) In mission design, you use them to pass conditions between triggers. So let's say you want to cause a specific thing to happen depending on player action: does he ingress from the north, or from the south? You then set up two trigger zones for those areas, and a trigger for each. Trigger A: Condition: Player in Zone (ZoneA) Condition: Flag1 is false Action: Set Flag1 true Action: Set Flag2 true Trigger B: Condition: Player in Zone (ZoneB) Condition: Flag1 is false Action: Set Flag1 true Action: Set Flag3 true Trigger C: Condition: Flag2 is true Action: Activate GroupA Trigger D: Condition: Flag3 is true Action: Activate GroupB What we have now achieved is that depending on what the player did, different groups of AI units will be activated. There is also an additional check (Flag1) that ensures you cannot activate both flags. If the player first activated the first one, Flag1 would be set to true and thus it would be impossible to set off Trigger B. Trigger C and D do the "dirty work" - they are "triggered" by the flags themselves, so you have effectively passed on the information from one trigger to another. Note also that you have an OR operand available to you, so you could have a third activation trigger like so: Trigger E: Condition: Flag2 is true OR Condition: Flag3 is true Action: Activate GroupC Adding this means that we have a third group that will activate whichever one of those previous triggers were triggered by the player. This scenario could for example have GroupC be a central asset, and the first two groups could be some SHORAD assets that are set to intercept the player based on his ingress route ("faking" some strategic response on behalf of an AI "commander"). [sIGPIC][/sIGPIC] Daniel "EtherealN" Agorander | Даниэль "эфирныйн" Агорандер Intel i7 2600K @ 4.4GHz, ASUS Sabertooth P67, 8GB Corsair Vengeance @ 1600MHz, ASUS GTX 560Ti DirectCU II 1GB, Samsung 830series 512GB SSD, Corsair AX850w, two BENQ screens and TM HOTAS Warthog DCS: A-10C Warthog FAQ | DCS: P-51D FAQ | Remember to read the Forum Rules | | | Life of a Game Tester
MadTommy Posted June 19, 2011 Posted June 19, 2011 Asked the same question some time ago.. some of the answers may well help you too. http://forums.eagle.ru/showthread.php?t=34713 i5-3570K @ 4.5 Ghz, Asus P8Z77-V, 8 GB DDR3, 1.5GB GTX 480 (EVGA, superclocked), SSD, 2 x 1680x1050, x-fi extreme music. TM Warthog, Saitek combat pro pedals, TrackIR 4
Paco Posted June 19, 2011 Author Posted June 19, 2011 Thanks for taking the time to present a great explanation! Appreciate it. /r, Paco
jeffyd123 Posted June 20, 2011 Posted June 20, 2011 friggin etheral... Ive been having a lot problems with a trigger-infested mission Ive been working on and your advice really helped (I didnt have the "trigger is false" in my actions. You rock man!:worthy::worthy::worthy::worthy::worthy::worthy::worthy::worthy::worthy::worthy: i7 8700K @ 4.4Ghz, 16G 3200 RAM, Nvidia 1080Ti, T16000 HOTAS, TIR5, 75" DLP Monitor
automag928 Posted June 23, 2011 Posted June 23, 2011 EtherealN - awesome description - I could never fully grasp flags, but your post made it very easy to see!!!
WildFire Posted July 8, 2011 Posted July 8, 2011 Flags are also used for AI units. You can use them to trigger certain events. If you set a tanker on orbit and give him an end condition, click the "is user" and put in a number, whenever that number(it is really a flag) becomes true, the end condition is triggered and it'll stop orbiting. A lot of the tasks you can assign to AI can be stop/start conditioned in this manner. And being able to couple AI tasking with flags that can be set using triggers there are a lot of possibilities. Once I learned how triggers worked I was happy as a tornado in a trailer park...
Recommended Posts