# Limiting unit amount

#### Stretch

##### New Member
Hey guys, What I want is to limit the amount of units a player can have while not including specific types of units such as builders and civilians, The limit I am wanting is 1000 so can't use the food limit as I can only get that to be 300.

if you don't understand what I want just please ask and I will try explain again.

#### Mahrloc

##### New Member
the easiest way i could imagine is to check the amount of units in the map everytime a unit is trained.

Trigger:
• Limit Units
• Events
• Unit - A unit Starts training a unit
• Conditions
• Actions
• Set Unit_Group = (Units owned by (Owner of (Triggering unit)))
• Unit Group - Pick every unit in Unit_Group and do (Actions)
• Loop
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• 'IF'
• (Unit-type of (Picked unit)) Equal to //Unit with food cost 1
• 'THEN'
• Set Counter = (Counter + 1)
• 'ELSE'
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• 'IF'
• (Unit-type of (Picked unit)) Equal to //Unit with food cost 2
• 'THEN'
• Set Counter = (Counter + 2)
• 'ELSE'
• Set Unit_Group2 = (Units of type //food producing building)
• Set Counter2 = (Units in Unit_Group2) * //amount of food they provide )
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• 'IF'
• (Counter / Counter) &gt; 1
• 'THEN'
• Stop training unit(don't know the order for this sry<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" data-shortname=":(" /> )
• 'ELSE'
• Set Counter = 0
• Set Counter2 = 0
• Custom script: call DestroyGroup(udg_Unit_Group)
• Custom script: call DestroyGroup(udg_Unit_Group2)

you somehow still have to add the food costs of the trained units to Counter but atm i got no clue how to sry^^'

#### Ashlebede

##### New Member
Having 1000 units per player would be... excessively excessive. I really don't suggest it, there is a reason why there is a 300-food limit. 1,000 units per player would mean an unplayable map.

#### Stretch

##### New Member
The reason for 1000 is that my map is a village builder map and having large armies is key, I am wanting to limit it to 1000 because at the moment people are making far more than that and causing graphics glitches causing massive lagg but I don't want to remove the fun of having a massive army, my units are halved from their original size and camera zoomed out to make controlling them possible.

#### Ashlebede

##### New Member
1,000 units will always make the map lag, unless you have an omg wtf imbaaa computer. Especially since you can only control 12 units at a time. And it would screw up their AI. Keep in mind that Warcraft3 units are 3-D models that ain't pre-rendered and that having too many units will make them "slow-minded". Make every unit cost 1 food and set food limit to 300. Make your units stronger if necessary. That is all.

#### Accname

##### 2D-Graphics enthusiast
1000 units will not just make it lag but the game will most definitely not work. since more then 200 units owned by the same player will make the standard ai messy and not work.

General chit-chat
Help Users
• No one is chatting at the moment.
• The Helper:
oh shit Hatebreeder is on the site
• Ghan:
Site Log, 1/7/22: TH changed his avatar today. Speculation among the crew is that this heralds the end times are upon us. Only time will tell.
+1
• jonas:
TH changed profile pictures before no hasty conclusions
• jonas:
didn't he used to have just TH in blue letters or something like that?
• The Helper:
I have had a number of different profile pics in the past - I just changed it to the NUON award pic because there is stuff going on with NUON right now hint hint
• The Helper:
plus I just added an Atari Jaguar forum lol maybe Ghan is right about the end times lol
• The Helper:
If I can get this NUON stuff going that is going to be good
• The Helper:
on a side note and totally out of nowhere I am buying a bass guitar and am going to try and learn it
+1
• The Helper:
I am about to go to a friends house and dig his Atari Jaguar collection out of the attic and get it ready to sell
• The Helper:
and my friend is such a slacker he could only put his hands on the base jag and cd unit no wires, power supply or games they are still buried somewhere in the attic for another time.
• The Helper:
250 Members online and most of them looking at American Airlines below economy class post that I bumped the other day LOL
• The Helper:
actually 249 guest not members
• Varine:
Is there even 250 members that have logged in in the last couple years? I feel like there's maybe 30 of us
• The Helper:
I am not tracking that stat but I would have to say probably not
• tom_mai78101:
Would like to get some annual forum statistics report.
• The Helper:
there are stats in the xenforo forum admin section and we have matomo stats we started collecting beginning of the year so we will not have annual on that until next year
• The Helper:
• The Helper:
since I started jacking with the bots on the site we doubled our page views on the site in a week lol
• The Helper:
I have been having lots of fun
• The Helper:
we have had like 6000 views of the American Airlines economy class thread in the last week
• The Helper:
I ought to stick a travel affiliate link or something on that page to try and monetize that they are just going there and leaving it might even be bots I am not sure
• The Helper:
I just got into it with the Atari VCS Facebook Moderator I started trolling him and almost got banned
• The Helper:
They deleted one of my posts one time so I was trolling him on a help post I put up because I am evil I guess and bored and the guy handled it well I loved his attitude Atari has a good social media presence even if they do not have many games.
• The Helper:
The French Atari they call them even though they are like totally based in America they just have French Money coming in. Gotta love it