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

How to detect a hero's exp to next level?

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
There is a cheap way to do it.
Which is creating a dummy hero and leveling it up via triggers.
Then each time, you check how much EXP he has.
Then you store that in an array, and then you can read from that array how much it was.

The "proper" way is to implement the formula of required exp into the game.
That way, you can do it without the need of dummies nor anything else.
 
Level 11
Joined
Jun 2, 2004
Messages
849
The dummy unit one does have the advantage of only having 1 place where the xp curve is defined. If you want to change it later, you only need to modify gameplay constants, instead of having to modify your initialization trigger as well. Duplicated data is a big cause of unnecessary bugs, as people forget to update every place something is defined.
 
Status
Not open for further replies.
Top