Changing National Wonder Building

Sebitudoreci

Chieftain
Joined
Jul 21, 2016
Messages
18
Location
Romania
Hello, I'd like to know if there is a way to change the prereq buildings for a national wonder, and if so, how could I do that with an xml script.

I'd like to change the prereq building for National Intelligence Agency to constable instead of police station, but a simple <Update> didn't do the job for me. Any thoughts?
 
Any thoughts?

Update will work (if used correctly - one of my mods does this).

Have you enabled logging and checked for errors? (See the first link in my sig). If no obvious errors, attach the actual mod (as that way we don't have to guess what you've done), see the second link in my sig
 
Have you enabled logging and checked for errors? (See the first link in my sig). If no obvious errors, attach the actual mod (as that way we don't have to guess what you've done), see the second link in my sig

After reading your reply, I went in game to test again, I used this code for the intelligence agency, and got no result.
<Update>
<Where Type="BUILDING_INTELLIGENCE_AGENCY"/>
<Set Building_ClassesNeededInCity="BUILDINGCLASS_CONSTABLE" Building_PrereqBuildingClasses="BUILDINGCLASS_CONSTABLE" NumBuildingNeeded="-1"/>
</Update>

Also to note, in the same xml, i have
<Update>
<Where Type="BUILDING_HERMITAGE"/>
<Set PrereqTech="TECH_ACOUSTICS"/>
</Update>
<Update>
<Where Type="BUILDING_BROADCAST_TOWER"/>
<Set PrereqTech="TECH_REPLACEABLE_PARTS"/>
</Update>
and hermitage works as intended, while broadcast tower doesn't.

Could you please tell me what was the name of the mod you used <update> to change national wonder, I'd like to take a look and see if using the same code works, or if there's some problem from another part of the file that messes other things up.

If you or anyone else reading this want to, here's the link to the xml file in question:https://www.dropbox.com/s/641qax0tr5tgs0y/UpdateBuildings.xml?dl=0
 
Building_ClassesNeededInCity is a table, not a column, so your XML is (very) wrong

Enable logging and check the logs, these things will be reported in the database.log file

Also, attach the complete mod - snippets of code really are of limited use to us
 
Enable logging and check the logs, these things will be reported in the database.log file

Ok, I've enabled them, and will be looking through the files for errors from now on, thanks for that.

I've deleted the snippet that was wrong completely, so now the rest of the xml acts fine (hermitage and broadcast are where i want them)

this is the link to the whole mod :https://www.dropbox.com/sh/2f254i91uk78nis/AADpSN98YuXSGe7kGgYfERXka?dl=0
the part you're looking for is
Winter is Coming to Civ Deluxe\XML\Buildings\UpdateBuildings

I'm updating and fixing some of the problems in this mod as a way of learning how to do modding, I figured that with such an extensive mod out there, I'll be able to learn a wider variety of things. So most of the time i just try things till they work, and then figure out why they worked.
 
You need to update three different tables - Buildings, Building_ClassesNeededInCity and Building_PrereqBuildingClasses, so

Code:
<GameData>
    <Buildings>
        <Update>
            <Where Type="BUILDING_COLOSSEUM"/>
            <Set PortraitIndex="20" ArtDefineTag="NULL" DisplayPosition="0" ArtInfoCulturalVariation="false"/>
        </Update>
		
		...
    </Buildings>

    <Building_ClassesNeededInCity>
        <Update>
            <Where BuildingType="BUILDING_INTELLIGENCE_AGENCY"/>
            <Set BuildingClassType="BUILDINGCLASS_CONSTABLE"/>
        </Update>
    </Building_ClassesNeededInCity>

    <Building_PrereqBuildingClasses>
        <Update>
            <Where BuildingType="BUILDING_INTELLIGENCE_AGENCY"/>
            <Set BuildingClassType="BUILDINGCLASS_CONSTABLE"/>
        </Update>
    </Building_PrereqBuildingClasses>
</GameData>
Caveat: Untested in game, but should be near enough to get working ;)
 
Thank you for your help with this 69, I'll have to test it myself, but from a glance, it's logical: column get updated directly from <building> tables need their own reference. Thanks for showing me this, and having patience with a "noob" ^^
 
Top Bottom