Renaming Great Generals

Bonyduck Campersang

Staring into the distance
Joined
Dec 11, 2022
Messages
4,681
Trying to make a mod that renames already existing Great Generals. Tried to copy and adapt RawSasquatch's Ukraine mod's code that replaces the city-state of Kiev:
Code:
<MinorCivilizations>
        <Update>
            <Where Type="MINOR_CIV_KIEV"/>
            <Set>
                <Description>TXT_KEY_CITYSTATE_RS_MINSK</Description>
                <ShortDescription>TXT_KEY_CITYSTATE_RS_MINSK</ShortDescription>
                <Adjective>TXT_KEY_CITYSTATE_RS_MINSK_ADJ</Adjective>
                <Civilopedia>TXT_KEY_CITYSTATE_RS_MINSK_PEDIA</Civilopedia>
            </Set>
        </Update>
    </MinorCivilizations>
to this:
Code:
<Language_en_US>
    <Update>
        <Where Tag="TXT_KEY_GREAT_PERSON_PATTON"/>
        <Set>
            <Text>George S. Patton</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_ZHUKOV"/>
        <Set>
            <Text>Georgy Zhukov</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_GUERDIAN"/>
        <Set>
            <Text>Guardian</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_ROMMEL"/>
        <Set>
            <Text>Rommel von Pommel</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_MONTGOMERY"/>
        <Set>
            <Text>Ulysses</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_ROBERT_LEE"/>
        <Set>
            <Text>Johannes Cabal</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_GERONIMO"/>
        <Set>
            <Text>Charlie Brown</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_EUGENE_OF_SAVOY"/>
        <Set>
            <Text>Kisser Boy</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_CROMWELL"/>
        <Set>
            <Text>Tom Brown</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_MICHEL_DE_RUYTER"/>
        <Set>
            <Text>Master Oogway</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_IVAN_THE_TERRIBLE"/>
        <Set>
            <Text>Ivan the Sonkiller</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_FRANCISCO_PIZARRO"/>
        <Set>
            <Text>Carlo Ancelotti</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_HERNAN_CORTES"/>
        <Set>
            <Text>Pep Guardiola</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_AUITZOTL"/>
        <Set>
            <Text>Chief Big Stick</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_JEANNE_DARC"/>
        <Set>
            <Text>Andy</Text>
        </Set>
        <Where Tag="TXT_KEY_GREAT_PERSON_SUBUTAI"/>
        <Set>
            <Text>Big Chief No ****</Text>
        </Set>
        </Update>
but it's not working (game crashing at loadup). How do I rename Great Generals?

Mod is attached.


(Note: Just so that anyone reading this knows, I don't actually intend the above names to be used in my mod, they're simply randomly named placeholders for testing the code.)
 

Attachments

Above mod didn't work (predictably) so I had another look at the Ukraine mod and this time decided to replace the UniqueNames themselves instead of just their English text. Like so:

Code:
<GameData>
    <Language_en_US>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_ZHUKOV"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_ZHUKOV</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_PATTON"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_PATTON</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_GUERDIAN"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_GUDERIAN</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_ROMMEL"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_ROMMEL</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_MONTGOMERY"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_MONTGOMERY</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_SARGON"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_SARGON</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_SUN_TZU"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_SUNTZU</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_LEONIDAS"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_LEONIDAS</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_LYSANDER"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_LYSANDER</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_VERCINGETORIX"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_VERCINGETORIX</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_ARMINIUS"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_ARMINIUS</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_CAO_CAO"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_CAO_CAO</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_ZHUGE_LIANG"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_ZHUGE_LIANG</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_BELISARIUS"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_BELISARIUS</UniqueName>
        </Row>
        <Delete UnitType="UNIT_GREAT_GENERAL" UniqueName="TXT_KEY_GREAT_PERSON_KHALED_IBN_AL_WALID"/>
        <Row>
            <UnitType>UNIT_GREAT_GENERAL</UnitType>
            <UniqueName>TXT_KEY_GREAT_GENERAL_KHALED</UniqueName>
        </Row>
        </Language_en_US>
</GameData>
And:
Code:
<GameData>
    <Language_en_US>
    <Row Tag="TXT_KEY_GREAT_GENERAL_ZHUKOV">
        <Text>Georgy Zhukov</Text>
    </Row>
    <Row Tag="TXT_KEY_GREAT_GENERAL_PATTON">
        <Text>George S. Patton</Text>
    </Row>
    <Row Tag="TXT_KEY_GREAT_GENERAL_GUDERIAN">
        <Text>Heinz Guderian</Text>
    </Row>
    <Row Tag="TXT_KEY_GREAT_GENERAL_ROMMEL">
        <Text>Erwin von Rommel</Text>
    </Row>
    <Row Tag="TXT_KEY_GREAT_GENERAL_MONTGOMERY">
        <Text>Bernard Montgomery</Text>
    </Row>
    <Row Tag="TXT_KEY_GREAT_GENERAL_SARGON">
        <Text>Sargon The Man</Text>
    </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_SUNTZU">
            <Text>Ah Chu</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_LEONIDAS">
            <Text>Liono</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_LYSANDER">
            <Text>Shrek</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_VERCINGETORIX">
            <Text>Rodolfo</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_ARMINIUS">
            <Text>Eusebius</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_CAO_CAO">
            <Text>Ciao Ciao</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_ZHUGE_LIANG">
            <Text>Amadeus</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_BELISARIUS">
            <Text>Pontius</Text>
        </Row>
        <Row Tag="TXT_KEY_GREAT_GENERAL_KHALED">
            <Text>Khalid</Text>
        </Row>
    </Language_en_US>
</GameData>
but this does absolutely nothing. Can someone help me with this?

Attaching revised mod.
 

Attachments

One of the most important modding skills to master is learning to read the error logs (of which the first skill is to actually read them!) ...
stopwatch.log - were my mod's files actually read
xml.log - did my mod have any bad xml syntax
database.log - did my mod execute invalid sql (either directly from a .sql file, or indirectly from a .xml file)

From database.log
Code:
[25944.609] no such column: UnitType
[25944.609] In Query - DELETE FROM Language_en_US WHERE UnitType = ? AND UniqueName = ?;
[25944.609] Database::XMLSerializer (RemovingGens.xml): There was an error executing the delete statement! See Database.log for details.
[25944.609] In XMLSerializer while updating table Language_en_US from file RemovingGens.xml.
 
Resurrecting this thread. Mod was working for a while, but now Language_en_US names aren't showing up (have checked logs).
From the logs:
Spoiler :
[536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_1" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_2" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_3" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_4" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_5" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_6" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_7" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_8" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_9" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_10" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_11" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_12" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_13" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_14" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_15" does not exist in Language_en_US [536101.515] Invalid Reference on Unit_UniqueNames.UniqueName - "TXT_KEY_GREAT_GENERAL_ALT_16" does not exist in Language_en_US


I've checked the XML code and there doesn't seem to be anything untoward.
Mod is attached.
 

Attachments

You've attached the modbuddy project, not the mod
I followed the steps in your guide??
exz4fkbi.png

Anyway, attaching it again.
 

Attachments

But that's not what you attached in post #5 (no version number in the file name)
 
Code:
[563025.125] While executing - 'insert into Language_en_US('Tag', 'Text') values (?, ?);'
[563025.125] In XMLSerializer while inserting row into table insert into Language_en_US('Tag', 'Text') with  values (TXT_KEY_GREAT_GENERAL_ALT_267, Stilicho, ).
[563025.125] In XMLSerializer while updating table Language_en_US from file NamingGens.xml.
[563025.125] columns Language, Tag are not unique

Read the log from the beginning ...

One error in an XML/SQL file will cause the entire file to be discarded
 
Back
Top Bottom