• 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.

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 64
Joined
Jan 18, 2005
Messages
27,287
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