- Joined
- Apr 16, 2025
- Messages
- 160
I've heard this is possible.
For example, I could create a trigger: "unit enters the map", and then do something like:
local unit u = GetTriggerUnit()
call TriggerSleepAction(15.0) // or PolledWait
call KillUnit(u)
But I've also heard that PolledWait/TriggerSleepAction is really bad — it can cause desyncs or even crash the game under heavy load — so everyone recommends using a timer instead. The problem is that timers usually require writing the triggered unit into a global variable (often with arrays), which feels rather clumsy.
I remember hearing that timers can "carry" local variables into the callback function (so you don’t need to store them globally or in a hashtable). In older versions of WC3 this was definitely possible, but maybe there’s some workaround in Reforged? From what I’ve read, though, this feature seems to have been removed or works differently in Reforged — unless someone knows otherwise.
Any tips would be appreciated!
For example, I could create a trigger: "unit enters the map", and then do something like:
local unit u = GetTriggerUnit()
call TriggerSleepAction(15.0) // or PolledWait
call KillUnit(u)
But I've also heard that PolledWait/TriggerSleepAction is really bad — it can cause desyncs or even crash the game under heavy load — so everyone recommends using a timer instead. The problem is that timers usually require writing the triggered unit into a global variable (often with arrays), which feels rather clumsy.
I remember hearing that timers can "carry" local variables into the callback function (so you don’t need to store them globally or in a hashtable). In older versions of WC3 this was definitely possible, but maybe there’s some workaround in Reforged? From what I’ve read, though, this feature seems to have been removed or works differently in Reforged — unless someone knows otherwise.
Any tips would be appreciated!
Last edited:

