in wich order do triggers fire?

LightChaosma

New Member
Reaction score
60
i have 2 triggers.

a critical trigger. it uses a damage detection system, and basicly is a copy of critical strike.

when you have the buff Lightning slash active, you will satisfy the condition of the 2nd trigger. wich also uses the DDS.

the 2nd trigger adds the damage dealt back to the target. then it uses the damage thingy in the GUI to deal the damage dealt + a bit.

i want the critical trigger not to run on the initial damage when you have the buff lightning slash, but i do want it to run when the calculated damage is dealt...

i cant find a better way to explain what i want.

here is my current triggers:

Trigger:
  • critical
    • critical
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Critical Hit for GDD_DamageSource) Greater than 0
    • Actions
      • Set tempUnitG[1] = (Units in (Playable map area) matching ((Matching unit) Equal to GDD_DamageSource))
      • Unit Group - Pick every unit in tempUnitG[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Random integer number between 1 and 100) Less than or equal to ((Load (Key CriticalChance) of (Key (Picked unit)) from Critical) + (5 x (Level of Critical Hit for GDD_DamageSource)))
                  • True Equal to True
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Set tempreal[1] = (GDD_Damage x (75.00 + (((Real((Level of Critical Hit for (Picked unit)))) - 1.00) x 25.00)))
              • Set tempreal[1] = (tempreal[1] x (1.00 + ((Load (Key CriticalDamageBonus) of (Key (Picked unit)) from (Last created hashtable)) / 100.00)))
              • Set temppoint[1] = (Position of (Picked unit))
              • Unit - Cause (Picked unit) to damage GDD_DamagedUnit, dealing tempreal[1] damage of attack type Normal and damage type Normal
              • Floating Text - Create floating text that reads ((String((Integer(tempreal[1])))) + !!) at temppoint[1] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
              • Floating Text - Set the velocity of (Last created floating text) to 50.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
              • Custom script: call RemoveLocation (udg_temppoint[1])
              • Trigger - Turn on (This trigger)
            • Else - Actions


Trigger:
  • Lightning Slash
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource has buff Lightning slash ) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Set temppoint[1] = (Position of GDD_DamagedUnit)
      • Unit - Set life of GDD_DamagedUnit to ((Life of GDD_DamagedUnit) + GDD_Damage)
      • Set tempreal[1] = (GDD_Damage + (1000.00 x (1.00 + 1.00)))
      • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing tempreal[1] damage of attack type Spells and damage type Normal
      • Special Effect - Create a special effect at temppoint[1] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set tempreal[1] = ((Mana of GDD_DamageSource) - 5.00)
      • Unit - Set mana of GDD_DamageSource to tempreal[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • tempreal[1] Less than or equal to 0.00
        • Then - Actions
          • Unit - Remove Lightning slash buff from GDD_DamageSource
        • Else - Actions
          • Do nothing
      • Trigger - Turn on (This trigger)
      • Custom script: call RemoveLocation (udg_temppoint[1])


please dont come with the answer: why not add the extra damage in a passive skill... cause there will be triggers with the same problem where the extra damage is random
 

Slapshot136

Divide et impera
Reaction score
471
If they have the same event I think it's top-down based on the order of the trigger in the trigger editor

an easy way to keep is simple tho:
create 1 trigger with that event that runs the other 2 in the order you want,
and remove the event from the other 2
 

LightChaosma

New Member
Reaction score
60
If they have the same event I think it's top-down based on the order of the trigger in the trigger editor

an easy way to keep is simple tho:
create 1 trigger with that event that runs the other 2 in the order you want,
and remove the event from the other 2

goo idea, i'll try that tommorow, i have to go to bed now...
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
They fire at the same time.

Only 1 trigger can run at a time, so they can't fire at the same time.

It will most likly go in order of which trigger loaded first, if you want 1 to load over the other I would sugest preloading it.
 

ZugZugZealot

New Member
Reaction score
33
It will most likly go in order of which trigger loaded first, if you want 1 to load over the other I would sugest preloading it.
That's false, try doing...
Trigger:
  • A
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: First
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Third


Trigger:
  • B
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Wait 0.50 seconds
      • Game - Display to (All players) the text: Second
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Fourth

It creates a thread for each trigger instance that's fired, and it will release the thread when done. Same applies to expiring timers.

If you did the order right, it should go "First, Second, Third, Fourth" if you have the order swapped it will do "Second, First, Fourth, Third"

Order is based on the order the triggers were created.

Calls to the trigger initializations are added to the InitCustomTriggers() function progressively on trigger creation. Since I created A first, its initialization will be called first, and along with that, its event will be registered first, making it "first in line".
JASS:
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_A()
    call InitTrig_B()
endfunction
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Triggers with the same event run in the order they are listed in the compiled JASS file within the map file. For GUI triggers, the order they get written into that file seems to be random within each trigger category, although the order of trigger categories seems to be preserved. (Eg. if you have category A with triggers 1 and 2, and below that you have category B with triggers 3 and 4, then 1 and 2 will always run before 3 and 4, but there's no guarantee whether 1 will run before 2, or 3 before 4.)

It's possible to trigger other triggers within the execution of a trigger. :)nuts:) Either by using the Run action, or by tripping the event of another trigger (eg. causing damage), the newly executed trigger will do its actions until its thread terminates (eg. the trigger is finished, or waiting), and then the first trigger will continue with its actions from where it was.

FYI, the way GDD is coded, if a trigger causes damage, then all (not disabled) damage triggers will run again with the new source/target/damage, and once those are done, the remaining triggers will continue running with the original source/target/damage.

In your situation, you'll need to be careful to not create an infinite loop between the two triggers - when your crit ability deals its damage, it could trigger Lightning Slash.



What you could do is to give the crit strike trigger the condition ((GDD_DamageSource has buff Lightning slash ) Equal to False) or ((Lightning Slash <gen> is on) Equal to False) (where the second condition is the boolean comparison Trigger - Trigger Is On.) This way, the crit trigger will only run when Lightning Slash will not run (or is already running).
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
That's false, try doing...
Trigger:
  • A
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) the text: First
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Third


Trigger:
  • B
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Wait 0.50 seconds
      • Game - Display to (All players) the text: Second
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Fourth

It creates a thread for each trigger instance that's fired, and it will release the thread when done. Same applies to expiring timers.

If you did the order right, it should go "First, Second, Third, Fourth" if you have the order swapped it will do "Second, First, Fourth, Third"

Order is based on the order the triggers were created.

Calls to the trigger initializations are added to the InitCustomTriggers() function progressively on trigger creation. Since I created A first, its initialization will be called first, and along with that, its event will be registered first, making it "first in line".
JASS:
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_A()
    call InitTrig_B()
endfunction

The wait pauses the first trigger allowing the secound trigger to run. So it is still only 1 trigger running at a time. So as I said, only 1 trigger can run at a time.
 

LightChaosma

New Member
Reaction score
60
If they have the same event I think it's top-down based on the order of the trigger in the trigger editor

an easy way to keep is simple tho:
create 1 trigger with that event that runs the other 2 in the order you want,
and remove the event from the other 2

with help of some booleans and if statements this works, thx, +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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

      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