Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#3610212 - 07/20/12 04:58 AM DCS Mission Building Discussion - Flags, Group & Unit Names  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
--- edited 29-Sep-2013 ---
(fixed some errors and described Zone Flags)

This guide is about my scheme of DCS World event logic flags and group names.

Major changes to the document. Lots more explanation and examples. Let me know if you see any mistakes or have comments!

Link to latest Flags file -
https://docs.google.com/file/d/0BwHk38uryutrMXZBWlk5ZjdRbjQ/edit?usp=sharing

==========================================================

DCS World Five Digit Flags and Group Names


This guide describes a method of using five digit flags with DCS World Events -> Conditions -> Actions features. It also explains the corresponding naming convention for groups and units.

In DCS World, event flags can be up to five digits in length. Flags must start with 1-9; leading zeroes are not allowed; alpha characters are not allowed.

A five digit flag can uniquely identify the state of a unit, group, or coalition.

===
The Basics of Five Digit Flags
Red flags get a leading '1' through '4':
Red Main & Aircraft Groups: 1
Red Helicopter Groups: 2
Red Vehicle Groups: 3
Red Ship Groups: 4

Blue flags get a leading '5' through '8':
Blue Main & Aircraft Groups: 5
Blue Helicopter Groups: 6
Blue Vehicle Groups: 7
Blue Ship Groups: 8

Group numbers are the second & third digits. Unit numbers are the fourth digit.

The State is the fifth digit:
0: Count (use for Flag Increment and Decrement)
1: is Dead, or Lost
2: is Alive, or Won
3: is Attacking
4: Broadcast; enables a repeating message with Condition = Time Since Flag (Flag x), and Action = Flag On (Flag x) & Message
5: Zone Clear
6: Delay; use with Time Since Flag
7: Zone Entered
8: Zone Captured
9: Deactivated (vs Dead)

Examples:
Red Aircraft group 24 is dead: 12401 = True
Red Aircraft group 24 unit 3 is dead: 12431
Red Aircraft group 24 unit 4 is in a zone: 12447
Red Aircraft group 24 unit 4 is out of a zone: 12445
Red Vehicle group 5 is deactivated: 30509 = True, 30501 is kept False when 30509 is True
Red Ship group 31 is in a zone: 43107

Blue Aircraft group 24 is dead: 52401 = True
Blue Helicopter group 9 unit 2 is attacking: 60923
Blue Vehicle group 44 is dead: 74401
Blue Vehicle group 44 is broadcasting a repeating message: 74404

A coalition flag can be used for the state of Red or Blue:
Red counter flag: 10000
Red lost the mission: 10001
Red won the mission: 10002

Blue counter flag: 50000
Blue lost the mission: 50001
Blue won the mission: 50002

---
Examples of AI Group names:
Red AGrp01 Mig-29
Red HGrp01 Ka-50
Red SGrp01 Speedboat
Red SGrp02 Cruiser
Red VGrp01-1 Gen Vaz HQ Support*
Red VGrp01-2 Gen Vaz HQ ADA*

Blue AGrp11 AWACS
Blue AGrp12 F/A-18C SEAD
Blue AGrp23-1 B-1B Buckshot
Blue AGrp23-2 B-1B Buckshot
Blue AGrp23-3 B-1B Buckshot
Blue AGrp23-4 B-1B Buckshot
Blue AGrp24-1 B-1B Blackcat
Blue AGrp24-2 B-1B Blackcat
Blue AGrp24-3 B-1B Blackcat
Blue AGrp24-4 B-1B Blackcat
Blue HGrp01 Cobras
Blue SGrp01 Carrier
Blue SGrp02 Civ Boat
Blue VGrp03-1 Kutaisi Defense*
Blue VGrp03-2 Kutaisi ADA*

Note how the fourth digit can be used to associate groups by function instead of designating a unit of a group; your choice.

===
Beyond Basics

AI Large Aircraft Groups
Large aircraft, such as heavy bombers and tankers, are best kept to one unit per group. Multiple units within a group of large a/c do not respond well to waypoints and events. Even with this restriction, large a/c can be associated together.

Example - a Blue AI bomber aircraft 'group' of four uses group number 20:
Blue AGrp20-1 B-1B, flag 5201x (where x is the State flag)
Blue AGrp20-2 B-1B, flag 5202x
Blue AGrp20-3 B-1B, flag 5203x
Blue AGrp20-4 B-1B, flag 5204x

