Unit limit constant

For AI and campaign script related discussions and questions
Post Reply
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Unit limit constant

Post by NoQ »

I'd like to have a global unit limit constant. Something like maxUnits, that is always equal to 150, so that the scripts still worked if/when it changes on the code side. Cause i recently noticed that it's fairly important for an AI to be aware of this value (so that it didn't wait to fill up the attack groups when he can't produce units any longer, etc.) Probably the same with truck limit of 15.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Unit limit constant

Post by aubergine »

From memory there's an additional constant of something like 999 (or was it 9999) units across all players? Then a per-player limit of trucks and other droids. So the AI needs to be aware of its player limits and the global limits for the game.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Unit limit constant

Post by Per »

Added (3.1):
getDroidLimit([player[, unit type]])
Return maximum number of droids that this player can produce. This limit is usually fixed throughout a game and the same for all players. If no arguments are passed, returns general unit limit for the current player. If a second, unit type argument is passed, the limit for this unit type is returned, which may be different from the general unit limit (eg for commanders and construction droids).
User avatar
Andrie
Regular
Regular
Posts: 533
Joined: 20 Jun 2012, 14:11
Location: Suid Afrika

Re: Unit limit constant

Post by Andrie »

Yes other wise a player can beat Al easy.
"My IRC en multiplay naam is Andrie"

Groete Andrie
Post Reply