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

Variable- unit group to integer?

Status
Not open for further replies.
Level 4
Joined
Aug 30, 2008
Messages
82
So what im trying to do is, make a system so that players cannot have more then X gold. in other words, theres a limit to how much gold a player can have, and that limit depends on how many buildings of unit type "bank" they have.

im new to variables. maybe what im trying to do wont work anyway.



The system i want though would look something like this

0 banks owned by player red - gold limit is 500
1 banks owned by player red - gold limit is 1000
2 banks owned by player red - gold limit 1500


This is what ive got so far...

Events: Player 1 [Red]'s Current gold becomes greater then 500

Conditions: VariableHere equal to 0

Actions: Set Player 1 [Red] Current gold to 500


not sure if im on the right track...so...

Any help or even a point in the right direction is much appreciated, i suck with variables...

Thanks...


Edit: the system i want is similar if not exact to the one in the map, missile war.
 
Last edited:
Level 4
Joined
Jan 9, 2010
Messages
89
Hey! Here is a trigger that sets the gold limit as you wanted. No variables needed.

  • Untitled Trigger 002
    • Events
      • Player - Player 1 (Red)'s Current gold becomes Greater than (((Real((Number of living Town Hall units owned by Player 1 (Red)))) x 500.00) + 500.00)
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Current gold to (((Number of living Town Hall units owned by Player 1 (Red)) x 500) + 500)
 
Status
Not open for further replies.
Top