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

Building Limit Trigger

Status
Not open for further replies.

ndh

ndh

Level 8
Joined
Apr 21, 2012
Messages
344
Yeah it seems really simple, but for some reason i can't get it. What i am trying to do is limit the amount of structures you can have of a certain type. This is usually pretty easy i know, but the problem is, the structure that i want a limit on upgrades several times. So how do i make it so that no matter what upgrade the building is at, you can only have, say, 10 of that structure.
 
Level 11
Joined
Feb 23, 2009
Messages
577
Use math my friend :)... I'll give you an example:

What you need:

Integer_A ([Integer]Make it)
Group_A ([UnitGroup]Make it)

-Say you want 5 maximum soldiers.

Soldiers = Axeman OR Swordman OR Stabber

Set Group_A = units of type Axeman OR Swordman OR Stabber (All your soldiers)

Set Integer_A = number of units in Group_A

Set maximum units to 5 - Integer_A

Execute the trigger every 0.03 sec! There ya go :)
 
  • Like
Reactions: ndh

ndh

ndh

Level 8
Joined
Apr 21, 2012
Messages
344
Use math my friend :)... I'll give you an example:

What you need:

Integer_A ([Integer]Make it)
Group_A ([UnitGroup]Make it)

-Say you want 5 maximum soldiers.

Soldiers = Axeman OR Swordman OR Stabber

Set Group_A = units of type Axeman OR Swordman OR Stabber (All your soldiers)

Set Integer_A = number of units in Group_A

Set maximum units to 5 - Integer_A

Execute the trigger every 0.03 sec! There ya go :)

Thanks! +rep
 
Status
Not open for further replies.
Top