|
|
|
#3610212 - 07/20/12 12:58 AM
DCS Mission Building Discussion - Flags, Group & Unit Names
|
Smooth Operator
Senior Member
Registered: 03/04/07
Posts: 3171
Loc: Colorado
|
--- edited 29-Jul-2012 for Client flags ---
Hi folks,
(written around DCS A-10C v1.1.1.1)
When I started building missions in A-10C my first questions were about flags - what flag numbers are valid, how they reacted to On vs Off vs Increment, stuff like that.
Over the course of building missions I have developed a scheme of Group and Unit names that support flags, such that now I can recognize a flag for what it signals, such as: A flag represents red group number 22 is dead Or, blue group 49 is dead Or, blue group 34 is broadcasting a message for some condition Or, blue group 49 unit 7 is in delay
Or - a Zone is affected.
And - overall Blue vs. Red status such as Won vs. Lost vs. Time Out.
---
What developed over the course of my mission building was the Group and Unit naming.
Flags look to be limited to 99999. Try to enter a flag number greater than that and it will go back to something like 10000. Flags cannot use leading zeroes.
---
Use flags of five digits for *AI* Groups and Units. Red flags start with 2-4 (so far I've just used '1') Blue flags start with 6-8 (so far I've just used '3')
Group numbers are always two digits and occupy the second and third positions of the flags.
Unit numbers are 1-9 in the fourth position of a flag, where 0 represents the whole group. Flag max of 99999 limits this scheme to 9 Units that you can identify this way, but so far that has worked.
I name my groups into two armies - the Blue Liberation Front (BLF) and the Red Democratic Republic (RDR).
---
For AI, in general: Red flags get a leading '1' through '4' Blue flags get a leading '5' through '8' (I'm defining this as I write it out; my previous missions don't adhere. The goal here is to have a flag scheme such that any flag can be recognized without having to write all of them down.)
Flags leading digit: Red Main & Aircraft Groups: 1 Red Helicopter Groups: 2 Red Vehicle Groups: 3 (includes structures in v1.1.1.1) Red Ship Groups: 4
Blue Main & Aircraft Groups: 5 Blue Helicopter Groups: 6 Blue Vehicle Groups: 7 Blue Ship Groups: 8
All AI groups are named, like: BLF AGrp 01 (and may have further description such as -) BLF AGrp 02 F/A-18C SEAD (Group Flag is 5020_, Alive is 50202, Dead is 50201) BLF AGrp 03 B-1B Buckshot 1 BLF AGrp 04 B-1B Buckshot 2 (more about big bombers later - they are limited to 1 per group) BLF HGrp 01 Cobras BLF SGrp 01 Carrier BLF SGrp 02 Civ Boat BLF VGrp 01 Kutaisi Defense RDR AGrp 01 Mig-29 RDR HGrp 01 Ka-50 (Group Flag is 2010_, Alive is 20102, Dead is 20101) RDR SGrp 01 Carrier RDR SGrp 02 Cruiser RDR VGrp 01 Gen Vaz HQ RDR VGrp 02 Gen Vaz HQ ADA
---
Clients are defined differently, because a Client can only be a single unit in a group.
Clients should be numbered in the mission's lobby The Client's lobby number should be its in-sim a/c number (BORT #, etc.) A Client is the only unit of its group Clients can be Aircraft or Helicopter
Use four digit Client flags to prevent interference with AI flags. Only four digits are needed since Clients cannot have multiple units. The first three digits of a Client flag are used like AI flags.
BLF A-10C 01 Kutaisi Warm (start) BLF A-10C 02 Kutaisi Warm BLF A-10C 03 Kutaisi Cold BLF A-10C 04 Kutaisi Cold BLF A-10C 11 Kutaisi Air BLF A-10C 12 Kutaisi Air BLF Ka-50 01 London Cold BLF Ka-50 01 London Warm RDR Su-25T 01 Tbilisi Warm RDR Su-25T 02 Tbilisi Cold
---
The State is the last digit of both the AI and Client flags: 0: Count (use for Flag Increment and Decrement) 1: Dead, or Lost 2: Alive, or Won (why do I need this? - Triggers only recognize True; going from True to False is not a True condition for a Switched Condition trigger event) 3: Attack 4: Broadcast (when True enables a repeating message with Time Since Flag) 5: Zone Clear 6: Delay 7: Zone Invaded 8: Zone Captured 9: Deactivated
---
To Name units of a group, other than its default (e.g.: Unit #248), add a '-n' to the group number, e.g.: 30-7. Flags can be set for the first 9 units in a group. If Unit 7 of BLF VGrp 30 Kutaisi Defense is a Vulcan and I want to blow
it up on a trigger then its Unit Name is: BLF VGrp 30-7 Vulcan Instead of something like Unit #248...
The 'unit is dead' Flag is 73071. This flag can be set when the unit is dead if needed. A delay for a unit action is Flag 73076.
An alive flag can be set at the start of the mission to use in a condition. The flag 73072 is set to On at Mission Start. This can prevent a "unit is dead" message for a unit that is deactivated.
Use the Alive (2) flag, the Dead flag (1) and the Deactivate flag (9) to control subsequent trigger events.
---
Zone flags track the State of a Zone. Zones can be related to a Coalition, or they can be generic Location Zones, such as: BLF Zone 1 Kutaisi Air Base BLF Zone 2 Patriot Site BLF Zone 3 NE BLF Zone 4 SE BLF Zone 5 SW
RDR Zone 1 Gen Vaz HQ
LOC Zone 1 Vani City (non-aligned zone) LOC Zone 2 Kutaisi City (non-aligned zone) After thinking on these Location Zones, they do not need flags. You can always trigger a message of a coalition or group or unit entering or leaving a zone.
Up to 9 zones per side can use flags to denote the zone state. For Coalition Zone flags, the first digit is the Coalition Main number: 1 for Red and 5 for Blue, the 2nd and 3rd digits are zeroes, the fourth digit is the Zone number.
If 'RDR Zone 1 Gen Vaz HQ' is invaded the Red Main Zone Flag 10017 is set to True and 10015 is set to False. When this zone clears then turn off flag 10017 and turn on 10015. Flag 10005 should be set to True with a Mission Start event; all Coalition zones need an initial setting at mission start.
If the Patriot Site is dead the Blue Zone 2 Patriot Flag can be set to 50021.
Messages can be based off of these flag states.
Mission status can be determined for won/lost by using these flag states.
(I have not used Moving Zones much so don't have insight to flagging those.)
---
If Blue wins then the Blue Main Flag 60002 (Won) is set True and, if necessary Red Main Flag 10001 (Lost) is set to True; if Blue loses it is 60001 True (Lost) and the Red flag is 20002 True (Won).
---
This scheme still leaves a whole bunch of flags open to use: #1 through #9999. I have been using two-digit flags for the final wrap up of a mission, and for a count down to a Reload trigger event. In the fianl wrap ups I may generate
Blue Won messages vs. Red Won messages vs. the mission has timed out and nobody won.
--- edited 29-Jul-2012 for Client flags ---
WC
Edited by Wrecking Crew (07/29/12 02:09 PM) Edit Reason: Client flags
|
|
Top
|
|
|
|
#3610263 - 07/20/12 04:28 AM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Hail To The King Baby!!
Member
Registered: 06/07/11
Posts: 2030
Loc: Milwaukee, WI, USA
|
Holy crap! I think I went into a mini coma reading that! Good read WC, Flags are so important in mission building even if your not going full out like you apparently have. My use of flags is limited to one or two to facilitate an event happening. After reading this I see flags have way more potential than I thought!
Once again great post!
_________________________
XBOX Live Tag/Steam/pCARS/PSN: Weaponz248 iRacing/RFactor 2: Jason Bader
Desktop Specs: Dell XPS 630i/Intel Core 2 Quad Q9650@3.00GHZ/8 GB RAM/Nvidia GeForce GTX 570/Windows 7 64 bit/22" Gateway Monitor 1680x1050 Laptop Specs: Asus G75VW/Intel Core I7-3610QM@2.3GHZ/16 GB RAM/GeForce GTX 660M/Windows 7 64 bit/ 17.3" Display 1920x1080
|
|
Top
|
|
|
|
#3610278 - 07/20/12 05:32 AM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Member
Registered: 07/14/10
Posts: 316
|
Everyone has their own way of doing things. I have a similar method, but I let it change from mission to mission based on the needs of the trigger logic. My naming convention also changes abit. Lately I'm letting the mission editor name stuff for me if I have multiple similar groups. R_MBT_PLT #001 If I make a new group it will be automatically called R_MBT_PLT #002. Also lately I've been using a lot of flag values to do logic. Flag 1 equals 1, Flag 1 equals 2, and so on so forth. Its a good way to simplify the process. Each group can have its own flag with different but related values. But also its great for making looped trigger logic. Just use a "flag increase" after a "time since flag" condition and the clock resets. After reading this I see flags have way more potential than I thought! Go download and try to figure out "On Station" You can accomplish some crazy possibilities with a little creativity.
Edited by mrskortch (07/20/12 05:34 AM)
|
|
Top
|
|
|
|
#3610408 - 07/20/12 10:21 AM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Smooth Operator
Senior Member
Registered: 03/04/07
Posts: 3171
Loc: Colorado
|
Ahhh! I forgot about Ships! I don't use them hardly for v1.1.1.1 because they cause sim crashes. Well, it was good to write this down, but it needs some more consideration. My scheme has been 'maturing' from mission to mission, too, mrskortch  I have to think about how to squeeze the Ships category into this, while keeping a Coalition flag available for the Won/Lost/Timeout results. --- There is something to be said for letting the groups increment automatically -> #001 -> #002, etc., rather than doing all the editing. But the 5-digit flag length constraint only allows for a two digit group ID and a single digit unit ID (you can certainly *have* more than 9 units in a group); that's with a leading position Coalition/Category digit and a final State digit. One of the other guys here said he tracks all of his flags in an Excel spreadsheet - I move too fast to do that, my Excel file would get waay behind quickly. And since I do run Full Screen mode, every time I click off of the DCS screen onto my second monitor the DCS screen gets minimized so I can't easily move back and forth and see both the spreadsheet and the sim simultaneously. Would be nice if the Trigger windows had Comment capability. WC
|
|
Top
|
|
|
|
#3610539 - 07/20/12 01:43 PM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Smooth Operator
Senior Member
Registered: 03/04/07
Posts: 3171
Loc: Colorado
|
I did edit the first post to account for Ship Groups.
WC
|
|
Top
|
|
|
|
#3614586 - 07/27/12 12:12 AM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Smooth Operator
Senior Member
Registered: 03/04/07
Posts: 3171
Loc: Colorado
|
Anybody following the mission building side of things, here is a copy of a finding that I also posted the the Firehouse thread.
---
Well, stick my foot in my mouth (again, sort of). I set up a little mission to do more testing on Clients triggering stuff. I have said a few times that Clients cannot affect trigger events just by being someplace - rather, the Client has to kill something to trigger an event.
After I made the half-joke about an OpFor warning message, above, I thought I'd test it to be sure. I set up both a Red and a Blue A-10C as Clients and had them enter a zone that triggers a message and sets a timer flag, and then 20 seconds later the a/c explodes.
This worked! I was surprised. I got back in the slot and flew through the zone again and it did not work the second time or third... Only if I restarted the server would it work, the first time only. But, the trigger event was set to 'ONCE'.
I changed the trigger event to 'Switched Condition' and on the explode trigger I added an action to turn off the timer flag. Now it works every time I fly through the zone without having to restart the server.
This is really news to me. I recall testing this while developing 'Riders ot Storm' for flying through the valley and setting off the mountain festival flares - and obviously I did not go far enough with the options to see it work. Most likely I was using 'Once' type triggers and maybe, too, I was having issues with flare height such that the flares were not visible at the altitude I'd used (I think I was way too high in altitude when I started that testing - 5,000').
Now that I think about why the 'Once' won't work even after I re-join the slot, it is prolly because the a/c Client Group/Unit (they are 1 in the same) retains the Once events regardless of how many times their slots are joined.
--- More thoughts on Clients - their Dead attribute must be(?) cleared for a new Join. I wonder if they even get a Dead attribute? Such that a Group Dead on a Client is triggerable? Maybe... ---
This opens a lot more possibilities that I had thought were not possible.
WC
|
|
Top
|
|
|
|
#3615181 - 07/27/12 07:39 PM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Member
Registered: 07/14/10
Posts: 316
|
Once - Occurs once, then the trigger conditions are no longer checked Continuous - As long as the conditions are true, the trigger actions will execute every second. (Has no limit) Switched Condition - Whenever conditions are true, actions are executed once. In order to execute again, the conditions must be false. Examples: Once> Time more is 5 seconds> set Flag 1 On Once> Flag 1 is True > Flare at location (one flare will trigger) Continuous > Flag 1 is True > Flare at location (one flare will trigger every second) Switched Condition > Flag 1 is True > Flare at location (one flare will trigger) If you made a slight alteration to the switched condition like this... Switched Condition > Time since Flag 1 is 5 seconds > Flare at location, Flag 1 increase 1 (one flare will trigger every 5 seconds) Events are purely a slightly better way to optimize your logic code. As it is setup in the sim every condition is checked every second. If you have hundreds of triggers (hehe, no idea who would do such a thing  ) the mission performance can technically be effected. Events simply define when each trigger might be checked. The events can occur at any moment in the sim, however some are more likely to occur than others. I personally haven't really used events yet. --- More thoughts on Clients - their Dead attribute must be(?) cleared for a new Join. I wonder if they even get a Dead attribute? Such that a Group Dead on a Client is triggerable? Maybe... --- Make a massive zone taking up the combat area and simply use "Unit in Zone" conditions. If its in the zone a player has spawned in and is alive, if its outside the zone a player doesn't exist. If you want to "count" players you can use the same basic concept, but instead using mission goals. -- Red Player 1 in zone = 2 points, Red P2 in zone = 2 points etc. Then check "mission score higher than 3" if it is higher than 3 you know at least 2 red players are in the mission.
|
|
Top
|
|
|
|
#3615373 - 07/28/12 09:13 AM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: mrskortch]
|
Smooth Operator
Senior Member
Registered: 03/04/07
Posts: 3171
Loc: Colorado
|
Once> Time more is 5 seconds> set Flag 1 On
Once> Flag 1 is True > Flare at location (one flare will trigger) Continuous > Flag 1 is True > Flare at location (one flare will trigger every second) Switched Condition > Flag 1 is True > Flare at location (one flare will trigger)
If you made a slight alteration to the switched condition like this... Switched Condition > Time since Flag 1 is 5 seconds > Flare at location, Flag 1 increase 1 (one flare will trigger every 5 seconds)
Thanks for the details mrskortch - For this stuff - repeating something: Switched Condition > Time since Flag 1 is 5 seconds > Flare at location, Flag 1 increase 1 Instead of using Switched Condition and Flag 1 Increase 1, this is what I do for repeating messages: Mission Start, Flag 12 On Continuous Action; Time Since Flag 12 900 sec; Flag 12 On, Message To All, "bla bla bla SimHQ bla", 20 seconds (I wonder what the upper limit is on Flag Increase?) Folks, keep in mind that Switched Conditions will not trigger on a flag going False (or Off) - a flag has to go True. You can use a Flag Is False as an additional Condition but something else has to go to True, IME. mrskortch brings up the Time Is More condition. I had something that I wanted to happen at a particular time in a mission if a Flag is True - at a particular second, so: Once; Flag 1 True, Time Is More 889, Time Is Less 901; (Action) For all of the different Event types, I hardly ever add an Event Description - to me it seems that these don't really do anything. --- edit ---> In DCS World Mission Editor the Event Description was eliminated. Yesterday I added some warning messages in the Thunder mission for red Client A-10Cs coming into Blue zones - I am eager to see these in action. WC
Edited by Wrecking Crew (07/28/12 11:13 AM) Edit Reason: Event Description
|
|
Top
|
|
|
|
#3615375 - 07/28/12 09:21 AM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: mrskortch]
|
Smooth Operator
Senior Member
Registered: 03/04/07
Posts: 3171
Loc: Colorado
|
--- More thoughts on Clients - their Dead attribute must be(?) cleared for a new Join. I wonder if they even get a Dead attribute? Such that a Group Dead on a Client is triggerable? Maybe... --- Make a massive zone taking up the combat area and simply use "Unit in Zone" conditions. If its in the zone a player has spawned in and is alive, if its outside the zone a player doesn't exist. mrskortch - ^^^ this makes me recall a post on DCS Forums where somebody was saying that counting players was not reliable. My recent experiment on triggering on Client in a zone shows that a Once event may be the reason for that post, where Switched Condition may work OK. I think the guy was trying to take a Client count at Mission Start (I read it a while ago, not going back there to try to find it now). WC
|
|
Top
|
|
|
|
#3615607 - 07/28/12 06:26 PM
Re: DCS Mission Building Discussion - Flags, Group & Unit Names
[Re: Wrecking Crew]
|
Member
Registered: 07/14/10
Posts: 316
|
Counting players is VERY reliable depending how you do it. Simply using a switched condition for each player has its limitations, mostly that if multiple players join at the same time, players will be missed. Two Methods for counting players: A trick I use to set a flag to a specific value is to use this trigger action: Flag Set Random Value (1, 5, 5). The lower limit is 5, and the upper limit is 5, therefor the flag MUST be set to 5. I use this instead of having to use "flag off" before I want to set specific values for a flag. 1. Mission Goals + Triggers. As I said above, place a zone that covers most of the map. Click the button labeled "Mission Goals" its just below the triggers button. Mission goals are basically a number counter which automatically adjust based on the condition and the "score" of the condition. Each condition score can accept positive and negative numbers. The last I tested the limits in FC2, the overall score is limited from 0 to 100, this might have changed... Mission Goal> Player 1 is in Zone "HUGE Zone"> Blue Score = +1 Mission Goal> Player 2 is in Zone "HUGE Zone"> Blue Score = +1 Mission Goal> Player 3 is in Zone "HUGE Zone"> Blue Score = +1 Mission Goal> Player 4 is in Zone "HUGE Zone"> Blue Score = +1 You can use negative numbers to figure out the player difference between red and blue.
Mission Goal> Time more than 1 second > Offline Score (50)
Mission Goal> Red Player 1 is in Zone "HUGE Zone"> Offline Score = +1
Mission Goal> Blue Player is in Zone "HUGE Zone"> Offline Score = -1
If the score = 50, teams are even If greater than 50, red has more If Less than 50, blue has more As each player joins or leaves a server the score will adjust automatically to account for the changes. Additionally the score is evaluated instantaneously and has no issues with condition overlap. Then create the triggers to evaluate it. Generally you'd want it on a looping function that occurs at a regular interval, however it should work fine without it. Switched Condition (SC)> Coalition Score is lower than (Blue, 1) > Flag Set Random Value (1, 0, 0)
Switched Condition (SC)> Coalition Score is lower than (Blue, 2) AND Coalition score higher than (Blue, 0) > Flag Set Random Value (1, 1, 1)
Switched Condition (SC)> Coalition Score is lower than (Blue, 3) AND Coalition score higher than (Blue, 1) > Flag Set Random Value (1, 2, 2) etc... How it might look on a looping function:
SC > Time since Flag 3 is 900 seconds> Flag 2 On, Flag 3 On
Switched Condition (SC)> Flag 2 is true AND Coalition Score is lower than (Blue, 2) AND Coalition score higher than (Blue, 0) > Flag Set Random Value (1, 1, 1)
SC> Time since Flag 2 is 2> Flag 2 Off -- automatically turns the check off 2. Timed Triggers Alternatively you can use just triggers and define when you check for players on a looped trigger: Flag 1 On, Flag 3 Off -- Start Check
SC> Time since Flag 1 is 1 second> Flag 2 increase 1
SC> Flag 2 = 1 AND Player 1 in zone> Flag 3 increase 1
SC> Flag 2 = 2 AND Player 2 in zone> Flag 3 increase 1
SC> Flag 2 = 3 AND Player 3 in zone> Flag 3 increase 1
SC> Flag 2 = 4 AND Player 4 in zone> Flag 3 increase 1
SC> Flag 2 = 5 > Flag 1 Off, Flag 2 Off
This method takes more time depending on how many player aircraft are in a mission. It simply iterates between each client and if the condition is true it adds 1 to a flag.
Edited by mrskortch (07/28/12 06:27 PM)
|
|
Top
|
|
|
|
|
|
| |