Implementing Petra wonder

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
61
So I almost just got it working, but when clicking on the icon to build it the game suddenly crashes.
So I almost just got it working, but when clicking on the icon to build it the game suddenly crashes.

first; the pythonDbg.log says this:

Code:
14:24:35 DEBUG: updatePlotListButtons_Orig - column 0, offset 315
14:24:35 DEBUG: BugOptions - writing INI file 'Autolog.ini'
load_module encodings.ascii

14:24:35 DEBUG: updatePlotListButtons_Orig - column 0, offset 315
14:24:35 DEBUG: updatePlotListButtons_Orig - iCount(315), iSkipped(0)
14:24:35 DEBUG: Timer - scores took 3 ms
14:24:35 DEBUG: MapSigns.processSigns() starting. bShow = False and g_bShowSigns = False
14:24:35 DEBUG: EventSigns.updateCurrentSigns() finished.
 MapSigns { plotDict = { } }
14:24:36 DEBUG: Timer - scores took 3 ms
14:24:37 DEBUG: updatePlotListButtons_Orig - column 0, offset 315
14:24:37 DEBUG: updatePlotListButtons_Orig - iCount(315), iSkipped(0)
14:24:39 DEBUG: updatePlotListButtons_Orig - column 0, offset 315
14:24:39 DEBUG: updatePlotListButtons_Orig - iCount(315), iSkipped(0)

So now onto the XML stuff (indention is correct but shows a bit different in posting here):

CIV4BuildingInfos.xml:

Code:
<BuildingInfo>
            <BuildingClass>BUILDINGCLASS_PETRA_MONASTERY</BuildingClass>
            <Type>BUILDING_PETRA</Type>
            <SpecialBuildingType>NONE</SpecialBuildingType>
            <Description>TXT_KEY_BUILDING_PETRA</Description>
            <Civilopedia>TXT_KEY_BUILDING_PETRA_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_BUILDING_PETRA_STRATEGY</Strategy>
            <Advisor>ADVISOR_ECONOMY</Advisor>
            <ArtDefineTag>ART_DEF_BUILDING_PETRA</ArtDefineTag>
            <MovieDefineTag>NONE</MovieDefineTag>
            <HolyCity>NONE</HolyCity>
            <ReligionType>NONE</ReligionType>
            <StateReligion>NONE</StateReligion>
            <bStateReligion>0</bStateReligion>
            <PrereqReligion>NONE</PrereqReligion>
            <PrereqCorporation>NONE</PrereqCorporation>
            <FoundsCorporation>NONE</FoundsCorporation>
            <GlobalReligionCommerce>NONE</GlobalReligionCommerce>
            <GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
            <VictoryPrereq>NONE</VictoryPrereq>
            <FreeStartEra>NONE</FreeStartEra>
            <MaxStartEra>ERA_CLASSICAL</MaxStartEra>
            <ObsoleteTech>TECH_THEOLOGY</ObsoleteTech>
            <PrereqTech>TECH_MASONRY</PrereqTech>
            <TechTypes/>
            <Bonus>NONE</Bonus>
            <PrereqBonuses/>
            <ProductionTraits/>
            <HappinessTraits/>
            <NoBonus>NONE</NoBonus>
            <PowerBonus>NONE</PowerBonus>
            <FreeBonus>NONE</FreeBonus>
            <iNumFreeBonuses>0</iNumFreeBonuses>
            <FreeBuilding>NONE</FreeBuilding>
            <FreePromotion>NONE</FreePromotion>
            <CivicOption>NONE</CivicOption>
            <GreatPeopleUnitClass>UNITCLASS_PROPHET</GreatPeopleUnitClass>
            <iGreatPeopleRateChange>1</iGreatPeopleRateChange>
            <iHurryAngerModifier>0</iHurryAngerModifier>
            <bBorderObstacle>0</bBorderObstacle>
            <bTeamShare>1</bTeamShare>
            <bWater>0</bWater>
            <bRiver>0</bRiver>
            <bPower>0</bPower>
            <bDirtyPower>0</bDirtyPower>
            <bAreaCleanPower>0</bAreaCleanPower>
            <DiploVoteType>NONE</DiploVoteType>
            <bForceTeamVoteEligible>0</bForceTeamVoteEligible>
            <bCapital>0</bCapital>
            <bGovernmentCenter>0</bGovernmentCenter>
            <bGoldenAge>0</bGoldenAge>
            <bAllowsNukes>0</bAllowsNukes>
            <bMapCentering>0</bMapCentering>
            <bNoUnhappiness>0</bNoUnhappiness>
            <bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
            <bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
            <bNeverCapture>0</bNeverCapture>
            <bNukeImmune>1</bNukeImmune>
            <bPrereqReligion>0</bPrereqReligion>
            <bCenterInCity>0</bCenterInCity>
            <iAIWeight>0</iAIWeight>
            <iCost>300</iCost>
            <iHurryCostModifier>100</iHurryCostModifier>
            <iAdvancedStartCost>-1</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iMinAreaSize>-1</iMinAreaSize>
            <iConquestProb>100</iConquestProb>
            <iCitiesPrereq>0</iCitiesPrereq>
            <iTeamsPrereq>0</iTeamsPrereq>
            <iLevelPrereq>0</iLevelPrereq>
            <iMinLatitude>0</iMinLatitude>
            <iMaxLatitude>90</iMaxLatitude>
            <iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
            <iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
            <iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
            <iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
            <iAnarchyModifier>0</iAnarchyModifier>
            <iGoldenAgeModifier>0</iGoldenAgeModifier>
            <iGlobalHurryModifier>0</iGlobalHurryModifier>
            <iExperience>0</iExperience>
            <iGlobalExperience>0</iGlobalExperience>
            <iFoodKept>0</iFoodKept>
            <iAirlift>0</iAirlift>
            <iAirModifier>0</iAirModifier>
            <iAirUnitCapacity>0</iAirUnitCapacity>
            <iNukeModifier>0</iNukeModifier>
            <iNukeExplosionRand>0</iNukeExplosionRand>
            <iFreeSpecialist>0</iFreeSpecialist>
            <iAreaFreeSpecialist>0</iAreaFreeSpecialist>
            <iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
            <iMaintenanceModifier>0</iMaintenanceModifier>
            <iWarWearinessModifier>0</iWarWearinessModifier>
            <iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
            <iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
            <iHealRateChange>0</iHealRateChange>
            <iHealth>0</iHealth>
            <iAreaHealth>0</iAreaHealth>
            <iGlobalHealth>0</iGlobalHealth>
            <iHappiness>0</iHappiness>
            <iAreaHappiness>0</iAreaHappiness>
            <iGlobalHappiness>0</iGlobalHappiness>
            <iStateReligionHappiness>0</iStateReligionHappiness>
            <iWorkerSpeedModifier>0</iWorkerSpeedModifier>
            <iMilitaryProductionModifier>0</iMilitaryProductionModifier>
            <iSpaceProductionModifier>0</iSpaceProductionModifier>
            <iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
            <iTradeRoutes>0</iTradeRoutes>
            <iCoastalTradeRoutes>0</iCoastalTradeRoutes>
            <iGlobalTradeRoutes>0</iGlobalTradeRoutes>
            <iTradeRouteModifier>0</iTradeRouteModifier>
            <iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
            <iGlobalPopulationChange>0</iGlobalPopulationChange>
            <iFreeTechs>0</iFreeTechs>
            <iDefense>50</iDefense>
            <iBombardDefense>0</iBombardDefense>
            <iAllCityDefense>0</iAllCityDefense>
            <iEspionageDefense>0</iEspionageDefense>
            <iAsset>12</iAsset>
            <iPower>0</iPower>
            <fVisibilityPriority>100.0</fVisibilityPriority>
            <SeaPlotYieldChanges/>
            <RiverPlotYieldChanges/>
            <GlobalSeaPlotYieldChanges/>
            <YieldChanges/>
            <CommerceChanges/>
            <ObsoleteSafeCommerceChanges>
                <iCommerce>2</iCommerce>
                <iCommerce>0</iCommerce>
                <iCommerce>2</iCommerce>
            </ObsoleteSafeCommerceChanges>
            <CommerceChangeDoubleTimes>
                <iCommerce>0</iCommerce>
                <iCommerce>0</iCommerce>
                <iCommerce>1000</iCommerce>
            </CommerceChangeDoubleTimes>
            <CommerceModifiers/>
            <GlobalCommerceModifiers/>
            <SpecialistExtraCommerces/>
            <StateReligionCommerces/>
            <CommerceHappinesses/>
            <ReligionChanges/>
            <SpecialistCounts/>
            <FreeSpecialistCounts/>
            <CommerceFlexibles/>
            <CommerceChangeOriginalOwners>
                <bCommerceChangeOriginalOwner>0</bCommerceChangeOriginalOwner>
                <bCommerceChangeOriginalOwner>0</bCommerceChangeOriginalOwner>
                <bCommerceChangeOriginalOwner>1</bCommerceChangeOriginalOwner>
            </CommerceChangeOriginalOwners>
            <ConstructSound>AS2D_BUILD_PYRAMID</ConstructSound>
            <BonusHealthChanges/>
            <BonusHappinessChanges/>
            <BonusProductionModifiers/>
            <UnitCombatFreeExperiences/>
            <DomainFreeExperiences/>
            <DomainProductionModifiers/>
            <BuildingHappinessChanges/>
            <PrereqBuildingClasses/>
            <BuildingClassNeededs/>
            <SpecialistYieldChanges/>
            <BonusYieldModifiers/>
            <ImprovementFreeSpecialists/>
            <Flavors/>
            <HotKey/>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <iHotKeyPriority>0</iHotKeyPriority>
        </BuildingInfo>