---
AI Group Association

- By Location*:
Red VGrp01-1 Gen Vaz HQ Support
Red VGrp01-2 Gen Vaz HQ ADA

Blue VGrp03-1 Kutaisi Support
Blue VGrp03-2 Kutaisi ADA

- To Spawn - after the first group dies, spawn the next, and then the next, etc.:
Red VGrp10-0 Armor
Red VGrp10-1 Armor
Red VGrp10-2 Armor
Red VGrp10-3 Armor
Red VGrp10-4 Armor

===
Client Aircraft Group Names

Client (or Player) groups are named differently. A single Client is its own group, limited to one unit. Client aircraft group names start with the aircraft type followed by the Group number; this is also the a/c BORT number (for Blue). This makes for easy identification of available slots when joining a mission (and the Nose Number of the a/c will correspond to the multiplayer slot number for the Own ID on A-10C aircraft).

Examples of Client Aircraft Group names:
A-10C 01 Vaziani Cold Start
A-10C 02 Vaziani Cold Start
A-10C 03 Vaziani Cold Start
A-10C 04 Vaziani Cold Start
A-10C 11 Vaziani Warm Start
A-10C 12 Vaziani Warm Start
A-10C 13 Vaziani Air Start
A-10C 14 Vaziani Air Start
F-15C 01 Kutaisi Cold Start
F-15C 02 Kutaisi Cold Start
F-15C 03 Kutaisi Warm Start
F-15C 04 Kutaisi Warm Start
UH-1H 01 FARP London Cold
UH-1H 01 FARP London Warm

MiG-29S 01 Anapa Cold
MiG-29S 02 Anapa Air
Ka-50 01 FARP Vetka Warm
Ka-50 02 FARP Vetka Warm
Ka-50 03 FARP Vetka Warm
Ka-50 04 FARP Vetka Warm

Note that these Client Group names do not need to include the 'Blue' or 'Red' coalition at the beginning. These words would take up unneeded space in the window where the Client slots are already grouped by coalition.

===
Notes

Second & Third Digits: Group numbers
The five-digit flag scheme allows group numbers of two digits. By numbering groups with two digits, a five-digit flag can be used to uniquely identify coalition and unit type, group number, unit number and a 'state'. With this scheme, each coalition can have 100 groups of any type. It is often better to start a Client aircraft group number using 'x1', like '11', '21', '31', etc., instead of 10, 20, 30...; this is for associating Client a/c BORT and Callsign values to correspond to the group number. Save the Group = '00' for high-level flags like win/lose conditions, and counters.

Group Names
The second and third digits represent the group number. The group number is used in the Group Name field when setting up the mission. The coalition, such as Red or Blue, starts the Group Name and separates the names in the Unit List. Additional descriptions may be added at the end of the Group Name.

I do not use the unit numbers very often, and I typically do not take the time to enter these unit numbers into the Unit Name field. I will only do so if I need to flag the unit for some purpose, such as Explode Unit or Smoke On Unit.

In my missions, Clients don't typically need flags. Therefore, the Group number in the Client names above can be the same as for AI Groups. If you need to set flags for Clients as well as AI then the Group numbers would need to be unique.

There is no editor control of the Client slot names for Combined Arms.

A high level Blue coalition State can use flag 5000x to designate the state; Red can use 1000x.

The States were developed over many missions. The order is not ideal, but I kept it to support all of my missions. Occasionally, I will fudge these a bit, more so with numbers 5, 6, and 8 -- the zone states. You may find the Dead vs Deactivate useful, as these conditions may have different consequences in your mission.

I also do use two-digit flags, since leading zeroes are not allowed. I will use Flag 10 for a repeating message throughout the mission (I repeat mission messages every 23 minutes, or 1380 seconds). I use flags 50-60 to wrap up a mission, typically with messages every few minutes to countdown to a new mission load.

There is another category, using leading digit 9. I have used leading 9 flags for coalition counters:
Red Counter: 91xxx
Blue Counter: 95xxx
Coalition scores to 100 can be tallied with these flags.

