Unit Caps

Unit Caps

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Unit Caps

Post by oksnoop2 »

How do i do Unit limits. When i say unit limit i mean each unit has it's own unique pop limit. An example would be the population control in Age of Empires 3.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Unit Caps

Post by SinbadEV »

don't know personally but I know for sure that it's being done in Gundam, so you could check there.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Unit Caps

Post by Forboding Angel »

unitlimit = #

is the tag I believe.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Unit Caps

Post by Argh »

You can do it via unitlimit, or you can write some custom Lua that cancels the Unit if you attempt to build it. See AllowUnitCreation() in LuaCallinReturn, Lua documentation.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: Unit Caps

Post by oksnoop2 »

Forboding Angel wrote:unitlimit = #

is the tag I believe.

I tried putting that in my unit lua:

Code: Select all

  yardMap                       = [[ooooooooo]],
  script                        = [[bmex.lua]],
  unitlimit                     = 1,

  featureDefs                   = {
It still built more than one mex. Am I doing it wrong?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Unit Caps

Post by Forboding Angel »

Damnit, I knew it was something retarded:
unitRestricted = 1,
User avatar
SanadaUjiosan
Conflict Terra Developer
Posts: 907
Joined: 21 Jan 2010, 06:21

Re: Unit Caps

Post by SanadaUjiosan »

Cool, thanks a lot.
Post Reply

Return to “Game Development”