A Little Help please.

kairob

Biohazard
Joined
May 26, 2005
Messages
3,085
Location
The North
Here is some Python taken from Barbs.py

self.spawnUnits( iBarbarian, (86, 31), (100, 41), con.iWarElephant, 1, iGameTurn, 6-iHandicap, 4, utils.outerInvasion, 0)

I have a few questions about this. What do the numbers 1, 4 and 0 here determine?
Secondly the appear to be 2 coordinates given, should I assume that this forms a box and the unit appears randomly within said box?
Can impassable terrain be in this box, like mountains and sea?

Thanks a lot in advance for anyone who knows the answers to this. :)
 
The answer is in the method definition, further down in the code:
def spawnUnits(self, iCiv, tTopLeft, tBottomRight, iUnitType, iNumUnits, iTurn, iPeriod, iRest, function, iForceAttack):
Does this answer your question? (Don't pay any attention to any instance of "self" - those are basically nonsensical.)

Regarding the area coordinates - yes, there will be a random plot within that area, but invalid tiles (Peaks, Marsches, Sea, Cities) will be ignored.
 
Top Bottom