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

Using hero XP bar

Status
Not open for further replies.
Level 1
Joined
May 3, 2017
Messages
5
Howdy all,

I'm trying to put together a 2 player survival map which uses the hero XP bar on the command card as an extra stat measure akin to HP and MP, like in for example Don't Starve or Minecraft.

I want to use "simple" values, with 100 health, 100 energy, and most importantly, 100 'hunger' (XP) points. What I dont want is another UI element, like a leaderboard or floating text, to show this.

What I have done is disable creeps and enemy units adding to this bar, by lowering the XP gain stats to 0 (or 0.00 in some cases) in the Gameplay Constants. What I want to do is have the XP bar...

  • start full and decrease over time, with food items that refill the bar by a fixed amount
-OR-
  • start empty and increase over time, with food items that deplete the bar by a fixed amount


With the end result of lowering the hero's energy value, which in terms lowers the hero's health value through triggers. (this I have already done)

So far, I haven't been able to do either on my own. And I'm not well versed enough to figure out how to make leaderboards and other such variables usable and easily readable for both players on my own.

I've searched around and haven't seen anything like this, but it's very likely I might have overlooked something.



Or is there something that's much easier to do that I'm just overlooking?

Any help would be GREATLY appreciated!!


Thanks in advance for any replies
Super
 
Level 1
Joined
May 3, 2017
Messages
5
Yes, but haven't had very good results so far. The trigger I made goes like this:

Events
"Time - Every 4 seconds of game time"
Actions
"Hero - Add -1 experience to *my hero unit*"

It's set it to run after my map initilization. There isn't a problem with the trigger running, because I tested it by spawning items, which successfully spawned every 4 seconds after map init.

If I change "-1 experience added" to "+1 experience added" it just fills the entire XP bar of the hero after the trigger runs once, which isn't helpful.
 
Level 7
Joined
Mar 10, 2013
Messages
366
Yes, but haven't had very good results so far. The trigger I made goes like this:

Events
"Time - Every 4 seconds of game time"
Actions
"Hero - Add -1 experience to *my hero unit*"

It's set it to run after my map initilization. There isn't a problem with the trigger running, because I tested it by spawning items, which successfully spawned every 4 seconds after map init.

If I change "-1 experience added" to "+1 experience added" it just fills the entire XP bar of the hero after the trigger runs once, which isn't helpful.
If you hover you cursor over the xp bar, what x/y values it shows?
 
Status
Not open for further replies.
Top