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.

Thanks in advance.
 

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) > 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 The Helper:
    it is all percolating man
  • The Helper The Helper:
    TheHelper.net #1!
  • Wizard Wizard:
    #1
  • The Helper The Helper:
    LOL I love this place
  • Wizard Wizard:
    ;D
  • Wizard Wizard:
    We all do.
  • O Old Mountain Shadow:
    So what is next for thehelper.net? Is there a new set goals yet?
  • The Helper The Helper:
    yes we are going to be expanding
    +1
  • The Helper The Helper:
    help more people
  • The Helper The Helper:
    thank you for asking Old Mountain Shadow hell ya@
  • The Helper The Helper:
    Look at Mountain Shadow in the chat!
  • The Helper The Helper:
    welcome to thehelper.net
  • O Old Mountain Shadow:
    thanks although I'm really kind of regretting this name lol ... is there a way to change it out or will I need to make a new account?
    +1
  • Wizard Wizard:
    One of us can change it for you, I believe. Just send me a PM on what you want.
  • Ghan Ghan:
    Some day we should get the feature where you can change your own name.
  • Wizard Wizard:
    Soon!
  • The Helper The Helper:
    did the mountain shadow get his name changed? personally I think Old Mountain Shadow is a kickass name
  • The Helper The Helper:
    but what do i know lol
  • Wizard Wizard:
    No they haven't had their name changed, it is badass xD
    +1
  • O Old Mountain Shadow:
    Thanks, lol! I haven't quite come up with a good new one yet. I was gonna default to one of my older usernames: Cha Zui = tea drunk in Chinese but then decided it too didn't quite fit right. I'm not asian lol... But I am tall, and old spirited which is sort of where the Old Mountain Shadow came about.
  • O Old Mountain Shadow:
    Either way I appreciate the willingness to help me change it! Should I discover something better I'll swap it, but for now ill stay with what I got.
  • The Helper The Helper:
    If you want a change like they said earlier just let us know
    +1
  • Ghan Ghan:
    Patched and rebooted the server this morning.
  • Ghan Ghan:
  • The Helper The Helper:
    dam pwnkit what a name probably perfectly describes it

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top