Jump to content

Possible to include flag value in message?


Derk
 Share

Recommended Posts

Hi there,

 

Is it possible to display a message that contains a flag's value?

ie message: "[flag 1 value] units of supplies have been delivered to Tblisi. Tblisi now has a total of [flag2 value (flag2 + flag1)] units of supplies."

 

Thank you.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Yes, but you must use the simulator scripting engine. The relevant code I am using is detailed here: http://en.wiki.eagle.ru/wiki/Simulator_Scripting_Engine/DCS:_World_1.2.1/Part_1

 

do 
local x = trigger.misc.getUserFlag('1')
local y = trigger.misc.getUserFlag('2')

y = y + x
trigger.action.outText(x .. ' units of supplies have been delivered to Tblisi. Tblisi now has a total of ' ..  y .. ' units of supplies.' , 20)

trigger.action.setUserFlag('2', y)
end

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

Current Projects: Scripting Wiki, Something...

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD, IADScript, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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