Trouble Creating a Great Works Mod

AgentGrady

Chieftain
Joined
May 27, 2018
Messages
5
I created a mod to add new great works and I recently tested it with the in-game editor mod, I did this by spawning several great writers. However, none of the writers associated with the great works I added spawned and reached the point where I had spawned all the writers in the game and all others just spawn as "great writer", none of mine appear. What am I doing wrong?
 
One (or more) of any number of things. You need to attach the zipped version of the mod from the game's MODS folder in order to get a more meaningful answer.

See: whoward69's zip your mods and attach tutorial for what to zip. Just bear in mind that the process for actually adding the zip to a forum post is now different since the CFC website software was updated a few months ago about a year ago. To attach the zip to a forum post, look for a button called Upload A File when composing your thread reply: this button opens a browse menu where you can select the zipped folder to attach directly to a forum post.
 
Alright, here is the file in question. Thank for pointing out the error I had made here though in truth I was wondering if I would need try and post the mod somehow. However, I would not have know how to do this.
 

Attachments

  1. You have double <GameData> tags in all your files. This is wrong
    Code:
    <GameData>
    	<GameData>
    		<Language_en_US>
                      ...etc......
    This is correct
    Code:
    <GameData>
    	<Language_en_US>
                      ...etc......
  2. You have fatal syntax errors in every one of your rows in table <Unit_UniqueNames>. You cannot have these numeric line-item things like you are trying to do:
    Code:
    <Row>
    	1.         <UnitType>UNIT_WRITER</UnitType>
    	2.         <UniqueName>TXT_KEY_GREAT_PERSON_Eumelus_of_Corinth</UniqueName>
    	3.        <GreatWorkType>Titanomachy</GreatWorkType>
    </Row>
    They cause the game to reject the entire contents of the file. Correct syntax for that row would be
    Code:
    <Row>
    	<UnitType>UNIT_WRITER</UnitType>
    	<UniqueName>TXT_KEY_GREAT_PERSON_Eumelus_of_Corinth</UniqueName>
    	<GreatWorkType>Titanomachy</GreatWorkType>
    </Row>
  3. Any one of the above errors you made would cause an error message to be generated in the Database.log file, and the entire contents of the file to be rejected by the game
  4. "GREAT_WORK_Titanomachy" listed as a <Type> in table <GreatWorks> does not match to anything for <GreatWorkType> in table <Unit_UniqueNames>. This issue appears to be true for all your Great Work <Type> names. Everything must exactly match between the two, including uppercase/lowercase matching.

    As an example with this row in table <Unit_UniqueNames>:
    Code:
    <Row>
    	<UnitType>UNIT_WRITER</UnitType>
    	<UniqueName>TXT_KEY_GREAT_PERSON_HOMER</UniqueName>
    	<GreatWorkType>GREAT_WORK_ODYSSEY</GreatWorkType>
    </Row>
    the designation for <GreatWorkType> exactly matches to a <Type> in table <GreatWorks> :
    Code:
    <Row>
    	<Type>GREAT_WORK_ODYSSEY</Type>
    	<GreatWorkClassType>GREAT_WORK_LITERATURE</GreatWorkClassType>
    	<Description>TXT_KEY_GREAT_WORK_ODYSSEY</Description>
    	<Quote>TXT_KEY_GREAT_WORK_QUOTE_ODYSSEY</Quote>
    	<Audio>AS2D_GREAT_WRITER_ODYSSEY</Audio>
    	<Image>GreatWriter_Background.dds</Image>
    </Row>
  5. Text key tag-names must always be all in caps or the game does not properly pull the data in the <Text> field from table <Language_en_US>. So if you state "TXT_KEY_GREAT_WORK_Titanomachy", in the game you do not get
    Code:
    In the midst of them danced the Father of men and gods..
    You get
    Code:
    TXT_KEY_GREAT_WORK_Titanomachy
  6. You've also put the great work "quotes" into the tags where the names of the great works belong, and not provided the text for the "quotes" anywhere.

    <Description> is for the tag with the name of the great work
    <Quote> is for the tag with the literary "quote" for the great work.
  7. Since <UniqueName> in table <Unit_UniqueNames> is a reference to a TXT_KEY tag, you also need to define these TXT_KEY references in table <Language_en_US>, and you cannot have !! or ? or . or any other characters except Capital letters of the english alphabet, underscore _ seperators, and english-alphabet numberals 0-9 as any part of the TXT_KEY tag-name.



If you have not already done so, enable error logging: whoward69's enable error logging tutorial
 
Ok, I have fixed the problems that you have mentioned and now the Great Writers spawn but with the underscore etc included in their name e.g:

TXT_KEY_GREAT_PERSON_Eumelus_of_Corinth

I tried taking out the portion before their name but then they spawn with the underscore still included eg:

Eumelus_of_Corinth

They also have no great works that they can write, they can only write a political document.

Where do I go from here?
 

Attachments

You've used the same great person <UniqueName> reference twice:
Code:
<Row>
	<UnitType>UNIT_WRITER</UnitType>
	<UniqueName>TXT_KEY_GREAT_PERSON_EUMELUS_OF_CORINTH</UniqueName>
	<GreatWorkType>GREAT_WORK_CORINTHIACA</GreatWorkType>
</Row>
<Row>
	<UnitType>UNIT_WRITER</UnitType>
	<UniqueName>TXT_KEY_GREAT_PERSON_EUMELUS_OF_CORINTH</UniqueName>
	<GreatWorkType>GREAT_WORK_EUROPIA</GreatWorkType>
</Row>
---------------------------

You have never defined within table <Language_en_US> either TXT_KEY_GREAT_PERSON_EUMELUS_OF_CORINTH or TXT_KEY_GREAT_WORK_CORINTHIACA as examples.

