Operands in leader name affect Glance screen display

OTAKUjbski

TK421
Joined
Mar 4, 2007
Messages
1,511
Location
not at my post
This bug is purely cosmetic. It doesn't appear to affect the gameplay at all.

It is only present in BtS 3.13 if using any of the various unofficial mods or patches which re-enables the Glance screen. In < 3.13, this bug is present.

--------

If an addition or subtraction operand ("+" or "-") is part of the Leader name, it will be applied to the values in the Glance screen for the AI civs' attitude towards the player.

(NOTE: "/" is an invalid Leader Name character. "*" does not appear to have any affect.)

For example:

If the Leader Name is "asdf1234":

attachment.php


If the Leader Name is "asdf-1234":

attachment.php


If the Leader Name is "asdf+1234":

attachment.php
 
That is hilarious. :D
 
I think ( based on the screens ) that the glance assumes the part of the name after the + or the - is a diplo modifier ( 5 - 1234 = - 1229 and 5 + 1234 = 1239 ). Funny but , thank god ,is just a interface issue ( imagine that you could add diplo by the name :devil: )
 
Yeah, the problem here is with the Attitude functions, or more specifically, the fact that the numerical ones aren't exposed to Python. So the only way for a Python function to grab the numerical attitude value is to get the full attitude string (the whole "+1 We value blah, blah", etc), take all the +/- values, and add them up. But part of that attitude string is the player's name, so of course if it contains any +/- symbols followed by numbers, it'll parse those out and assume they are part of the calculation.

The simplest fix to this is to expose the actual numerical attitude function to Python, call that directly, and skip that annoying parsing.

Bh
 
The full attitude string should also contain newlines I think, it could also not start counting until after the first new line to work around this.

Edit:
I've fixed this for my mod by removing references to leader names before parsing. In the calculateRelations function, add:

Code:
szAttitude = szAttitude.replace(gc.getPlayer(nPlayer).getName(),"")
szAttitude = szAttitude.replace(gc.getPlayer(nTarget).getName(),"")

Pretty funny bug though.
 
Back
Top Bottom