World Builder in Hotseat

Barrenlands

Chieftain
Joined
Jan 28, 2017
Messages
13
Hi,

how can i make the world builder available in hotseat games in civ4 beyond the sword? I ve tried by deleting the control world builder section in gameinterface.cpp but it didnt work. It must be possible somehow..
Thanks
Barrenlands
 
I ve tried by deleting the control world builder section in gameinterface.cpp but it didnt work.
This is a modding topic then. First up, just to make sure that you're aware, changes to the CvGameCoreDLL source code only take effect if the DLL is recompiled. Then, I assume that you've edited CvGame::canDoControl. That's good, but CvGame::doControl will still fail. Apparently, the setWorldBuilder function in the EXE checks getChtLvl, also in the EXE, before entering the WB. The setChtLvl function can be called from the DLL via gDLL->setChtLvl(1) – but that function has no effect in multiplayer games (as far as I can tell). In my own mod, I've worked around this by letting CvGame::isGameMultiPlayer in the DLL pretend, for a moment, that the game is not a multiplayer game:
Spoiler :
Code:
bool CvGame::isGameMultiPlayer() const // CvGame.cpp
{
   if (m_bFeignSP)
       return false;
   return (isNetworkMultiPlayer() || isPbem() || isHotSeat());
}
// CvGame.h (within the class definition):
bool m_bFeignSP;
// CvGameInterface.cpp (in addition to changing/ disabling the canDoControl check):
void CvGame::doControl(ControlTypes eControl)
{
   // ...
   case CONTROL_WORLD_BUILDER:
      if (GC.getInitCore().getAdminPassword().empty())
      {
         m_bFeignSP = true;
         gDLL->setChtLvl(1);
         gDLL->getInterfaceIFace()->setWorldBuilder(!gDLL->GetWorldBuilderMode());
         m_bFeignSP = false;
      }
      else
      // ...
}
 
Thank you for your reply. I think i dont have the skills to make such a change. But thanks anyway :)
 
Back
Top Bottom