• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Trying to learn the triggre editor

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, as the title says, im trying to learn the trigger editor. I'm sure there is, but i dont know how i can make this trigger more simplified than this. Any tips?

  • Golem Armor Stack
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Eat Tree
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 1.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 2
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 1.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 3
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 1.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 4
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 2.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 5
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 2.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 6
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 2.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 7
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 3.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 8
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 3.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Eat Tree for (Triggering unit)) Equal to 9
        • Then - Actions
          • Unit - Set Armor of (Casting unit) to ((Armor of (Triggering unit)) + 3.00)
        • Else - Actions
 
Level 21
Joined
Dec 4, 2007
Messages
1,477
1. use the event "starts effect of an ability"
2. you can shorten this trigger by checking if the ability level is 1-3;4-6;7-9
 
Level 5
Joined
Jul 12, 2016
Messages
59
Could use formula:

Set armor = Armor of unit + *Convert Integer to Real*((AbilityLevel-1)/3)+1

Should look like this:
  • Unit - Set Armor of (Triggering unit) to ((Armor of (Triggering unit)) + (Real(((((Level of (Ability being cast) for (Triggering unit)) - 1) / 3) + 1))))
 
Level 7
Joined
Feb 23, 2020
Messages
253
Could use formula:

Set armor = Armor of unit + *Convert Integer to Real*((AbilityLevel-1)/3)+1

Should look like this:
  • Unit - Set Armor of (Triggering unit) to ((Armor of (Triggering unit)) + (Real(((((Level of (Ability being cast) for (Triggering unit)) - 1) / 3) + 1))))

Thank you very much man, that's much prettier than mine lol, can i do similar things if i want the damage to be increased. I.E 50+ per level?
 
Level 5
Joined
Jul 12, 2016
Messages
59
Thank you very much man, that's much prettier than mine lol, can i do similar things if i want the damage to be increased. I.E 50+ per level?

Yeah, I don't see why you couldn't. Just put the entire integer part in a parenthesis and multiply it by 50, so it'd be like:

Set damage = Damage of unit + (*Convert Integer to Real*((AbilityLevel-1)/3)+1) x 50
 
Level 39
Joined
Feb 27, 2007
Messages
4,989
If you can’t find a formula that outputs the values you want, you can also store the level values in an array:

Set SpellArmor[1] = 1.00
Set SpellArmor[2] = 1.50
Set SpellArmor[3] = 4.25
Set SpellArmor[4] = 10.00

Unit - Set armor of (Triggering Unit) you ((Armor of (Triggering Unit)) + SpellArmor[(Level of (Ability being cast) for (Triggering Unit))]
 
Level 7
Joined
Feb 23, 2020
Messages
253
Ahh i see, that will probably be very usefull, thank you all for the help! :)
 
Status
Not open for further replies.
Top