Leading digit 9 flags can be used with numbered Zones. I usually color Zones yellow and use the States of 5, 7 and 8 to indicate when a Group/Unit is in or out of a Zone (8 not so much).
Using a similar convention for the counters above, where the second digit belons to a coalition/type, that leaves the third and fourth digits for the Zone number and fifth for the State. For these flags the Group number cannot be specified.
Mist scripts can detect the type of Vehicle, Aircraft, Helicopter and Ship; see the Mist Guide for these functions:
mist.flagFunc.units_in_zones
mist.flagFunc.units_in_moving_zones
There are a couple of great Mist scripts by St3v3f at DCS World forums to detect in and out of zone conditions and set flags accordingly.

Red Aircraft in Zone 3: 91037 = True
Red Helicopters were in Zone 20 and left: 92207 = False, 92205 = True
Red Vehicles in Zone 15: 93157

Blue Ships are in Zone 2: 98027 = True
Blue Ships are out of Zone 2: 98025 = True, 98027 = False

===
Mission Version

My mission names begin with my initials, such as "WC's iShot The Shilka". The names also include a version indication with a revision, like "126v3d". This lets me know what version of DCS World the mission was last saved under, as well as a revision number that allows me to make incremental revisions: a, b, c, .., as well as show a major change from a revision like "3d" to "4a".

WC's iShot The Shilka 126v3d.miz
WC's iShot The Shilka 126v3e.miz
WC's iShot The Shilka 127v3f.miz
WC's iShot The Shilka 127v4a.miz

===
Mist

I will load Mist with a Condition -> Time More (5), and Action -> Message 'Load Mistv2_0.lua' (1 second). The message lets me know the Mist version later.

Other Mist events will include a Condition -> Time More (10). This is necessary to prevent the event from throwing an error before Mist is loaded.

All of the Mist events use Type -> Once and Event -> No Event. The names of these events all begin with 'mist.' for easy identification.

===
Displaying Flag Values With Text Messages

