• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Triggering Experience

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, i want to make a trigger that increases the expierence gain for every 10th level

  • Experience Award
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Hero - Add 30 experience to (Picked unit), Show level-up graphics
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Equal to 10
            • Then - Actions
              • Hero - Add 100 experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Equal to 20
            • Then - Actions
              • Hero - Add 140 experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Equal to 30
            • Then - Actions
              • Hero - Add 200 experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Equal to 40
            • Then - Actions
              • Hero - Add 260 experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Equal to 50
            • Then - Actions
              • Hero - Add 320 experience to (Picked unit), Show level-up graphics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Picked unit)) Equal to 60
            • Then - Actions
              • Hero - Add 400 experience to (Picked unit), Show level-up graphics
            • Else - Actions
This trigger seems to only work at the specific hero levels, how do i fix this?
Hope i'm being clear enough for you to understand my point :p
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
The conditions, input greater than or equal to and less than comparisons
to make it work with certain levels only;

  • (Hero level of (Picked unit)) Greater than or equal to 10
  • (Hero level of (Picked unit)) Less than 20
  • (Hero level of (Picked unit)) Greater than or equal to 20
  • (Hero level of (Picked unit)) Less than 30
  • (Hero level of (Picked unit)) Greater than or equal to 30
  • (Hero level of (Picked unit)) Less than 40
  • (Hero level of (Picked unit)) Greater than or equal to 40
  • (Hero level of (Picked unit)) Less than 50
  • (Hero level of (Picked unit)) Greater than or equal to 50
I hope that's clear enough for you to understand too :)
 
Level 7
Joined
Feb 23, 2020
Messages
253
The conditions, input greater than or equal to and less than comparisons
to make it work with certain levels only;

  • (Hero level of (Picked unit)) Greater than or equal to 10
  • (Hero level of (Picked unit)) Less than 20
  • (Hero level of (Picked unit)) Greater than or equal to 20
  • (Hero level of (Picked unit)) Less than 30
  • (Hero level of (Picked unit)) Greater than or equal to 30
  • (Hero level of (Picked unit)) Less than 40
  • (Hero level of (Picked unit)) Greater than or equal to 40
  • (Hero level of (Picked unit)) Less than 50
  • (Hero level of (Picked unit)) Greater than or equal to 50
I hope that's clear enough for you to understand too :)

Ah yes man, that was quite obvious lol, thank you very much mate! :)
 
Level 7
Joined
Feb 23, 2020
Messages
253
200 is (default) amount of expirience required to reach lvl 2.
777, 100000 and any you like are amount required for lvl 3, lvl 4 etc.

So if i want 100 levels possible, i'd have to create 100 of those numbers? Seems a bit slow
 
Level 12
Joined
Jan 30, 2020
Messages
875
Hello there.
yes @Deserted 's approach is the right one.

For information, on the conditions earlier, it could have been done much easier with a single modulo calculation.

Something like
  • test
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
      • ((Killing unit) is A Hero) Equal to True
    • Actions
      • Hero - Add (20 + (60 x ((Hero level of (Killing unit)) mod 10))) experience to (Killing unit), Show level-up graphics
I know it's not the best method for this specific problem, but I just wanted to point this to help you for future situations like this one.
 
Level 6
Joined
Dec 31, 2017
Messages
138
So if i want 100 levels possible, i'd have to create 100 of those numbers? Seems a bit slow
It's not really slow compared to 10 If statements. It's more flexible and user-friendly as well.

Also, there are options to set all the values at once, but to use them one should get acknowledged with mathematical concepts like recursion and fibonacci numbers.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Oh I missed this
So if i want 100 levels possible, i'd have to create 100 of those numbers? Seems a bit slow

Well in all fairness, if you plan for very high levels, the method I just posted is probably by far the easiest then.
 
Status
Not open for further replies.
Top