wilcoxchar
Warlord
- Joined
- Oct 29, 2005
- Messages
- 150
Okay, I've now gotten it to show up as tribes or peoples at the beginning for all civs. However, now it won't change to Free City of ____ or Free State of _____ once I've founded my capital.
if( owner.isAlive() and not owner.isBarbarian() ) :
self.setNewNameByCivics( owner.getID() )
Wouldn't this create problems with non default civs? It would be a serious pain if people who merge this mod (of which there are many), had to rebuild the leaderheadsinfos file.The proper way to do this would be to augment each leader XML def with Civ name fields and make these accessible through the SDK.
Wouldn't this create problems with non default civs? It would be a serious pain if people who merge this mod (of which there are many), had to rebuild the leaderheadsinfos file.
There's not a thread, just a save that was posted to the solver sticky topic. (Description; save) The base problem seems to be that CvPlayer::getName() (and related functions) default to using the non-SDK gDLL->getPlayerName() function if it's non-empty. But when a player is eliminated and a colony takes the slot, gDLL->getPlayerName() still returns the name of the now-dead original player.Yeah, I'm pretty sure it would break compatibility. Is there a thread describing the particular problem?
You could also consider writing an empty string to CvInitCore::setCivDescription, etc in CvGame::addPlayer perhaps.
const wchar* CvPlayer::getName(uint uiForm) const
{
if (isEmpty(gDLL->getPlayerName(getID(), uiForm)) || (GC.getGameINLINE().isMPOption(MPOPTION_ANONYMOUS) && isAlive() && GC.getGameINLINE().getGameState() == GAMESTATE_ON))
{
return GC.getLeaderHeadInfo(getLeaderType()).getDescription(uiForm);
}
else
{
return gDLL->getPlayerName(getID(), uiForm);
}
}
const wchar* CvPlayer::getName(uint uiForm) const
{
if ( (getParent() != NO_PLAYER) || (isEmpty(gDLL->getPlayerName(getID(), uiForm)) || (GC.getGameINLINE().isMPOption(MPOPTION_ANONYMOUS) && isAlive() && GC.getGameINLINE().getGameState() == GAMESTATE_ON)))
{
return GC.getLeaderHeadInfo(getLeaderType()).getDescription(uiForm);
}
else
{
return gDLL->getPlayerName(getID(), uiForm);
}
}
LeaderHeadTypes eOldLeader = GET_PLAYER(eNewPlayer).getLeaderType();
CivilizationTypes eOldCiv = GET_PLAYER(eNewPlayer).getCivilizationType();
CvWString szEmptyString = "";
if ( ((eOldLeader != NO_LEADER) && (eOldLeader != eLeader)) || ((eOldCiv != NO_CIVILIZATION) && (eOldCiv != eCiv)) )
{
GC.getInitCore().setLeaderName(eNewPlayer, szEmptyString);
GC.getInitCore().setCivAdjective(eNewPlayer, szEmptyString);
GC.getInitCore().setCivDescription(eNewPlayer, szEmptyString);
GC.getInitCore().setCivShortDesc(eNewPlayer, szEmptyString);
}
CvWString szEmptyString = "";
LeaderHeadTypes eOldLeader = GET_PLAYER(eNewPlayer).getLeaderType();
if ( (eOldLeader != NO_LEADER) && (eOldLeader != eLeader) )
{
GC.getInitCore().setLeaderName(eNewPlayer, szEmptyString);
}
CivilizationTypes eOldCiv = GET_PLAYER(eNewPlayer).getCivilizationType();
if ( (eOldCiv != NO_CIVILIZATION) && (eOldCiv != eCiv) )
{
GC.getInitCore().setCivAdjective(eNewPlayer, szEmptyString);
GC.getInitCore().setCivDescription(eNewPlayer, szEmptyString);
GC.getInitCore().setCivShortDesc(eNewPlayer, szEmptyString);
}