Limiting unit amount

Stretch

New Member
Reaction score
0
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.

Thanks in advance.
 

Mahrloc

New Member
Reaction score
5
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) > 1
    • 'THEN'
      • Stop training unit(don&#039;t know the order for this sry<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" /> )
    • &#039;ELSE&#039;
    • 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
Reaction score
43
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
Reaction score
0
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
Reaction score
43
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
Reaction score
1,462
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

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top