- Joined
- Jul 21, 2020
- Messages
- 67
So, I'm working on changing my map over to Lua and had a performance question about triggers.
Say I have 5 GUI triggers "Unit starts the Effect of an Ability" each having a separate condition and in Lua I'm thinking it would be easier if I have 1 trigger created for that event, and then in the Actions that are added, I add functions for each use that would resolve conditions inside the function.
Something like this:
Does that make sense? Wondering from a performance perspective if that would be something that would be as fast as doing it the traditional TriggerAddCondition way.
Say I have 5 GUI triggers "Unit starts the Effect of an Ability" each having a separate condition and in Lua I'm thinking it would be easier if I have 1 trigger created for that event, and then in the Actions that are added, I add functions for each use that would resolve conditions inside the function.
Something like this:
Lua:
local t = CreateTrigger()
TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
TriggerAddAction(
t,
function()
spell1()
spell2()
spell3()
spell4()
end
)
Does that make sense? Wondering from a performance perspective if that would be something that would be as fast as doing it the traditional TriggerAddCondition way.