CIV4BuildingClassInfos.xml

Code:
 <BuildingClassInfo>
            <Type>BUILDINGCLASS_PETRA_MONASTERY</Type>
            <Description>TXT_KEY_BUILDING_PETRA</Description>
            <iMaxGlobalInstances>1</iMaxGlobalInstances>
            <iMaxTeamInstances>-1</iMaxTeamInstances>
            <iMaxPlayerInstances>-1</iMaxPlayerInstances>
            <iExtraPlayerInstances>0</iExtraPlayerInstances>
            <bNoLimit>0</bNoLimit>
            <bMonument>0</bMonument>
            <DefaultBuilding>BUILDING_PETRA</DefaultBuilding>
            <VictoryThresholds/>
        </BuildingClassInfo>

CIV4GameTextInfos_Objects.xml:

Code:
<TEXT>
        <Tag>TXT_KEY_BUILDING_PETRA</Tag>
        <English>Petra</English>
        <French>
            <Text>Petra</Text>
            <Gender>Female</Gender>
            <Plural>1</Plural>
        </French>
        <German>
            <Text>Die Petra</Text>
            <Gender>Male</Gender>
            <Plural>0</Plural>
        </German>
        <Italian>
            <Text>Le Petra</Text>
            <Gender>Female</Gender>
            <Plural>1</Plural>
        </Italian>
        <Spanish>
            <Text>las Pir&#225;mides:las Pir&#225;mides</Text>
            <Gender>Female</Gender>
            <Plural>1:1</Plural>
        </Spanish>
    </TEXT>

CIV4ArtDefines_Building.xml:

Code:
<BuildingArtInfo>
            <Type>ART_DEF_BUILDING_PETRA</Type>
            <LSystem>LSYSTEM_3x3</LSystem>
            <bAnimated>0</bAnimated>
            <fScale>1.43</fScale>
            <fInterfaceScale>0.67</fInterfaceScale>
            <NIF>Art/Structures/Buildings/petra/Petra03.nif</NIF>
            <KFM/>
            <Button>Art/Structures/Buildings/petra/petra.dds</Button>
        </BuildingArtInfo>

CIV4GameText_Strategy.xml (other languages still use pyramids):

