Vorgen said:the mod works after replacing the file, and changing the RuffMod.ini variable changes the naming style. success!
Gaurav said:Good. Can you disable it by setting [ENABLED]UnitName = 0?
notque said:Yeah, seems like this was the failure
#Fix to not interfere with Great Person naming
I don't know python, but it's similar to perl. What is the actual return for gc.getUnitInfo(unit.getUnitType()).getType()
How would one test that during the game, I know this is a question more of how to program, but it might be interesting implementing my own stuff, doesn't look too hard.
Gaurav said:Good. Can you disable it by setting [ENABLED]UnitName = 0?
Gaurav said:I found that line inside GreatPersonMod. It is supposed to return the (unlocalized) key string for the Unit Type, e.g. "UNIT_PROPHET". The fix worked well on my own machine, so I still don't think it was the reason for the issue. Anyway, the fix I copied from Teg's Unit Statistics is more widely applicable, faster, simpler, more likely to be compatible with "Great General" mods, and stops any units from being named twice to boot.
Did you try to see if you can disable the unit naming using the [ENABLED] section of RuffMod.ini? It really is hard to know if a bug is truly squashed when you could not reproduce it in the first place. I was actually trying to isolate it with that patch, not fix it. I just put up the latest version I was working on anyway.
By the way, I don't see too much similarity between Python and Perl, but I suppose they are both open source and interpreted, and every language borrows features from every other one anyway. Python's use of indenting as part of its syntax is what makes it unique.
Personally I prefer languages with explicit typing. That bug with method 3, where I had "znName" instead of "zsName", would never have happened with explicit typing, because I would have gotten an error message.
notque said:Yes, I disabled it and it worked fine. I think the similarity between them I found is that with any interpreted languages. But considering I do not have experience with anything other than perl, it just struck me as useful that they were in general very similar.
if (iOwner.isHuman() and RuffMod.get_boolean('ENABLED', 'UnitName', True)):
ziNameMthd = RuffMod.get_int('UNITNAME', 'Method', 2)
if ziNameMthd == 0:
return
elif ziNameMthd == 1:
zsName = RandomNameUtils.getRandomName()
elif ziNameMthd == 2:
zsName = RandomNameUtils.getRandomCivilizationName(civtype)
elif ziNameMthd == 3:
zsName = UnitNameRuff.getUnitNameNoCity(unit)
elif ziNameMthd == 4:
zsName = UnitNameRuff.getUnitNameNoCity(unit)
elif ziNameMthd == 5:
zsName = UnitNameRuff.getUnitBorgName()
else:
return
if (iOwner.isHuman() and RuffMod.get_boolean('ENABLED', 'UnitName', True)):
ziNameMthd = RuffMod.get_int('UNITNAME', 'Method', 2)
if ziNameMthd == 0:
return
elif ziNameMthd == 1:
zsName = RandomNameUtils.getRandomName()
elif ziNameMthd == 2:
zsName = RandomNameUtils.getRandomCivilizationName(civtype)
elif ziNameMthd == 3:
zsName = UnitNameRuff.getUnitNameNoCity(unit)
elif ziNameMthd == 4:
zsName = UnitNameRuff.getUnitNameWithCity(unit, city)
elif ziNameMthd == 5:
zsName = UnitNameRuff.getUnitBorgName()
else:
return
Vorgen said:Sorry for this late realization, but there's no difference between option 3 and option 4 in the naming mod. I looked at the code and, well, there's no difference there either. Let me direct your attention to option 3 and 4 in UnitNameEventManager.py...
starting with line 71:
PHP:if (iOwner.isHuman() and RuffMod.get_boolean('ENABLED', 'UnitName', True)): ziNameMthd = RuffMod.get_int('UNITNAME', 'Method', 2) if ziNameMthd == 0: return elif ziNameMthd == 1: zsName = RandomNameUtils.getRandomName() elif ziNameMthd == 2: zsName = RandomNameUtils.getRandomCivilizationName(civtype) elif ziNameMthd == 3: zsName = UnitNameRuff.getUnitNameNoCity(unit) elif ziNameMthd == 4: zsName = UnitNameRuff.getUnitNameNoCity(unit) elif ziNameMthd == 5: zsName = UnitNameRuff.getUnitBorgName() else: return
I changed one line to make it look like this:
PHP:if (iOwner.isHuman() and RuffMod.get_boolean('ENABLED', 'UnitName', True)): ziNameMthd = RuffMod.get_int('UNITNAME', 'Method', 2) if ziNameMthd == 0: return elif ziNameMthd == 1: zsName = RandomNameUtils.getRandomName() elif ziNameMthd == 2: zsName = RandomNameUtils.getRandomCivilizationName(civtype) elif ziNameMthd == 3: zsName = UnitNameRuff.getUnitNameNoCity(unit) elif ziNameMthd == 4: zsName = UnitNameRuff.getUnitNameWithCity(unit, city) elif ziNameMthd == 5: zsName = UnitNameRuff.getUnitBorgName() else: return
And now it works right!
Ben Music said:I'd love to try this but I get some key error from filefront link and I can't even get to the 3ddownloads site.
Gaurav said:Regarding key error at Filefront, I am getting the same error right now. I have submitted a ticket to their support department. It was working most of today, according to download numbers.
I am able to get through to 3D Downloads at this time.
I am sorry you are having such problems.
smartus said:Is there any problem with this MOD when playing multiplayer online? When somebody has the MOD and other players don't?