This was mentioned before. You need to define the TXT_KEY in table <Language_en_US> for both the name of the great person and the name of the great work.

-------------------------------------

Fix these issues first, because other than those I see nothing obviously wrong except (possibly) issues with sound-file designations. I see in the 20th Century Great Works mod, there are no sound files, and the great works of writing are defined like this example
Code:
<Row>
	<Type>GREAT_WORK_LORD_OF_THE_FLIES</Type>
	<GreatWorkClassType>GREAT_WORK_LITERATURE</GreatWorkClassType>
	<Description>TXT_KEY_GREAT_WORK_LORD_OF_THE_FLIES</Description>
	<Quote>TXT_KEY_GREAT_WORK_QUOTE_LORD_OF_THE_FLIES</Quote>
	<Image>GreatWriter_Background.dds</Image>
</Row>
Whereas all your great works are referencing the AS2D_GREAT_ARTIST_ARTWORK audio file like in this row in your mod
Code:
<Row>
	<Type>GREAT_WORK_MINYAS</Type>
	<GreatWorkClasssType>GREAT_WORK_LITERATURE</GreatWorkClasssType>
	<Description>TXT_KEY_GREAT_WORK_MINYAS</Description>
	<Quote>TXT_KEY_GREAT_WORK_QUOTE_MINYAS</Quote>
	<Audio>AS2D_GREAT_ARTIST_ARTWORK</Audio>
	<Image>GreatWriter_Background.dds</Image>
</Row>
---------------------------------------------

After you fix the issues mentioned, run the mod and check Database.log to see what if anything is being reported that relates to your mod.
 
I defined both the great persons and great works, yet I still have the same problem. I tried both having the author definitions in a separate file and in the same on but to no avail.

Edit

Upon checking the log files the xml log tells me that 'TXT_KEY_' tags must be under 120 characters long but as far as I can tell none of my tags are over that length.
 

Attachments

Last edited:
  1. Enable error logging: whoward69's enable error logging tutorial
  2. Your mod generates the following errors in Database.log
    • This error is a fatal syntax error in your file CIV5GreatWorks_EXPANSION2.xml, and the game rejects the entire file:
      Code:
      [1153243.750] table GreatWorks has no column named GreatWorkClasssType
      [1153243.750] In Query - insert into GreatWorks('Type', 'GreatWorkClasssType', 'Description', 'Quote', 'Audio', 'Image') values (?, ?, ?, ?, ?, ?);
      [1153243.750] In XMLSerializer while updating table GreatWorks from file CIV5GreatWorks_EXPANSION2.xml.
      You have an extra 's' everywhere you have stated <GreatWorkClasssType>
    • You have repeat definitions of the same Tag in your language file:
      Code:
      [1153243.750] columns Language, Tag are not unique
      [1153243.750] While executing - 'insert into Language_en_US('Tag', 'Text') values (?, ?);'
      [1153243.750] In XMLSerializer while inserting row into table insert into Language_en_US('Tag', 'Text') with  values (TXT_KEY_GREAT_WORK_QUOTE_TITANOMACHY, Titanomachy, ).
      [1153243.750] In XMLSerializer while updating table Language_en_US from file Language_en_US.xml.
      [1153243.765] columns Language, Tag are not unique
      You've repeated the tag-name for every one of your great works in file Language_en_US.xml

      Example
      Code:
      <Row Tag="TXT_KEY_GREAT_WORK_QUOTE_TITANOMACHY">
      	<Text>In the midst of them danced the Father of men and gods..</Text>
      </Row>
      <Row Tag="TXT_KEY_GREAT_WORK_QUOTE_TITANOMACHY">
                <Text>Titanomachy</Text>
      </Row>
      The very first of these repeats causes the game to reject the entire contents of the file. Each and every Tag stated in table <Language_en_US> must be unique to each and every one already entered by the base game, its expansions and DLC, and by any and all mods which are loading before your mod, as well as the contents of your own mod. To conform to the rest of what you have coded within your mod you need
      Code:
      <Row Tag="TXT_KEY_GREAT_WORK_QUOTE_TITANOMACHY">
      	<Text>In the midst of them danced the Father of men and gods..</Text>
      </Row>
      <Row Tag="TXT_KEY_GREAT_WORK_TITANOMACHY">
                <Text>Titanomachy</Text>
      </Row>
  3. TXT_KEY_GREAT_PERSON_HOMER already exists in the base-game as a great person UniqueName and as a Tag in the Language_en_US table. Therefore you can not use it. Attempting to do so will also cause a rejection of the entire contents of your Language_en_US.xml file.
  4. You have a whoops here in the <Description> and <Quote> designations
    Code:
    <Row>
    	<Type>GREAT_WORK_PHORONIS</Type>
    	<GreatWorkClasssType>GREAT_WORK_LITERATURE</GreatWorkClassType>
    	<Description>TXT_KEY_GREAT_WORK_CYPRIA</Description>
    	<Quote>TXT_KEY_GREAT_WORK_QUOTE_CYPRIA</Quote>
    	<Audio>AS2D_GREAT_ARTIST_ARTWORK</Audio>
    	<Image>GreatWriter_Background.dds</Image>
    </Row>
  5. Not sure at all how the game is going to handle this in-game
    Code:
    <Row Tag="TXT_KEY_GREAT_PERSON_HESIOD">
    	<Text>Hesiod«</Text>
    </Row>
    Not sure how it is going to try to display the « character. You have multiple occurances of this character in your language file.
 
Thank for your help this has this has solved all the problems. I have never been good at programming, so there was no way that I would have been able to be able to solve this myself.
 
Back
Top Bottom