• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Building Limit Trigger

Status
Not open for further replies.

ndh

ndh

Level 8
Joined
Apr 21, 2012
Messages
343
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.
 
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
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.
Back
Top