Jump to content

Recommended Posts

Posted

I've been reading about mission building and I see a lot of references to "Flags".

 

From what I understand they are a true false condition that can trigger other events.

 

What I don't understand is how to add one in the mission editor. Nothing I can find says "add flag" or anything like that.

 

I'm sure it is a simple procedure but I can't seem to figure it out.

 

Thanks

Posted

You can use Flags in the action- and condition column of the trigger list.

In the action column you can set a Flag to true or false or set it to a specific or random value.

In the condition column you can ask if it is true or false or if it has a specific value.

 

A Flag is nothing you can see in the mission. It is used to get a trigger logic, to "save" a state of something to use it in a other trigger.

Or you can interlock two triggers so only one trigger can be active at the same time.

The use cases of Flags are endless.

  • 3 weeks later...
Posted (edited)

Also, flags can be increased or decreased in value; they are not just True/False.

 

You can start a flag with Flag Increase, say for Flag 10, increase by value 1, and Flag 10 will go True with Value = 1.

 

You can decrease Flags in the same way and they will go negative in value. I do not know if decreasing a flag through zero will cause a False condition for that Flag at zero - when I tested Increase & Decrease I looked at the numerical value and not at the Boolean value.

 

I got some help with this, happy to share it -

---

Displaying Flag Values with text messages

 

Use a Do Script Action -

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)

 

 

Hey Studsmcgee - this post really should be in the Mission Builders Corner, which a sub-forum to this forum. ^^^ Hope this helps.

 

Wrecking Crew

Edited by Wrecking Crew

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.

  • Recently Browsing   0 members

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