Multiple Border Obstacles, Great Wall Plus...

LPlate2

Warlord
Joined
Dec 27, 2018
Messages
299
Hi,

I'm looking to add in another wonder (Wall of Thorns) that creates a graphic around a civ's borders like the the Great Wall. However, I also want to use the Great Wall graphic within the same mod.

The great wall graphic is generated when bBorderObstacle is set to 1.
In CvCity.cpp, the following code is triggered by this;
Spoiler :
Code:
       //great wall
       if (bFirst)
       {
           if (GC.getBuildingInfo(eIndex).isAreaBorderObstacle())
           {
               int iCountExisting = 0;
               for (iI = 0; iI < GC.getNumBuildingInfos(); iI++)
               {
                   if (eIndex != iI && GC.getBuildingInfo((BuildingTypes)iI).isAreaBorderObstacle())
                   {
                       iCountExisting += getNumRealBuilding((BuildingTypes)iI);
                   }
               }

               if (iCountExisting == 1 && iNewValue == 0)
               {
                   gDLL->getEngineIFace()->RemoveGreatWall(this);
               }
               else if (iCountExisting == 0 && iNewValue > 0)
               {
                   gDLL->getEngineIFace()->AddGreatWall(this);
               }
           }
       }

In FFH, when the Sanctuary spell is cast, it similarly creates the great wall around a civ. The trigger for this appears to be in CvPlayer but also uses this gDLL->getEngineIFace().
Spoiler :
Code:
void CvPlayer::changeSanctuaryTimer(int iChange)
{
    if (iChange > 0)
    {
        gDLL->getEngineIFace()->AddGreatWall(getCapitalCity());
    }
   if (iChange != 0)
   {
       m_iSanctuaryTimer += iChange;
   }
   if (m_iSanctuaryTimer == 0)
   {
        gDLL->getEngineIFace()->RemoveGreatWall(getCapitalCity());
   }
}

Does anyone know where I'll find the files referred to in the lines;
gDLL->getEngineIFace()->AddGreatWall(this); and
gDLL->getEngineIFace()->RemoveGreatWall(this);?

I'll want to edit them so that they can use different graphics depending on the wonder that has been constructed or else duplicate similar functions for each additional "border" wonder.
 
Hello LPlate2,

unfortunately this functions are not part of the Civ4 DLL, but the executable itself. I assume the reason for this is the strong interleaving of the Great Wall functions with the graphic engine. (You cannot create the Great Wall if the graphic engine is not initialized.)

So it is difficult to change/expand the wall feature.
 
Thanks for the information.
I’ll focus my modding efforts elsewhere.
 
Top Bottom