question about: run trigger

mapguy

New Member
Reaction score
46
in my map I have a huge damage detection trigger that checks lots of buffs, condition, absorbs damage, increse resist,.

in a few words, all skills related with damage are inside this trigger.

whe I open this trigger it takes 2 seconds to open, and Im starting to think that I only have 4 heroes yet, and in future it will take like 10 secs to open.

my qustion is:

can I use
Trigger:
  • run trigger (ignoring conditions)

to split my huge trigger in a lot of small ones?

question 2, all units named as triggering unit in the first trigger will also be the triggering unit in the last trigger of my trigger sequence?
Because Im afraid that if I split my triggers it won't work if two units takes damage at the same time.:(

question 3: the new trigger runs when all events of the first trigger ends or in the EXACT moment it is ordered to run ?

example:

trigger 1 starts running
trigger 1 orders trigger 2 to run
trigger 2 starts running
trigger 2 orders trigger 3 to run
trigger 3 starts running
trigger 3 finishes running
trigger 2 finishes running
trigger 1 finishes running

problem solved, I did this:
I place 1 footman, 1 knight, 1 priest in the same place, and then:

Trigger:
  • testando
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Unit - Cause Footman 0000 <gen> to damage circular area after 0.00 seconds of radius 500.00 at (Center of (Playable map area)), dealing 1000000000.00 damage of attack type Spells and damage type Normal


Trigger:
  • tsting
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set x = (Triggering unit)
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Trigger - Run testingo <gen> (ignoring conditions)


Trigger:
  • testingo
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Game - Display to (All players) the text: (Name of x)


when My units were killed I received my messages in this sequence:

priest
priest
priest
footman
footman
footman
knight
knight
knight

it means that when I run trigger that trigger runs in the middle of my trigger.
 

Ayanami

칼리
Reaction score
288
I think if you use the "Run Trigger" action, it won't recognize any "Triggering unit".
 

OneBadPsycho

10100111001
Reaction score
93
It looks like "Triggering Unit" persists through the different triggers. A small test can show it:

Trigger:
  • Noob Test
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Trigger - Run Noob Test Execute <gen> (ignoring conditions)


Trigger:
  • Noob Test Execute
    • Events
    • Conditions
    • Actions
      • Custom script: if GetTriggerUnit() == null then
      • Game - Display to (All players) the text: No unit!
      • Custom script: else
      • Game - Display to (All players) the text: (Name of (Triggering unit))
      • Custom script: endif


When I kill my footman ingame it displays this:

view


1. So yes, you will be able to split up your trigger.

2. Meh... See above.

3. They are run in order. Imagine if you had some if/then/else statements to run certain functions when the right conditions are met and you would see that they are not run at once.

Trigger:
  • Noob Test 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Footman
        • Then - Actions
          • Trigger - Run Noob Test 2 Execute 1 <gen> (ignoring conditions)
        • Else - Actions
          • Trigger - Run Noob Test 2 Execute 2 <gen> (ignoring conditions)


Trigger:
  • Noob Test 2 Execute 1
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Run!


Trigger:
  • Noob Test 2 Execute 2
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Not Run!


As expected:

view


EDIT:

A better example of question 3:

Trigger:
  • Noob Test 3
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Trigger - Run Noob Test 3 Execute 1 <gen> (ignoring conditions)
      • Trigger - Run Noob Test 3 Execute 2 <gen> (ignoring conditions)
      • Wait 2.00 seconds


Trigger:
  • Noob Test 3 Execute 1
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: 1


Trigger:
  • Noob Test 3 Execute 2
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: 2


The numbers show exactly after the unit is dead, and not after 2 seconds!
 

mapguy

New Member
Reaction score
46
It looks like "Triggering Unit" persists through the different triggers. A small test can show it:

thanks for answer 1 and 2, but I think I didn't exaplined well my 3rd question.

this is about if the trigger stops running until the last finishes.
 

OneBadPsycho

10100111001
Reaction score
93
thanks for answer 1 and 2, but I think I didn't exaplined well my 3rd question.

this is about if the trigger stops running until the last finishes.

Ye I noticed that after. I am not quite sure how to test that. This could probably show it:

Trigger:
  • Noob Test 4
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set IsRunning = True
      • Trigger - Run Noob Test 4 Execute 1 <gen> (ignoring conditions)
      • Set IsRunning = False


Trigger:
  • Noob Test 4 Execute 1
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsRunning Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Trigger: Noob Test ...
        • Else - Actions
          • Game - Display to (All players) the text: Trigger: Noob Test ...
      • Game - Display to (All players) the text: Trigger: Noob Test ...


Result:

view


This result could be caused by the fast action calls, so I added a loop to test it:

Trigger:
  • Noob Test 4 Execute 1
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 5000, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsRunning Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: Trigger: Noob Test ...
            • Else - Actions
              • Game - Display to (All players) the text: Trigger: Noob Test ...
      • Game - Display to (All players) the text: Trigger: Noob Test ...


I got the exact same result (x5000); the first trigger was still running, which means it waits for the called trigger to finish.
 

mapguy

New Member
Reaction score
46
I got the exact same result (x5000); the first trigger was still running, which means it waits for the called trigger to finish.

In other words, It dont but if the trigger runs with lots of units in the same time.

thanks.

I hope It works, It would be good to split my 700lines trigger into 10 of 70 lines.
 

OneBadPsycho

10100111001
Reaction score
93
In other words, It dont but if the trigger runs with lots of units in the same time.

thanks.

I hope It works, It would be good to split my 700lines trigger into 10 of 70 lines.

Why wouldn't it ?

I got the exact same result (x5000); the first trigger was still running, which means it waits for the called trigger to finish.
I forgot to mention that this is obviously without waits.
 

Bogrim

y hello thar
Reaction score
154
Yes, triggering unit persists in triggers run with an action. That's not the reason for the lag though, this is:
in my map I have a huge damage detection trigger that checks lots of buffs, condition, absorbs damage, increse resist,
BJs lag a lot, especially the BJ that checks for buffs. If you run 3 triggers that check for a buff once every 0.01 seconds, you should notice how much the game slows down. Splitting the buff detection into a separate trigger and running it only whenever necessary will reduce the lag in your map.
 

mapguy

New Member
Reaction score
46
I do this. But I have to check for buffs when I do damage...
If I don't Ill have to fix a lot of things and turn on and off some conditions (what a head ache)
 
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