Defense scenario counter bug

jmerry

Warlord
Joined
Jan 21, 2010
Messages
122
It's been noted many times; after round 15, the enemy counter in the Defense scenario breaks. Did anyone ever try to figure out why?

It turns out that it's a silly oversight in the Python code; whoever wrote it didn't match the number of enemies actually spawning to the counter, so round 15 ends with only 80 of 115 enemies killed. Rounds 19 and 20 are also off.

The attached file fixes this bug by correcting the counter. Actual enemy spawns are unchanged. (To install, unzip and replace CvEventManager.py in Mods/Defense/Assets/Python)

If you'd rather do it yourself, this changes three lines of code: in the doSetLevelVariables function,
Code:
		if self.iGameLevel == 15:
			self.iSpawnGameTurn = iGameTurn + 16
			self.iTotalMobs = 80
...
		if self.iGameLevel == 19:
			self.iSpawnGameTurn = iGameTurn + 16
			self.iTotalMobs = 62
		if self.iGameLevel == 20:
			self.iSpawnGameTurn = iGameTurn + 31
			self.iTotalMobs = 288
becomes
Code:
		if self.iGameLevel == 15:
			self.iSpawnGameTurn = iGameTurn + 16
			self.iTotalMobs = 115
...
		if self.iGameLevel == 19:
			self.iSpawnGameTurn = iGameTurn + 16
			self.iTotalMobs = 90
		if self.iGameLevel == 20:
			self.iSpawnGameTurn = iGameTurn + 31
			self.iTotalMobs = 286
 

Attachments

Back
Top Bottom