• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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