How many actions can you run?

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Have you been sitting at your computer and thinking how many actions you can run on a trigger before it just dumps the trigger. Well I have an answer for you, just DL this map and copy and paste the trigger from it to your map. It will give you a read out of how many actions your trigger can perform before the trigger is dropped.

The way this works is that it is a controled inf loop, controled meaning it wont crash your game. and as it goes thru the loops it sets how many loops it has done and displays them to you, so the last number will be your max actions. This is a bear bones map so you might get a lower amount in your map then you get in the one I am posting.
 

Attachments

  • Action Count.w3x
    16.2 KB · Views: 147

Exide

I am amazingly focused right now!
Reaction score
448
I'm too lazy to check myself: How many actions CAN a trigger run? :p
Also, please post the triggers you are using in the attached map. :)
 

Exide

I am amazingly focused right now!
Reaction score
448
I got 4545 to, when only showing the counter.
When I did this:
Code:
Actions
    For each (Integer Count[0]) from 1 to 3, do (Actions)
        Loop - Actions
            Set Count[1] = (Count[1] + 1)
            Set ug = (Units in (Playable map area))
            Custom script:   call DestroyGroup(udg_ug)
            Game - Display to (All players) the text: (String(Count[1]))
            Set Count[0] = 0
-I got about 2880.

Let's all try to make a trigger that returns exactly 1, shall we? :thup:
 

Flare

Stops copies me!
Reaction score
662
Let's all try to make a trigger that returns exactly 1, shall we?

Hmmm, by my calculations, you're going to need AT LEAST 14400 actions to do that (I don't know how BJ functions contribute, whether it would be +1 or +however many calls they have)

EDIT: Slightly more accurate script :D
JASS:
globals
    player p1 = Player (0)
    integer start = 0
    integer end = 23075
endglobals

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    loop
    exitwhen start == end
        set start = start + 1
    endloop
    call DisplayTextToPlayer (p1, 0, 0, I2S (start))
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Untitled_Trigger_001, 0.00 )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

Message is displayed up to end == 23075, but it stops at end == 23076 :p

(NOTE: Trigger doesn't execute anymore after first execution, even with a second event :()
 

Exide

I am amazingly focused right now!
Reaction score
448
Hmmm, by my calculations, you're going to need AT LEAST 14400 actions to do that (I don't know how BJ functions contribute, whether it would be +1 or +however many calls they have)

I tried to calculate it as well, but I failed miserably. :p
-Would a loop help us reach these 14400+ actions? :)
 

Jarko89

New Member
Reaction score
1
i put some footmen and added

Code:
Unit Group_ - Pick every unit in (Units in (Playable map area)) and do (Actions)
    Loop - Actions
        Unit_ - Move (Picked unit) instantly to (Random point in (Playable map area))
after 6 seconds, lag became so huge i coulnt even move the mouse. when it finished, i got 2400

PS: memory use had grown from 40k to 220k XD and nevertheless.... No crash :)
 

Exide

I am amazingly focused right now!
Reaction score
448
i put some footmen and added

Code:
Unit Group_ - Pick every unit in (Units in (Playable map area)) and do (Actions)
    Loop - Actions
        Unit_ - Move (Picked unit) instantly to (Random point in (Playable map area))
after 6 seconds, lag became so huge i coulnt even move the mouse. when it finished, i got 2400

PS: memory use had grown from 40k to 220k XD and nevertheless.... No crash :)

No wonder it lagged with that amount of leak. :p
Weird, though.. That you got 2400..
I got 1880-something with the same actions (but cleaning up the leaks). -So more actions but no leaks = smaller value.
 

SerraAvenger

Cuz I can
Reaction score
234
I got 4545 to, when only showing the counter.
When I did this:
Code:
Actions
    For each (Integer Count[0]) from 1 to 3, do (Actions)
        Loop - Actions
            Set Count[1] = (Count[1] + 1)
            Set ug = (Units in (Playable map area))
            Custom script:   call DestroyGroup(udg_ug)
            Game - Display to (All players) the text: (String(Count[1]))
            Set Count[0] = 0
-I got about 2880.

Let's all try to make a trigger that returns exactly 1, shall we? :thup:

Code:
Actions
    For each (Integer Count[0]) from 1 to 3, do (Actions)
        Loop - Actions
            Set Count[1] = (Count[1] + 1)
            Set ug = (Units in (Playable map area))
            Custom script:   call DestroyGroup(udg_ug)
            Game - Display to (All players) the text: (String(Count[0]))
            Set Count[0] = 0

Problem solved. Shows exactly 1.


EDIT:

JASS:
globals
    player p1 = Player (0)
    integer start = 0
    integer end = 23075
endglobals

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    loop
    exitwhen start == end
        set start = start + 1
    endloop
    call DisplayTextToPlayer (p1, 0, 0, I2S (start))
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Untitled_Trigger_001, 0.00 )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

(NOTE: Trigger doesn't execute anymore after first execution, even with a second event :()

Lol.
JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    set start = 0
    loop
    exitwhen start == end
        set start = start + 1
    endloop
    call DisplayTextToPlayer (p1, 0, 0, I2S (start))
endfunction

Tried that?
It will execute, but it will run into an inf loop.

exitwhen start == end


Now,
23076 is not 23075
nor are
23077, 23078, 23079, 23080, 23081, 23082, 23083 etc.
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
The game can handle about 300,000 instructions to the Virtual Machine before you hit the op limit.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top