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: 153
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. :)
 
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:
 
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 :()
 
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? :)
 
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 :)
 
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.
 
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.
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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