OK, so at first it didn't work. So I investigated, following the code path:
Which means that if no city has been founded, the pop-up will never appear (as isReserach will always be false).Spoiler :Which basically means that at least one tech has to answer true to the canResearch function, whose code is below:Code:bool CvDLLButtonPopup::launchChooseTechPopup(CvPopup* pPopup, CvPopupInfo &info) { CyArgsList argsList; argsList.add(GC.getGameINLINE().getActivePlayer()); long lResult=0; ... int iNumTechs = 0; for (int iPass = 0; iPass < 2; iPass++) { for (int iI = 0; iI < GC.getNumTechInfos(); iI++) { if (((iI == eBestTech) || (iI == eNextBestTech)) == (iPass == 0)) { if ([COLOR=Red][B]player.canResearch((TechTypes)iI)[/B][/COLOR]): { ... iNumTechs++; } } } } if (0 == iNumTechs) { // player cannot research anything, so don't show this popup after all [COLOR=Red][B]return (false)[/B][/COLOR]; } gDLL->getInterfaceIFace()->popupSetPopupType(pPopup, POPUPEVENT_TECHNOLOGY, ARTFILEMGR.getInterfaceArtInfo("INTERFACE_POPUPBUTTON_TECH")->getPath()); gDLL->getInterfaceIFace()->popupLaunch(pPopup, false, ((iDiscover > 0) ? POPUPSTATE_QUEUED : POPUPSTATE_MINIMIZED)); return (true); }
Which mean that isResearch function has to answer true if there not advanced point left, whose code is below:Code:bool CvPlayer::canResearch(TechTypes eTech, bool bTrade) const { bool bFoundPossible; bool bFoundValid; int iI; if(GC.getUSE_CAN_RESEARCH_CALLBACK()) { CyArgsList argsList; argsList.add(getID()); argsList.add(eTech); argsList.add(bTrade); long lResult=0; gDLL->getPythonIFace()->callFunction(PYGameModule, "canResearch", argsList.makeFunctionArgs(), &lResult); if (lResult == 1) { return true; } } if (![COLOR=DarkOrange][B]isResearch()[/B][/COLOR] && getAdvancedStartPoints() < 0) { return false; } if (GET_TEAM(getTeam()).isHasTech(eTech)) { return false; } ... return true; }
Code:bool CvPlayer::isResearch() const { if(GC.getUSE_IS_PLAYER_RESEARCH_CALLBACK()) { CyArgsList argsList; long lResult; argsList.add(getID()); lResult = 1; gDLL->getPythonIFace()->callFunction(PYGameModule, "isPlayerResearch", argsList.makeFunctionArgs(), &lResult); if (lResult == 0) { return false; } } [COLOR=Red][B] if (!isFoundedFirstCity()) { return false; } [/B][/COLOR] return true; }
Could this check about city creation be removed ?
I tried to go around using activating the canResearch callback in python, which then worked, but the performance become catastrophic if I have to reproduce the filter of which tech to appear from C to python.
Moreover I don't see why you could not choose your tech before founding a city (with in the case of the new version of Tears for RifE will always happen, as no city will ever be founded)
Thank you in advance for considering this small change![]()
bool CvDLLButtonPopup::launchChooseTechPopup(CvPopup* pPopup, CvPopupInfo &info)
{
CyArgsList argsList;
argsList.add(GC.getGameINLINE().getActivePlayer());
long lResult=0;
...
int iNumTechs = 0;
for (int iPass = 0; iPass < 2; iPass++)
{
for (int iI = 0; iI < GC.getNumTechInfos(); iI++)
{
if (((iI == eBestTech) || (iI == eNextBestTech)) == (iPass == 0))
{
if ([COLOR=Red][B]player.canResearch((TechTypes)iI)[/B][/COLOR])
{
...
iNumTechs++;
}
[COLOR=Blue][B] if(player.isMonstrous())
{
iNumTechs++;
}[/B][/COLOR]
}
}
}
if (0 == iNumTechs)
{
// player cannot research anything, so don't show this popup after all
[COLOR=Red][B]return (false)[/B][/COLOR];
}
gDLL->getInterfaceIFace()->popupSetPopupType(pPopup, POPUPEVENT_TECHNOLOGY, ARTFILEMGR.getInterfaceArtInfo("INTERFACE_POPUPBUTTON_TECH")->getPath());
gDLL->getInterfaceIFace()->popupLaunch(pPopup, false, ((iDiscover > 0) ? POPUPSTATE_QUEUED : POPUPSTATE_MINIMIZED));
return (true);
}
bool CvPlayer::isResearch() const
{
if(GC.getUSE_IS_PLAYER_RESEARCH_CALLBACK())
{
CyArgsList argsList;
long lResult;
argsList.add(getID());
lResult = 1;
gDLL->getPythonIFace()->callFunction(PYGameModule, "isPlayerResearch", argsList.makeFunctionArgs(), &lResult);
if (lResult == 0)
{
return false;
}
}
if (!isFoundedFirstCity()[COLOR="Blue"][B] && !isMonstrous()[/B][/COLOR])
{
return false;
}
return true;
}
I've had goblins who defeat wolves become wolf riders and it got me thinking. I haven't had a game last long enough to attack a dire hamster with a Ranger, but I'd sure love to see such an encounter produce a certain hero with a propensity for "butt-kicking for goodness." I'm not sure how much borrowing you guys can get away with (I seem to recognize some of the portraits from contemporary games and I'm pretty sure One of the leaders in RifE has background music from FF4).
I read (possibly in this thread but I can't find it now) some complaints about the 'random' number generator in Civ and some less than random chains of bad results. I suggest a game option to set aside all fairly unlikely outcomes (any time one of two options has less than a 20% likelihood of occuring, whether its forest expansion, combat, resource discovery, or whatever is annoying people) and instead add those to a global counter. Whenever the counter passes 1. you're fairly unlikely event happens and the remainder rolls over for the next such event. This probably should include events that are very likely (80% or more), too, since the other half of the event is fairly unlikely.
20% is just a filler value here. The 15% wake-up chance for the Nilhorn giants is the sort of thing I'd want to include. Anyway, it's just a thought.
Minsc and Boo from Baldur's Gate. I'm sure a couple of the leaders (Auric Ulvan and the green orcish fellow in the Clan of Embers certainly) are images from Icewind Dale. Sorry, I just got nostalgic when I saw that hamster.
Crazed, maybe?For the record giving a ranger a special promo if they capture a dire hamster would be epic
Do you know what's involved with making that kind of a change?![]()
Psst he was being sarcastic when he said he didn't get the reference. Look at the Special ability of the Hamster. +1000% vs Floating eyes (you can't attack the eyes or if you do it serves no purpose they are not combat units)
For the record giving a ranger a special promo if they capture a dire hamster would be epic
Hey there, finally got this working properly. Wonderful modmod!
Just an idea, perhaps Fort Commanders should start with the 'loyalty' promotion? It's a little odd to capture one and end up with an imobile unit standing next to the fort...