Code:
<TEXT>
        <Tag>TXT_KEY_BUILDING_PETRA_STRATEGY</Tag>
        <English>Petra allows you to change your capital while also providing a defense and culture buff, good for making a forward city of your empire.</English>
        <French>Les [COLOR_BUILDING_TEXT]Pyramides[COLOR_REVERT] permettent d'acc&#233;der &#224; toutes les formes de [COLOR_HIGHLIGHT_TEXT]doctrines[COLOR_REVERT] (vous disposez ainsi d'un choix d'options plus vaste assez t&#244;t dans le jeu). Elles augmentent aussi les chances d'apparition d'un [COLOR_UNIT_TEXT]ing&#233;nieur illustre[COLOR_REVERT].</French>
        <German>Die [COLOR_BUILDING_TEXT]Pyramiden[COLOR_REVERT] erm&#246;glichen Ihnen den Zugriff auf alle [COLOR_HIGHLIGHT_TEXT]Regierungs[COLOR_REVERT]-Staatsformen. Dadurch stehen Ihnen deutlich mehr Verwaltungsoptionen zur Verf&#252;gung. Dar&#252;ber hinaus erh&#246;hen sich die Chancen der Stadt, einen [COLOR_UNIT_TEXT]Gro&#223;en Ingenieur[COLOR_REVERT] hervorzubringen.</German>
        <Italian>Le [COLOR_BUILDING_TEXT]Piramidi[COLOR_REVERT] concedono l'accesso a tutte le forme di [COLOR_HIGHLIGHT_TEXT]Governo[COLOR_REVERT] (aumentando notevolmente le possibilit&#224; iniziali di gestione). Inoltre, aumentano la probabilit&#224; di generare un [COLOR_UNIT_TEXT]Grande Ingegnere[COLOR_REVERT].</Italian>
        <Spanish>Las [COLOR_BUILDING_TEXT]Pir&#225;mides[COLOR_REVERT] activan el acceso a todos los principios de [COLOR_HIGHLIGHT_TEXT]Gobierno[COLOR_REVERT] (lo que aumenta much&#237;simo las primeras opciones de gesti&#243;n). Tambi&#233;n aumentan las posibilidades de que en su ciudad se genere un [COLOR_UNIT_TEXT]Gran ingeniero[COLOR_REVERT].</Spanish>
    </TEXT>

CIV4GameText_Civilopedia_BuildingsProjects.xml:

Code:
<TEXT>


        <Tag>TXT_KEY_BUILDING_PETRA_PEDIA</Tag>
        <English>[TAB]Located amid rugged desert canyons and mountains, Petra was once a thriving trading center and the capital of the Nabataean empire between 400 B.C. and A.D. 106. The city sat empty and in near ruin for centuries. Only in the early 1800s did a European traveler disguise himself in Bedouin costume and infiltrate the mysterious locale.</English>
        <French>[TAB]Erig&#233;es par la quatri&#232;me dynastie de dirigeants &#233;gyptiens, les pyramides constituent l'apog&#233;e des r&#233;alisations culturelles de l'Egypte antique. Construits sur le plateau de Gizeh dans la banlieue de la ville actuelle du Caire, ces &#233;difices constituaient des tombeaux fun&#233;raires et des monuments pour les pharaons et ont sans doute n&#233;cessit&#233; des g&#233;n&#233;rations et des dizaines de milliers d'ouvriers pour &#234;tre achev&#233;s. De toutes les constructions de l'homme g&#233;n&#233;ralement consid&#233;r&#233;es comme des merveilles de l'Antiquit&#233;, les pyramides sont les seules &#224; avoir subsist&#233; jusqu'&#224; nos jours.</French>
        <German>[TAB]Die Pyramiden wurden von der vierten Dynastie der &#228;gyptischen Herrscher erbaut und repr&#228;sentieren den H&#246;hepunkt der &#228;gyptischen Kultur des Altertums. Die Bauwerke, die auf dem Gizeh-Plateau au&#223;erhalb des heutigen Kairo errichtet wurden, dienten als Grabst&#228;tten f&#252;r die Pharaonen. Die Bauzeit der Pyramiden bis zu ihrer Vollendung k&#246;nnte Generationen &#252;berdauert haben - vermutlich haben Tausende von Arbeitern daran mitgewirkt. Die &#228;gyptischen Pyramiden sind die einzigen allgemein anerkannten Weltwunder der Antike, die von Menschenhand erbaut wurden und noch heute existieren.</German>
        <Italian>[TAB]Costruite dalla Quarta Dinastia di Faraoni, le piramidi rappresentano l'apice delle conquiste culturali dell'antico popolo Egizio. Costruite sull'altopiano di Giza, all'esterno dell'attuale Il Cairo, queste strutture erano tombe di sepoltura e monumenti per i Faraoni, e ci sono volute generazioni e migliaia di lavoratori per completare il progetto. Le piramidi sono universalmente riconosciute come una delle meraviglie del mondo antico che ancora oggi possiamo ammirare.</Italian>
        <Spanish>[TAB]La IV dinast&#237;a de faraones egipcios mand&#243; erigir las pir&#225;mides, que representan la cumbre cultural de esa antigua civilizaci&#243;n. Estas estructuras, construidas en la meseta de Gizeh (en las afueras de lo que hoy es El Cairo), eran tumbas monumentales para sus faraones y puede que su construcci&#243;n requiriese generaciones y decenas de miles de trabajadores. Son la &#250;nica maravilla, de las que son generalmente aceptadas como maravillas construidas por el hombre en la antig&#252;edad, que sigue en pie en la actualidad.</Spanish>
    </TEXT>

