deadlyfishes Posted May 1, 2018 Posted May 1, 2018 (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) endI 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 May 2, 2018 by deadlyfishes "Through The Inferno" - Endless, Dynamic, Open-World Experience for DCS World Website | Discord | Support TTI on Patreon SP Missions: Caucasus | NTTR | Syria | Afghanistan | Iraq | Mariana Islands | Persian Gulf Normandy | South Atlantic | Sinai | Kola | Cold War Germany MP Servers: PvE Server TTI x Pimax - Get discounts on Pimax Headsets
deadlyfishes Posted May 2, 2018 Author Posted May 2, 2018 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 SP Missions: Caucasus | NTTR | Syria | Afghanistan | Iraq | Mariana Islands | Persian Gulf Normandy | South Atlantic | Sinai | Kola | Cold War Germany MP Servers: PvE Server TTI x Pimax - Get discounts on Pimax Headsets
Recommended Posts