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

Applying limits to Gold/Lumber/Food Counters

Status
Not open for further replies.
Level 2
Joined
Dec 13, 2009
Messages
13
Does anyone know how to set limits to gold/lumber/food counters? As in for example in a shooting game, gold would represent number of rounds in the current magazine, lumber would represent the total number of magazines on you. However, what I want to do for the Food limit is that I want to set it as the body temperature on a unit. Say if unit is standing still, their food would decrease at a rate of .3 per second, if the food limit reaches under 65, the unit dies. However if the unit is attacking or running, the unit gains food at a rate of 1 per second.

If anyone knows some way to getting this, please respond. Thank you.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
Gold and Lumber are capped at 1000000 (max) and 0 (min) no mater what you do, you can only display numbers in those ranges. You can write triggers to cap the values to anything inbetween that range however but I am sure you guessed this.

Food you can adjust the maximum in gameplay constants.

The rest of what you want is done via triggers.
 
Level 2
Joined
Dec 13, 2009
Messages
13
So is there a way then that I could write where I want to subtract a number from lumber (lets say "X" for now) and apply that number "X" to the gold counter? But the condition for "X" would only be a number that would add the current number the gold counter has to 100.
 
Status
Not open for further replies.
Top