Studsmcgee Posted June 5, 2013 Posted June 5, 2013 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
Grimes Posted June 5, 2013 Posted June 5, 2013 All flags already exist within a mission and they are set to false by default. There is no need to add a flag or set a value for it to be used. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
STP Dragon Posted June 6, 2013 Posted June 6, 2013 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. Homepage: Spare-Time-Pilots DCS:BlackShark v1.0.2: BLINDSPOTs EditorMod DRAGONs ArmA2-Sounds DRAGONs BS1 TRAININGPACK DRAGONs MISSIONPACK [bS & FC2] DCS:World: TM WARTHOG PROFIL FOR BS2 DRAGONs BS2_TRAININGPACK DRAGONs TRAININGPACK DRAGONs MISSIONPACK
Wrecking Crew Posted June 24, 2013 Posted June 24, 2013 (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 June 24, 2013 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.
Recommended Posts