• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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 22
Joined
Dec 4, 2007
Messages
1,506
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 40
Joined
Feb 27, 2007
Messages
5,147
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