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

Giving xp to hero

Status
Not open for further replies.
Level 7
Joined
Jan 29, 2008
Messages
47
Well, even after going through all GUI functions and Galaxy natives I couldn't find a single function, that lets you add XP to a unit.
I think this is pretty weird, considering the fact, that there are XPGain events, you can read out the event XP, the current XP and level of a unit. Why is a function missing that adds experience to a unit? I just can't get it into my head.

Unless somebody knows, how it's done. I already know, that some people played with the thought to let the unit in question kill another units via trigger, which gives just the wanted XP, but that's ... an ugly way of doing things.

Sorry for double posting, but at least I got an answer.

Apparently it is possible to add experience - with effects. Just create a unit modifying effect, edit the 'experience' field and then apply that effect to your hero. The disadvantage of this is, that you now only have one fixed experience value. So you either create an effect with 1 XP and apply it as often, as you need to get your desired total experience, or you create a clever system, which does this itself, by using different effects, with different experience values.
Sounds complicated? Rejoice! It has already been done, you can find the test map there:
http://forums.sc2mapster.com/develo...formation-map-hero-revive-give-experience/#p1

All credits to zifoon, for creating this system. (he also created a hero respawn system, pretty weird but the best we got so far)
 
Last edited by a moderator:
Status
Not open for further replies.
Top