Use a Do Script Action (does not require Mist) -
local msg = {}
msg[#msg + 1]='Blue All Points Flag 10000 value = '
msg[#msg + 1]=trigger.misc.getUserFlag('10000')
msg[#msg + 1]='. \n'
msg[#msg + 1]='Blue Vehicles In Zone Points Flag 20000 value = '
msg[#msg + 1]=trigger.misc.getUserFlag('20000')
msg[#msg + 1]='. \n'
msg[#msg + 1]='. \n'
msg[#msg + 1]='Blue Aircraft Points Flag 50000 value = '
msg[#msg + 1]=trigger.misc.getUserFlag('50000')
msg[#msg + 1]='. \n'
msg[#msg + 1]='Blue Heli Points Flag 60000 value = '
msg[#msg + 1]=trigger.misc.getUserFlag('60000')
msg[#msg + 1]='. \n'
msg[#msg + 1]='Blue Vehicle Points Flag 70000 value = '
msg[#msg + 1]=trigger.misc.getUserFlag('70000')
msg[#msg + 1]='. \n'
msg[#msg + 1]='Blue Ship Points Flag 80000 value = '
msg[#msg + 1]=trigger.misc.getUserFlag('80000')
msg[#msg + 1]='. \n'
msg[#msg + 1]='\n'
msg[#msg + 1]='Press Pause to freeze the action. \n'
trigger.action.outText(table.concat(msg), 6)

===
F° = ((C° * 9) / 5) + 32

C° = (F° - 32) * 5 / 9

===
Designer Notes

The Is User flags are limited to less than five digits. I do not use those flags, and have no advice for them (except for ED to increase them to five digits).

Wrecking Crew
Edited 29-Sep-2013

===========================================================

crew

Last edited by Wrecking Crew; 09/29/13 04:51 PM. Reason: Zone Flags
Inline advert (2nd and 3rd post)

#3610263 - 07/20/12 08:28 AM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Jun 2011
Posts: 2,764
Weaponz248 Offline
Hail To The King Baby!!
Weaponz248  Offline
Hail To The King Baby!!
Senior Member

Joined: Jun 2011
Posts: 2,764
Statesboro GA 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/PSN: Weaponz248

#3610278 - 07/20/12 09:32 AM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Jul 2010
Posts: 378
mrskortch Offline
Member
mrskortch  Offline
Member

Joined: Jul 2010
Posts: 378
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.

Originally Posted By: Weaponz248
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. biggrin

Last edited by mrskortch; 07/20/12 09:34 AM.
#3610408 - 07/20/12 02:21 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
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 smile

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

#3610539 - 07/20/12 05:43 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
I did edit the first post to account for Ship Groups.

WC

#3614586 - 07/27/12 04:12 AM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
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

#3615181 - 07/27/12 11:39 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Jul 2010
Posts: 378
mrskortch Offline
Member
mrskortch  Offline
Member

Joined: Jul 2010
Posts: 378
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 wave) 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.


Quote:
--- 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.

#3615373 - 07/28/12 01:13 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: mrskortch]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
Originally Posted By: mrskortch

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

Last edited by Wrecking Crew; 07/28/12 03:13 PM. Reason: Event Description
#3615375 - 07/28/12 01:21 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: mrskortch]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
Originally Posted By: mrskortch
Quote:
--- 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

#3615607 - 07/28/12 10:26 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Jul 2010
Posts: 378
mrskortch Offline
Member
mrskortch  Offline
Member

Joined: Jul 2010
Posts: 378
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.
Code:
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.
Code:
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:
Code:
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:
Code:
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.

Last edited by mrskortch; 07/28/12 10:27 PM.
#3616002 - 07/29/12 06:04 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
mrskortch and I are presenting two methods for determining a mission's Won/Lost outcome.

In the Mission Editor, Mission Goals can be defined and these can be flag based and point based. mrskortch explains above, and might be used to score Red vs Blue missions.

My approach to Won/Lost has often been to use zones, often with a truth table like this -

Where the columns are zones and the one's represent if a zone is cleared. In this three-zone truth table, six different messages can be generated from lines 3-8 to provide information on which zones still need to be attacked (think Nuke Plant), where line 9 represents a mission won state.


I did edit my first post today to account for Client flags.

WC

PS. I appreciate mrskortch's input. Let's present as many different approaches to this stuff as we can. I will ask EinsteinEP to move this to the Reference forum.

#3644673 - 09/15/12 11:38 AM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Jan 2012
Posts: 2,397
eno75 Offline
Member
eno75  Offline
Member

Joined: Jan 2012
Posts: 2,397
Okay guys- as I'm chipping away at my mission I've come into a bit of a problem with a few scenarios:


1) I'm trying to figure out how to set up a scenario where if an "insurgent" vehicle is destroyed while it is in a weapon hold condition- that a severe penalty or condition could occur... for example the mobilization of a daunting enemy force.

For example: I have randomized some of the "roadblocks" and incoming convoys to either both hold fire... return fire... or have weapons free conditions. If they're both "return fire" conditions- then as long as nobody fired... they wouldn't fire. My question is if an A-10 pilot goes in when there's a "return fire" ROE- will the group that is fired upon ONLY shoot back at the group that fired at it... or will it return fire at the whole coalition?

In cases where both units are essentially not firing at each other, the incoming unit reaches a waypoint where they hold for 15 minutes or so to "negotiate" a passage. If a trigger happy A-10 pilot comes in and opens fire during this process- basically the convoy would be destroyed or some other horrible thing would occur. Or local SAM missiles would activate over a 10-15 minute period... or something.



Well- that's a good start. Any feedback / ideas on how to implement?

#3645227 - 09/16/12 03:01 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
Designate a flag(s) to indicate the insurgents' state - switch the flag(s) when you change the state. Use the flag in your logic to trigger the consequences.

WC

#3841397 - 09/24/13 08:14 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
New document version. See the OP.

WC

#3843327 - 09/29/13 04:52 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Mar 2007
Posts: 5,111
Wrecking Crew Offline
Smooth Operator
Wrecking Crew  Offline
Smooth Operator
Hotshot

Joined: Mar 2007
Posts: 5,111
Colorado
Fixed some errors and described Zone Flags, like the ones used in Pirates.

WC

#3851440 - 10/18/13 02:44 PM Re: DCS Mission Building Discussion - Flags, Group & Unit Names [Re: Wrecking Crew]  
Joined: Nov 2010
Posts: 488
Snoopy_476th Offline
Member
Snoopy_476th  Offline
Member

Joined: Nov 2010
Posts: 488
Warner Robins Ga, USA
Thanks WC! I really need to find some time to dig into the ME more.


Moderated by  Force10, RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
10 years after 3/8/2014
by NoFlyBoy. 03/17/24 10:25 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0