Afforess
The White Wizard
I'm merging the Mercenaries Modcomp with BUG 4.3. I've gotten pretty far, and everything works, as long as units don't have any characters in their names that is not in the English alphabet. Hyphens, parenthesis, and numbers cause issues.
Specifically, the non-standard characters cause the Mercenary Manager screen to not correctly recognize input data. Clicking on buttons has no effect.
Take this button for example.
I've put debugging statements in here, and the code stops executing at the red line, and never moves past it. However, if I change the name of the unit to something without numbers, etc... and click again, the code executes past the red line.
Why do numbers and parenthesis cause issues?
Specifically, the non-standard characters cause the Mercenary Manager screen to not correctly recognize input data. Clicking on buttons has no effect.
Take this button for example.
Code:
def handleInput (self, inputClass):
...
if(function == "UnitInfoButton"):
# Get the player ID
iPlayer = gc.getGame().getActivePlayer()
# Get the actual player reference
player = gc.getPlayer(iPlayer)
# Split up the mercenary name into the actual mercenary name
# and the unit ID string
[COLOR="Red"]mercenaryName, id = mercenaryName.split("-")[/COLOR]
# Convert the unit ID string back into a number
id = self.alphaToNumber(id)
# Get the mercenary
mercenary = objMercenaryUtils.getMercenary(mercenaryName)
# If we didn't get a mercenary from the mercenary pool then
# it is safe to assume that the unit has never been a
# mercenary.
if(mercenary == None):
# Create a blank mercenary
mercenary = objMercenaryUtils.createBlankMercenary()
# Populate the mercenary object with the data from
# the unit that we want to look at
mercenary.loadUnitData(player.getUnit(id))
mercenary.setName(mercenaryName)
# Calculate the screen information
self.calculateScreenWidgetData(screen)
# Populate the unit information panel with the mercenary/unit
# information.
self.populateUnitInformation(screen,mercenary)
...
I've put debugging statements in here, and the code stops executing at the red line, and never moves past it. However, if I change the name of the unit to something without numbers, etc... and click again, the code executes past the red line.
Why do numbers and parenthesis cause issues?