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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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