Jump to content

Write Flag Values out in Message text


Elphaba

Recommended Posts

For debugging purposes it would be very handy to write out the state (true/false) or value (e.g. number from 1 to 100) of any number of flags in the form of a message to a specific unit or even to a spectator. 

Just like in C, these could be done with a slash or other tag in the message text field e.g. "This is text in the message text field, and here are the flags I'm interested in:

##MYFLAG1.VALUE##

##MYFLAG2.STATE##

This is the end of the text in the message field box."

  • Like 1
Link to comment
Share on other sites

17 hours ago, Elphaba said:

For debugging purposes it would be very handy to write out the state (true/false) or value (e.g. number from 1 to 100) of any number of flags in the form of a message to a specific unit or even to a spectator. 

Indeed. Until ED provide some better debugging support, this may help you as a stop-gap:

 

  • Like 1
Link to comment
Share on other sites

For what it is worth any given flags state is saved in the debrief.log file on mission end. 

  • Like 2

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

Link to comment
Share on other sites

  • 2 months later...

... a little late to the post, but here is what I use.  Use an F10 Radio flag to run it --

-- 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)

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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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