Afterworld - Combat Sentinel II+

xanaqui42

King
Joined
Sep 5, 2006
Messages
780
There is a defect in the python code for Combat Sentinel II and III. Here is an attempt at a fix. Use this file in place of CvAfterworldEvents.py. Obviously, back up your present file before trying this.

Code:
			iSpawnTimerValue = pUnitData.getSpawnTimer()
			iSpawnTimer2Value = pUnitData.getSpawn2Timer() #defect fix
			iSpawnTimer3Value = pUnitData.getSpawn3Timer() #defect fix
.
.
.
			if iSpawnTimerValue > 0:
				pUnitData.changeSpawnTimer(-1) 
			if iSpawn2TimerValue > 0:#defect fix
				pUnitData.changeSpawn2Timer(-1) 				
			if iSpawn3TimerValue > 0:#defect fix
				pUnitData.changeSpawn3Timer(-1)
 

Attachments

This should work with saved games from 1.03; it will set any invalid values for sentinel wait turns to 10.

In the event that the usage of this file isn't obvious, the zipped file is to replace CvAfterworldEvents.py in Beyond the Sword\Mods\Alterworld\Assets\Python\

Change from the above:
Code:
			if (iSpawnTimerValue < 0) or (iSpawnTimerValue > 10): #patch for older saved files.
				pUnitData.setSpawnTimer(10)  #patch for older saved files.
			if iSpawnTimerValue > 0:
				pUnitData.changeSpawnTimer(-1) 
			if (iSpawnTimer2Value < 0) or (iSpawnTimer2Value > 10): #patch for older saved files.
				pUnitData.setSpawn2Timer(10)  #patch for older saved files.
			if iSpawnTimer2Value > 0:#defect fix
				pUnitData.changeSpawn2Timer(-1) 				
			if (iSpawnTimer3Value < 0) or (iSpawnTimer3Value > 10): #patch for older saved files.
				pUnitData.setSpawn3Timer(10)  #patch for older saved files.
			if iSpawnTimer3Value > 0:#defect fix
				pUnitData.changeSpawn3Timer(-1)

Update: spelling errors (in the new python code) corrected.
 

Attachments

Back
Top Bottom