Jump to content

Recommended Posts

Posted (edited)

Hey all,

 

Looking to convert my simple missions into lua script instead of using the ME triggers.

 

Yes, I know about MOOSE and I utilize many aspects of it for more complex missions.

 

I'm looking to convert some triggers into lua to make switching over to new maps easier, without having to make the same triggers again.

 

How would one go about doing the following:

 

SWITCHED CONDITION > CONDITION Flag 1 is TRUE > ACTION Message to all "Blah" Flag Off 1

 

I already know how to set actions:

        trigger.action.outText("<< omg it worked >>", 10)
   trigger.action.outSound("BD_00007 single beep2.ogg" )
   trigger.action.setUserFlag('1120', false)

But I'm looking to do something like this, and I can't seem to properly script it:

 

if trigger.misc.getUserFlag(1120) == true then
   trigger.action.outText("<< omg it worked >>", 10)
   trigger.action.outSound("BD_00007 single beep2.ogg" )
   trigger.action.setUserFlag('1120', false)
end

I heard that LUA Predicate is back https://forums.eagle.ru/showthread.php?t=201188&highlight=LUA+PREDICATE , so maybe this is possible now, if it wasn't before?

 

Any insight would be greatly appreciated, thanks all!

Edited by deadlyfishes

"Through The Inferno" - Endless, Dynamic, Open-World Experience for DCS World
Website | Discord | Support TTI on Patreon

 
Posted

With Grimes' help, I figured it out:

 

 

local function main()
timer.scheduleFunction(main, {}, timer.getTime() + 1)  

--Easy A2A INIT
if trigger.misc.getUserFlag('1116') == 1 then
   
   trigger.action.outTextForCountry( 1, "<< omg it worked >>", 10)
   trigger.action.outSoundForCountry( 1, "radio click.ogg" )
   a2a_easy_start()
   trigger.action.setUserFlag('1116', false)
   
end
end
main()

 

I am able to trigger my mission start with the function that I already defined: a2a_easy_start()

"Through The Inferno" - Endless, Dynamic, Open-World Experience for DCS World
Website | Discord | Support TTI on Patreon

 
  • Recently Browsing   0 members

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