exil Posted February 15, 2019 Posted February 15, 2019 Gentlemen, i need some help with a "time since flag" trigger. I did something like this: ONCE -> some condition -> do script: if Unit.getByName('unitxxx'):isActive() then trigger.action.setUserFlag(10, true) end followed by: SWITCHED CONDITION -> time since flag (10, 30) -> activate Group (yyy) But actually nothing happens. If i exchage "time since flag" with "flag is true (10)" everything is working fine. Any help would be appriciated! GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals
dark_wood Posted February 15, 2019 Posted February 15, 2019 Try with a value for flag : ONCE if Unit.getByName('unitxxx'):isActive() then trigger.action.setUserFlag(10, 1) end then you can check it with: SWITCHED CONDITION if trigger.misc.getUserFlag(10) == 1 then trigger.action.activateGroup(Group.getByName('yyy')) end I can't test it right now, so let me know the result.
dark_wood Posted February 15, 2019 Posted February 15, 2019 Ok, forget about what i said in my previous post - the solution is much more simple: just ad a semicolon before end statement: if Unit.getByName('unitxxx'):isActive() then trigger.action.setUserFlag(10, true)[color="Red"];[/color] end See attched mission as example.test.miz
exil Posted February 16, 2019 Author Posted February 16, 2019 Perfect! That worked! Thank you very much dark_wood. That saved me a lot of time! Out of curiousity: What does the semicolon do? GeForce RTX 4090 Founders Edition - AMD Ryzen 7 5800X3D - 64Gb RAM - Win11 - HP Reverb G1 - Thrustmaster Warthog HOTAS (40cm extension) - VKB Sim T-Rudder MKIV Pedals
dark_wood Posted February 16, 2019 Posted February 16, 2019 with pleasure :) well, it's just the correct syntax for LUA language, it must know where your statements ends, that's all
Recommended Posts