JG78_horΛz Posted yesterday at 08:51 AM Posted yesterday at 08:51 AM Hi, I’m building missions with very complex trigger conditions. Many of them are no longer manageable with the click-based editor, so I want to switch as much as possible to Lua predicates. The problem: I cannot find any complete reference that lists which functions, condition types, or global objects are actually available in the Lua predicate context. Is there an official or unofficial list of what is valid inside a predicate? I’m not looking for the regular DCS scripting API, but specifically what the Mission Editor allows and evaluates inside the LUA predicate field. If no documentation exists, a short technical explanation of how the predicate environment is set up internally would already help. Thanks, Patrick [sIGPIC][/sIGPIC] https://www.jagdgeschwader78.com/
kira_mikamy Posted 1 hour ago Posted 1 hour ago I suggest using MOOSE if you need to handle complex trigger logic. I’ve completely stopped using the Mission Editor’s built-in triggers..they’re just poorly designed. Anyway, a Lua Predicate condition must return either true or nil to be considered valid. It simply executes the scripting engine code written in the text box. The code must include the statement return true for the condition to evaluate as true , that’s basically it. For example: return timer.getTime() > 300 This means the trigger will activate once 300 seconds have passed since the mission started. In short, it’s a way to create conditions that don’t exist natively in the Mission Editor. But be aware: this method checks the condition every second, so it can become a performance killer if you run complex calculations. In that case, it’s better to use MOOSE with a scheduler instead.
Recommended Posts