Jump to content

Recommended Posts

Posted (edited)

  I hope this finds anyone struggling to clearly understand "Flags" in the Mission Editor.

  The simplest way I can describe a "Flag", is that it is basically just an invisible switch.

  This "invisible switch" can be turned "On" or "Off" by meeting a specific user set condition. (E.g. flying in or out of a user created trigger zone, pressing a button in the cockpit, or reaching a specific altitude).

  If a switch("Flag") is turned "On", you can make stuff happen. (E.g. Activate groups, deactivate groups, play a message, spawn enemies, even flick a switch in the cockpit!) Alternatively, you can turn a switch("Flag") "Off" to achieve the same effect. 

  Creating a switch("Flag") is simple!

  Make a Trigger, set a Condition, and set Action to "Flag On" and set a value to it [x].

Note: You don't necessarily need a condition to just simpily turn a switch("Flag") "On", depending on the Trigger Event. (E.g. On Mission Start)

  Then, to make it do something, create a new Trigger. Set Condition to "Flag Is True" Make the value the same as the one you just turned on [x]. Then select an Action you want to happen when it is turned on.

Note: You can also use "Flag Off". However they're set to off by default. In my opinion, it's easier to have a switch("Flag") turn "On" and perform an action and then build upon the operation of that switch("flag's") orientation. 

  Simple Example: 

Set Trigger [ONCE]

  [Name whatever you want, E.g. Test]

                    [NO EVENT]

Set Condition [Time More]

                         [Seconds=10]

Set Action [Flag On] [Value=1]

  Create New Trigger

Set Trigger [ONCE]

[Name whatever you want, E.g. Flag Test ]

                    [NO EVENT]

Set Condition [Flag Is True] [Value=1]

Set Action [Message To All] [type whatever you want].

  And that's it, you're done! Just start the mission, and after 10 seconds the message will appear.

  Now obviously, you could just set the Action in the first trigger to [Message To All] and bypass the switch("Flag") and it would work just the same. But let's say you wanted that message to say, "Hostiles In The Air" when you fly over a specific point, while at the same time, activate an enemy aircraft, spawn a friendly aircraft, and spawn an enemy ground unit. You can make all that happen at once with just one switch("Flag") under one user condition.

  So you'll see, as you start building  missions, just how useful these switch("Flags")can be. You could have one switch("Flag") turn on while another switch("Flag") turns off in the same action. Deactivating one group and activating another group simultaneously is just one of the literal thousands of different scenarios you can create using flags.

 I Hope This Helped!

Cheers!

 

 

 

Edited by AndyB
  • Like 1
  • Thanks 1
Posted (edited)
1 hour ago, AndyB said:

The simplest way I can describe a "Flag", is that it is basically just an invisible switch.

Thank you for taking the time to shed some light in one of DCS most important part of mission editing, which also is currently in dire need of more illumination.

So let me do my part: These things are called 'flags' for historical reasons, and if you use that 'picture' you may better remember what flags are:

Historically, if you wanted to signal something over large distances, people would use some pre-arranged signals, for example lighting a fire (smoke) or old-school beacon. The 'pre-arranged' portion here is key: all parties that are involved need to know what the signal is, and what it is used to communicate. In the past centuries, as passing information reliably and quickly over large distances became a pressing need, many groups have evolved a system using colorful pieces of cloth: flags. This was especially true for nautical application, but was also used to transmit messages over land (using "semaphores).

When the computer age began, this concept was also adopted, and was used to signal a status of certain states. Older computers that used relays to store a bit, also added small (paper) flags (later lights) to indicate if a status bit was set or not so operators could easily discern the core state from the flags - hence flags hat made the jump to computer speak.

In DCS mission scripting, flags are often used for similar purposes: first, it is agreed what a flag's setting implies, and then you set triggers that react to a flag's setting: is it 'raised' (the old-school flags that can only be raised or lowered: be 0 (lowered) or anything else (raised).

Now, in DCS flags can have more values than 0 or 1, or when we take the nautical analogy, flags can be lowered (set to zero), or raised with different pre-agreed values ("colors" or "patterns" in the real-world past when real flags where used) .

So flags are not really switches, but indicators. Important: switches can use flags to determine if they themselves should react: "switch on or off" (be triggered in mission parlance). A subtle differentiation, to be sure, but one that can help you when we talk about triggers and conditions: a trigger with a condition would be the switch, and they can, amongst other things, react to the value of a flag and then perform actions.

1 hour ago, AndyB said:

This "invisible switch" can be turned "On" or "Off" by meeting a specific user set condition.

Flags can be set to "off" (lowered, value zero by convention and in missions) or raised (to different non-zero values) whenever the user wants. This can be done through 'actions' in DCS missions (or Lua scripts).

AND one important use of flags is that we can make the mission to perform an action only if certain conditions are met like certain flags raised whilst others are lowered (this is the "condition" part of a trigger) 

So it's not the switch that carries the information. The switch reacts to the information carried with a flag, and one result of that is that the switch can then set this or other flags (or spawn aircraft, or do many other things...)

1 hour ago, AndyB said:

Note: You don't necessarily need a condition to just simpily turn a switch("Flag") "On", depending on the Trigger Event. (E.g. On Mission Start)

Correct. And that is why we should view a switch as distinct from a flag. We can use flags as parts of switches to both determine a condition, and as part of an action to change something. In missions, instead of 'switches' we use the word "trigger" (a really unfortunate name for what it does - since as you already noted, there are unconditional, i.e. always executing, triggers. But I digress). 

In DCS missions, Triggers are used to initiate certain actions - and they have three parts: 

  • when should we check (regularly, or on certain events like a crash or airfield capture) and how often (once, multiple times)
  • the situation that we are looking for: the 'condition' (this can, among other things, look for flags that may be raised or lowered. If you omit the condition, it is assumed that the situation that we are looking for is "anything", we always meet that condition). If the entire situation we find is as described in the condition, we proceed to the...
  • action - what is to be done. This can be sending messages, activating units, or raising and lowering flags. 

In other words, when we use Flags in missions, they can appear in multiple places of our triggers: to help make decisions (the condition part) and to make changes (the action part). 

Or: flags are used to pass information and to act on, no more. And IMHO terribly explained 🙂  

[Addendum:

One peculiar quirk in DCS is that flags can remember the mission time when they were last changed. This non-standard bit of additional information mission creators can use inside conditions and require a 'Time since flag' component. Obviously, mission designers cannot directly modify that information other than by setting a flag, and the entire mechanics of "Time Since" are underdocumented. But this feature can allow mission designers to implement some primitive, if unreliable timers].

Edited by cfrag
  • Thanks 3
Posted (edited)
3 hours ago, cfrag said:

Thank you for taking the time to shed some light in one of DCS most important part of mission editing, which also is currently in dire need of more illumination.

So let me do my part: These things are called 'flags' for historical reasons, and if you use that 'picture' you may better remember what flags are:

Historically, if you wanted to signal something over large distances, people would use some pre-arranged signals, for example lighting a fire (smoke) or old-school beacon. The 'pre-arranged' portion here is key: all parties that are involved need to know what the signal is, and what it is used to communicate. In the past centuries, as passing information reliably and quickly over large distances became a pressing need, many groups have evolved a system using colorful pieces of cloth: flags. This was especially true for nautical application, but was also used to transmit messages over land (using "semaphores).

When the computer age began, this concept was also adopted, and was used to signal a status of certain states. Older computers that used relays to store a bit, also added small (paper) flags (later lights) to indicate if a status bit was set or not so operators could easily discern the core state from the flags - hence flags hat made the jump to computer speak.

In DCS mission scripting, flags are often used for similar purposes: first, it is agreed what a flag's setting implies, and then you set triggers that react to a flag's setting: is it 'raised' (the old-school flags that can only be raised or lowered: be 0 (lowered) or anything else (raised).

Now, in DCS flags can have more values than 0 or 1, or when we take the nautical analogy, flags can be lowered (set to zero), or raised with different pre-agreed values ("colors" or "patterns" in the real-world past when real flags where used) .

So flags are not really switches, but indicators. Important: switches can use flags to determine if they themselves should react: "switch on or off" (be triggered in mission parlance). A subtle differentiation, to be sure, but one that can help you when we talk about triggers and conditions: a trigger with a condition would be the switch, and they can, amongst other things, react to the value of a flag and then perform actions.

Flags can be set to "off" (lowered, value zero by convention and in missions) or raised (to different non-zero values) whenever the user wants. This can be done through 'actions' in DCS missions (or Lua scripts).

AND one important use of flags is that we can make the mission to perform an action only if certain conditions are met like certain flags raised whilst others are lowered (this is the "condition" part of a trigger) 

So it's not the switch that carries the information. The switch reacts to the information carried with a flag, and one result of that is that the switch can then set this or other flags (or spawn aircraft, or do many other things...)

Correct. And that is why we should view a switch as distinct from a flag. We can use flags as parts of switches to both determine a condition, and as part of an action to change something. In missions, instead of 'switches' we use the word "trigger" (a really unfortunate name for what it does - since as you already noted, there are unconditional, i.e. always executing, triggers. But I digress). 

In DCS missions, Triggers are used to initiate certain actions - and they have three parts: 

  • when should we check (regularly, or on certain events like a crash or airfield capture) and how often (once, multiple times)
  • the situation that we are looking for: the 'condition' (this can, among other things, look for flags that may be raised or lowered. If you omit the condition, it is assumed that the situation that we are looking for is "anything", we always meet that condition). If the entire situation we find is as described in the condition, we proceed to the...
  • action - what is to be done. This can be sending messages, activating units, or raising and lowering flags. 

In other words, when we use Flags in missions, they can appear in multiple places of our triggers: to help make decisions (the condition part) and to make changes (the action part). 

Or: flags are used to pass information and to act on, no more. And IMHO terribly explained 🙂  

[Addendum:

One peculiar quirk in DCS is that flags can remember the mission time when they were last changed. This non-standard bit of additional information mission creators can use inside conditions and require a 'Time since flag' component. Obviously, mission designers cannot directly modify that information other than by setting a flag, and the entire mechanics of "Time Since" are underdocumented. But this feature can allow mission designers to implement some primitive, if unreliable timers].

 

Thank you, my goal was to help people who didn't understand what a Flag was by making it sound as simple as possible and bring some concept to the idea. Adding your post on top of this, brings a lot more complexity and immersion to it, I think between our two posts, this can really help a lot of people, first grab a very simple concept of what a flag is and how it works, and then really hone in and understand a sort of, "flag theory" if you will. Thanks for the response, I really appreciate it. Great Information.

Edited by AndyB
  • Thanks 1
Posted

I will offer this up.  It is a guide for using numerical flags, from before when text-value flags became available.  "WC's Flags.txt"

Quote

 

DCS World Mission Editing, Five Digit Flags, Group Names, Zones

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.

 

 

WC's Flags.txt

  • Thanks 1

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

  • 6 months later...
Posted

So, what is FLAG 99? Or FLAG 60? Or 51, 98? There's one mission I'm kinda tweaking and it has a bunch of random flag numbers. Are those numbers in seconds or does each flag mean something specific? Like, FLAG 99 mean xyz while FLAG 60 means abc...I can find nothing that truly explains what the different flags are.

Former SSG US Army

UH-60A/L/M Crewchief

"2 To Fly!"

Posted
7 minutes ago, H60MTI said:

So, what is FLAG 99? Or FLAG 60? Or 51, 98? There's one mission I'm kinda tweaking and it has a bunch of random flag numbers. Are those numbers in seconds or does each flag mean something specific? Like, FLAG 99 mean xyz while FLAG 60 means abc...I can find nothing that truly explains what the different flags are.

Flags have names so they can be distinguished from one another. Flag 99 is the flag that is called 99, flag 60 is the flag that is called 60. They can have alphabetical names too. The names are arbitrary and user created.

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Posted

They are basically just numbers given by the mission designers and have no inherent meaning or function. 

It´s just a number to identify different flags, it has nothing to do with what the flags do.

Posted (edited)
17 minutes ago, H60MTI said:

So, what is FLAG 99? Or FLAG 60?

That is a bit like asking 'what is "PO Box 99 or PO Box 60?". They are storage containers -- one labeled "99", the other "60". What a mission designer uses them for is up to them. In older times (perhaps two or more years ago), mission designers in Mission Editor could only use numbers as labels for flags. Today you can use any combination of letters and digits to create a name for flag. If you are designing missions today, I recommend (but you aren't forced to comply) that you use labes for flags that tell you what they are used for. I, for example, use flag "missionComplete" to signal my mission that if the flag with that name changes to a certain value, the mission is complete. 

Yeah, that's right. You don't just get to define what a flag is to be labeled. you ALSO define what any particular value actually means. So if you are looking at somebody else's mission, you'll need to figure out

  1. What flag labels the mission uses and 
  2. What each particular value for a flag means
17 minutes ago, H60MTI said:

Or 51, 98?

In the context of (probably) setting a flag within a trigger rule, it usually means "Set the flag named "51" to the value 98

17 minutes ago, H60MTI said:

Like, FLAG 99 mean xyz while FLAG 60 means abc...I can find nothing that truly explains what the different flags are.

That is because both names and values are assigned at will, by the mission author and the names can be whatever they chose, and a values meaning can also be anything that makes sense to the mission author at that time. 

Oh, and before you ask: there are no pre-defined flags in DCS, i.e. flags that everyone knows that have a special meaning or use to control something.

Edited by cfrag
Posted

Ahhh...So, ACTION: FLAG ON; FLAG: 98 just means turn on FLAG 98. FLAG 98 doesn't have anything preassigned to it. It's just a name the mission designer chose. I can pick any number for a FLAG name pretty much?

Former SSG US Army

UH-60A/L/M Crewchief

"2 To Fly!"

Posted
4 minutes ago, H60MTI said:

Ahhh...So, ACTION: FLAG ON; FLAG: 98 just means turn on FLAG 98. FLAG 98 doesn't have anything preassigned to it. It's just a name the mission designer chose. I can pick any number for a FLAG name pretty much?

correct

  • ED Team
Posted

So I hide the posts from the point where I thought some of you lost the plot. This seems like the intent of the post was to be helpful to the community and new people editing or making missions. 

Please don't taint that by starting a debate where there doesn't need to be one.

Thanks

  • Like 2

64Sig.png
Forum RulesMy YouTube • My Discord - NineLine#0440• **How to Report a Bug**

1146563203_makefg(6).png.82dab0a01be3a361522f3fff75916ba4.png  80141746_makefg(1).png.6fa028f2fe35222644e87c786da1fabb.png  28661714_makefg(2).png.b3816386a8f83b0cceab6cb43ae2477e.png  389390805_makefg(3).png.bca83a238dd2aaf235ea3ce2873b55bc.png  216757889_makefg(4).png.35cb826069cdae5c1a164a94deaff377.png  1359338181_makefg(5).png.e6135dea01fa097e5d841ee5fb3c2dc5.png

Posted
On 4/6/2024 at 1:28 PM, H60MTI said:

So, what is FLAG 99? Or FLAG 60? Or 51, 98? There's one mission I'm kinda tweaking and it has a bunch of random flag numbers. Are those numbers in seconds or does each flag mean something specific? Like, FLAG 99 mean xyz while FLAG 60 means abc...I can find nothing that truly explains what the different flags are.

Avoid using numbers only; they are confusing to new readers and have no context to them to help with readability. You don't need a 21kb cypher to use flags. Just use words and make them description - they're just variables. 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...