assets from here: https://forums.civfanatics.com/threads/civil-wonders-prague-castle-burj-al-arab-etc.185303/

I am using the neoteric world mod.

The civilopedia shows correctly. The button appears not perfect. The crash happens when trying to build petra. I cannot find out what I am missing? Does anyone know what could be wrong?
 
I did some testing and it still won't work if I replace the dds and NIF with the existing levee ones. So I don't think it is the nif or dds that is causing the problem, but I cannot find out what is wrong so I am not taking it off the table completely.
 
What about the button? Is it exactly 64X64 size? If not, than your game will crash when you (or the AI) tries to build it.
The asset is from that link. I thought it might be that but I tested it by using the button for the levee building, but it still crashed.

EDIT: Okay so I replaced the dds with yet another one that is 64x64 and it worked!
Why is the resources posted in the mods section 256x256 all the time? Is there some process for converting them to 64x64? Can you tell me how to change a dds size?
 
Last edited:
I just tried gimp but for some reason it does not work even though the size is 64x64. is there anything special I need to know about the export options? such as the mipmaps (whatever that is lol)

EDIT: Got it working! so it had to be compressed to BC3/DXT5. It is all working perfectly now. Now i have to convert an image into a bik to have wonder "movies" as a static image
 
Last edited:
Make sure both canvas and picture sizes are the same.
I never care about mipmaps.
Yeah I did that. I'm going to find better pictures for the buttons. I'll also go learn how to make a bik for them over the next week. Thank you for the help.
 
Sure thing. Just want to let you know, that already there are a lot of wonder movies. I myself had created a lot too (see my signature).
You can find even more in Chronicles of Mankind.
 
I see there are a ton of wonders and movies in a giga pack, unfortunately there isn't much overlap between them. I'll have to learn how to turn jpg to bik (and resize as well)
 
It's super easy to do:

Crop/resize your .jpg. InfranView can do that for example:
upload_2021-6-10_22-29-24.png


Than you can use RAD Video Tools to convert things to .bik. Just Bink it! :)
upload_2021-6-10_22-31-53.png


And that's all.
Have fun! :)
 
It's super easy to do:

Crop/resize your .jpg. InfranView can do that for example:
View attachment 599276

Than you can use RAD Video Tools to convert things to .bik. Just Bink it! :)
View attachment 599277

And that's all.
Have fun! :)
I tried doing that stuff an failed for some reason. I think I was too lame-brain tired. I'll give it another go since it is so simple and straight forward I should actually be able to do it with no problem, especially since I have those tools already. Making models for wonders is out of the question though lol, I don't have the passion to dedicate enough time to learn how to do that.
 
Making models for wonders is out of the question though lol, I don't have the passion to dedicate enough time to learn how to do that.
You better check the database and other mods rather.
 
If you are having problems with GIMP why not try Paint.Net? It's much, much easier to use an does the job of DDS editing just as well.
 
Top Bottom