• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
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.
 
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.
Back
Top