Jump to content

Recommended Posts

Posted

hi all,

 

if possible, i would like to know, how i can compare flags to flags using LUA, couldnt find it in search, maybe wrong key words, and dont want to get into MIST.

 

pseudo code:

 

Flag 1 != Flag 6
&&
Flag 2 != Flag 7
&&
Flag 3 != Flag 8
&&
Flag 4 != Flag 9
&&
Flag 5 != 1;

sadly no Flag unequal flag trigger option in ME :(

 

thanks,

RR

[sIGPIC][/sIGPIC]

"There's nothing to be gained by second guessing yourself.

You can't remake the past, so look ahead... or risk being left behind."

 

Noli Timere Messorem

"No matter how fast light travels, it finds the darkness has always been there first, and is waiting for it."

Terry Pratchett

Posted

Well, you can test if two flag do equal, and use that result. I can think of a couple appraoches.

 

Set two flags equal and when they are no longer return True.

 

Test if one flag goes true while the other is still false and return True.

 

...

 

WC

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.

Posted

i can as well, but not knowing how to "talk" with the flags via LUA is my problem, and my search didnt turn up something there :(

[sIGPIC][/sIGPIC]

"There's nothing to be gained by second guessing yourself.

You can't remake the past, so look ahead... or risk being left behind."

 

Noli Timere Messorem

"No matter how fast light travels, it finds the darkness has always been there first, and is waiting for it."

Terry Pratchett

Posted

Here's a way to display flag values.

 

===

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)

 

 

 

 

local msg = {}

msg[#msg + 1]='Flag 1 value = '

msg[#msg + 1]=trigger.misc.getUserFlag('1')

msg[#msg + 1]='. \n'

msg[#msg + 1]='Flag 2 value = '

msg[#msg + 1]=trigger.misc.getUserFlag('2')

msg[#msg + 1]='. \n'

msg[#msg + 1]='. \n'

trigger.action.outText(table.concat(msg), 6)

 

 

 

===

 

There's is the Witchcraft tool to help debug LUA scripts.

 

WC

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.

Posted

if trigger.misc.getUserFlag('1') ~= trigger.misc.getUserFlag('6') and trigger.misc.getUserFlag('2') ~= trigger.misc.getUserFlag('7') then

return true

end

 

As for flag unequal, yeah it doesn't directly exist. Could use 2 Flag is More than Flag conditions checked as an 'or' statement because if a flag is more than another they cannot be equal.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • Recently Browsing   0 members

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