Delay in a LUA trigger

Discussion in 'Programming' started by ericmarciano, Nov 27, 2025 at 8:48 AM.

  1. ericmarciano

    ericmarciano
    Expand Collapse

    Joined:
    Sep 1, 2021
    Messages:
    99
    I am trying to create a delayed function call in a LUA trigger in the World Editor.
    I tried to use timeEvents option suggested in this old thread: Lua Delay (timer)
    It fails because the 'dt' variable used in the 'process' function appears to be nil, which means 'dtSim' used in the function call is nil. This may be because I use this code from an LUA trigger in which dtSim is not known. When I try using dtSim in the console, it also appears as nil. I am not an expert, I would like to know if there is a possible fix or workaround.
    If a global variable that counts time exists, it would be the solution, but I didn't find this.

    Any help is welcome.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice