• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger with no "operations" limit

Level 6
Joined
Sep 5, 2007
Messages
264
I don't know if anyone else has done this, so I'm sorry if I haven't seen it.

I've found a way to get around that annoying "operations" limit with triggers and functions, the limit that stops a function dead in its tracks as soon as it hits it. It does create an extra temporary trigger though.

In JASS you can just use:
JASS:
    function DoLotsMoreExecutions takes nothing returns nothing
        local trigger trig = GetTriggeringTrigger()
        call TriggerClearActions(trig)
        call DestroyTrigger(trig)
        set trig = null

        ... <more code that misses the limit>
    endfunction

    function DoLotsOfExecutions takes nothing returns nothing
        local trigger trig

        ... <other code that just misses the limit>

        set trig = CreateTrigger()
        call TriggerAddAction(trig, function <DoLotsMoreExecutions>)
        call TriggerExecute(trig)
        set trig = null
    endfunction

I know that this probably isn't the most efficient way to do things, but it's about the only way I've found, and I've spent a fair bit of time trying other ways.

The main reason people would use this is when handling/creating a large amount of objects (in my case, destructables) where it is VERY easy to hit that annoying ~8000 executions limit...

EDIT: There is a limit on how many of these that you can do... I just tried putting about 15 off one trigger and WC3 won't load the map, so I'll investigate further.

I hope this helps...
 
Last edited:
Top