• 🏆 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!

[GUI] How to get small amounts of experience

Status
Not open for further replies.
Level 4
Joined
Jan 22, 2019
Messages
15
Hello, how are you? I hope you're well :peasant-cheers-back:

In my map that I am developing, I have a system that gives attribute points (wood) to the character as the level evolves. But when a character does a quest that gives him a lot of experience and ends up leveling up for example 10 levels at a time, instead of earning the amount of points for those levels, I get just points to like 1 level.

I wonder if there is any simple way to solve this, without having to trigger each creep or split xp on each mission.
I was thinking of something like a trigger that limits the maximum experience the character can get per second, without disturbing the amount of total xp the mission returns. This in itself can be a big problem if my character is at the maximum level and is limited to little experience per second.

Any ideas on how to make this trigger?
:peasant-thinking:
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,540
From what I understand you have a trigger like this
Event: A Hero levels up
Actions: Add 1 lumber to the owner of that Hero

And the issue is that when a Hero levels up from say level 2 to level 5, you only get 1 lumber instead of 3?

I added a map with a solution to this issue. It uses a Unit Indexer which I highly recommend using if you don't have one already. All you have to do is copy and paste the Level Up folder into your map and you should be all set. Note that I made this using the latest version of warcraft 3 so if you aren't up to date then it probably won't work (you can use an older Unit Indexer to make it work).

Here's the trigger that works in conjunction with a Unit Indexer. All we have to do is remember what level our Hero was before it leveled up and what level it is after it leveled up and we can figure out how much lumber to add. If our Hero went from level 2 to level 5, then we simply do 5 - 2 and get 3. Then we add 3 lumber.
  • Level Up
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • Set UDex = (Custom value of (Triggering unit))
      • Set LevelLumber = ((Hero level of (Triggering unit)) - PreviousLevel[UDex])
      • Set PreviousLevel[UDex] = (Hero level of (Triggering unit))
      • Player - Add LevelLumber to (Triggering player) Current lumber
There's some extra triggers called "type 1", "type 2", "type 3", that you should delete. They're just meant for testing the system out in my map.
 

Attachments

  • Level Up.w3x
    21.8 KB · Views: 27
Last edited:
Status
Not open for further replies.
Top