OK, since there are several of us modders who are going to be adding tech quotes (text or audio), I have gone and written up a guide to adding a new tech quote. I'm creating a separate thread because this is going to be rather long, quite technical, and I don't want to clutter up the existing threads. We can use those threads for discussing which new quotes to use.
Adding Text
Adding a new text quote is the simpler of the two parts. There are four steps to creating a text quote.
First: Find the technology for which you want to add a quote. This is what I have done to find a tech needing a quote:
Second: Find a quote appropriate to the new technology. It can be respectful, pithy, funny, or anything else you feel fits. You should try to keep the quote short, and you should attribute it if possible.
Third: Return to caveman2cosmos\Assets\XML\Technologies\CIV4TechInfos.xml and change the <Quote> tag so it reads something different. Quote tags are generally named TXT_KEY_TECH_***_QUOTE, where *** is the name of the technology. This helps keep them straight, as two quotes shouldn't be using the same tag.
Fourth: Add the text for the quote. To do this, you can either add the appropriate code to any existing file in caveman2cosmos\Assets\XML\Text, or you can create your own text file by copying one of the existing files, renaming it (as long as the file name ends with .xml), and deleting everything between <Civ4GameText xmlns="http://www.firaxis.com"> and </Civ4GameText>. This is the code you will need to insert before the </Civ4GameText>:
You will need one of these for each quote you want to include. The TXT_KEY_TECH_***_QUOTE you added to CIV4TechInfos.xml goes between <Tag> and </Tag>. Your quote goes between <English> and </English>. Once you add your quote, the C2C translators will add the translations.
Certain characters don't work in XML. These are called escape characters. There are supposedly five of them and if your quote has any of them, you need to replace it with the string on the right or the XML will choke.
" | "
'| '
<| <
>| >
&| &I haven't had any problems with the apostrophe, and I haven't used the less-than or greater-than signs, but I would definitely use " in place of " and & in place of &.
If a tech is using a TBD quote and already has a unique tag, you will instead have to find which file in caveman2cosmos\Assets\XML\Text is using that tag and place your new quote in that file.
Then you're done adding the text quote. I would at this point check your work by loading up Caveman 2 Cosmos. If you did it right, it should look like this:
Adding Audio
Audio files will be needed for any tech quote for which you added a new quote or any tech quote that is currently using in its XML:
You will need an mp3 file of the quote. I think all tech quotes are mp3 files and background sounds are wav files.
First: Copy the mp3 file to caveman2cosmos\Assets\Sounds\Tech.
You will have to edit three files:
Second: The AudioDefines.xml file is for telling the game where to find the sound file. You will need one of these for each audio quote:
The first *** is the name of the technology. The second *** is the exact name of the sound file, without the extension. Don't change anything else. Copy and paste this code into the AudioDefines.xml file, just before the </SoundDatas>. There's only one </SoundDatas> in AudioDefines.xml, so you should be able to find it with a search using a text editor. Then add in the appropriate names.
Third: The Audio2DScripts.xml file tells the game how to play the sound file. This is the code to add to the file:
You will need one of these for each tech quote. Insert one copy of this per quote at the end of Audio2DScripts.xml, just before the </Script2DSounds> at the end. You have to fill in both *** with the name of the technology you are using, just like you did for AudioDefines.xml.
Fourth: Return once more to the CIV4TechInfos.xml file. Find the <Sound></Sound> for the tech you are adding the audio for. Change this to use the ScriptID that you created in Audio2DScripts.xml. Save it and you're done.
Caveat:The <SoundMP> tag is for multiplayer games. I did some searching, and all the MP sound files just say "You have discovered Tech Name." I don't know if we want to get into adding the MP files, but if you do want to add them, you would add the MP audio the same way you add the regular audio.
I think it's a good idea to test your new quote before pushing it to the SVN. Here is my quick-and-dirty guide to testing a new quote:
I hope this helps. Let me know if there are any problems with this guide.
Adding Text
Adding a new text quote is the simpler of the two parts. There are four steps to creating a text quote.
First: Find the technology for which you want to add a quote. This is what I have done to find a tech needing a quote:
- Navigate to caveman2cosmos\Assets\XML\Technologies.
- Open CIV4TechInfos.xml in a text editor. I use Notepad2, but any text editor will work.
- Reduce the text size so that you can see everything between <TechInfo> and </TechInfo> for one entire tech. You'll need pretty small text and a big monitor to do this efficiently, but you can do this by scrolling up and down as well.
- Search for <Quote>TXT_KEY_TECH_ in order to see each technology's quote tag.
- You should be able to see where a technology's name and its quote do not match. This is a tech that is a possibility for a new quote.
- Alternatively, if you are in the Civilopedia, you may see a quote that just says TBD. These are also good targets for replacement.
Example:
I want to add a new quote for Television. As I search for <Quote>TXT_KEY_TECH_, I notice that Television has the following:
which means that Television is using Mass Media's quote, so that makes it a good technology for a new quote.Code:<Quote>TXT_KEY_TECH_MASS_MEDIA_QUOTE</Quote>
Second: Find a quote appropriate to the new technology. It can be respectful, pithy, funny, or anything else you feel fits. You should try to keep the quote short, and you should attribute it if possible.
Example:
Continuing with the Television example, I search Wikiquote for television and find this classic, with attribution (although it is on his page, http://en.wikiquote.org/wiki/Ernie_Kovacs, and not the Television page, http://en.wikiquote.org/wiki/Television):
"Television is a medium, so called because it is neither rare nor well-done." - Ernie Kovacs
Third: Return to caveman2cosmos\Assets\XML\Technologies\CIV4TechInfos.xml and change the <Quote> tag so it reads something different. Quote tags are generally named TXT_KEY_TECH_***_QUOTE, where *** is the name of the technology. This helps keep them straight, as two quotes shouldn't be using the same tag.
Example:
Continuing again, I change the text of Television's Quote tag to read:
Code:<Quote>TXT_KEY_TECH_TELEVISION_QUOTE</Quote>
Fourth: Add the text for the quote. To do this, you can either add the appropriate code to any existing file in caveman2cosmos\Assets\XML\Text, or you can create your own text file by copying one of the existing files, renaming it (as long as the file name ends with .xml), and deleting everything between <Civ4GameText xmlns="http://www.firaxis.com"> and </Civ4GameText>. This is the code you will need to insert before the </Civ4GameText>:
Code:
<TEXT>
<Tag></Tag>
<English></English>
<French></French>
<German></German>
<Italian></Italian>
<Spanish></Spanish>
</TEXT>
Certain characters don't work in XML. These are called escape characters. There are supposedly five of them and if your quote has any of them, you need to replace it with the string on the right or the XML will choke.
'| '
<| <
>| >
&| &
If a tech is using a TBD quote and already has a unique tag, you will instead have to find which file in caveman2cosmos\Assets\XML\Text is using that tag and place your new quote in that file.
Example:
Continuing with the Television example, I add this to the caveman2cosmos\Assets\XML\Text\Vokarya_Tech_Quotes.xml file.Code:<TEXT> <Tag>TXT_KEY_TECH_TELEVISION_QUOTE</Tag> <English>"Television is a medium, so called because it is neither rare nor well-done." - Ernie Kovacs</English> <French></French> <German> </German> <Italian> </Italian> <Spanish> </Spanish> </TEXT>
Then you're done adding the text quote. I would at this point check your work by loading up Caveman 2 Cosmos. If you did it right, it should look like this:
Adding Audio
Audio files will be needed for any tech quote for which you added a new quote or any tech quote that is currently using in its XML:
Code:
<Sound>AS2D_TECH_GENERIC</Sound>
You will need an mp3 file of the quote. I think all tech quotes are mp3 files and background sounds are wav files.
First: Copy the mp3 file to caveman2cosmos\Assets\Sounds\Tech.
You will have to edit three files:
- caveman2cosmos\Assets\XML\Audio\AudioDefines.xml
- caveman2cosmos\Assets\XML\Audio\Audio2DScripts.xml
- caveman2cosmos\Assets\XML\Technologies\CIV4TechInfos.xml
Second: The AudioDefines.xml file is for telling the game where to find the sound file. You will need one of these for each audio quote:
Code:
<SoundData>
<SoundID>SND_TECH_***</SoundID>
<Filename>Sounds/Tech/***</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>
Example:
Back to Television again. For this example, say I have a file named Television.mp3 and I've already copied it to caveman2cosmos\Assets\Sounds\Tech. I edit AudioDefines.xml with this:
Code:<SoundData> <SoundID>SND_TECH_TELEVISION</SoundID> <Filename>Sounds/Tech/Television</Filename> <LoadType>DYNAMIC_RES</LoadType> <bIsCompressed>1</bIsCompressed> <bInGeneric>1</bInGeneric> </SoundData>
Third: The Audio2DScripts.xml file tells the game how to play the sound file. This is the code to add to the file:
Code:
<Script2DSound>
<ScriptID>AS2D_TECH_***</ScriptID>
<SoundID>SND_TECH_***</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<iMinLeftPan>-1</iMinLeftPan>
<iMaxLeftPan>-1</iMaxLeftPan>
<iMinRightPan>-1</iMinRightPan>
<iMaxRightPan>-1</iMaxRightPan>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.0</fMinWetLevel>
<fMaxWetLevel>0.0</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script2DSound>
You will need one of these for each tech quote. Insert one copy of this per quote at the end of Audio2DScripts.xml, just before the </Script2DSounds> at the end. You have to fill in both *** with the name of the technology you are using, just like you did for AudioDefines.xml.
Example:
Television again. I open up Audio2DScripts.xml and add this to the end:
Code:<Script2DSound> <ScriptID>AS2D_TECH_TELEVISION</ScriptID> <SoundID>SND_TECH_TELEVISION</SoundID> <SoundType>GAME_SPEECH</SoundType> <iMinVolume>100</iMinVolume> <iMaxVolume>100</iMaxVolume> <iPitchChangeDown>0</iPitchChangeDown> <iPitchChangeUp>0</iPitchChangeUp> <iMinLeftPan>-1</iMinLeftPan> <iMaxLeftPan>-1</iMaxLeftPan> <iMinRightPan>-1</iMinRightPan> <iMaxRightPan>-1</iMaxRightPan> <bLooping>0</bLooping> <iMinTimeDelay>0</iMinTimeDelay> <iMaxTimeDelay>0</iMaxTimeDelay> <bTaperForSoundtracks>0</bTaperForSoundtracks> <iLengthOfSound>0</iLengthOfSound> <fMinDryLevel>1.0</fMinDryLevel> <fMaxDryLevel>1.0</fMaxDryLevel> <fMinWetLevel>0.0</fMinWetLevel> <fMaxWetLevel>0.0</fMaxWetLevel> <iNotPlayPercent>0</iNotPlayPercent> </Script2DSound>
Fourth: Return once more to the CIV4TechInfos.xml file. Find the <Sound></Sound> for the tech you are adding the audio for. Change this to use the ScriptID that you created in Audio2DScripts.xml. Save it and you're done.
Example:
Television one last time. I open up CIV4TechInfos.xml and edit so I have this:
Code:<TechInfo> <Type>TECH_TELEVISION</Type> [I]...much snipping here...[/I] <Quote>TXT_KEY_TECH_TELEVISION_QUOTE</Quote> <Sound>AS2D_TECH_TELEVISION</Sound> <SoundMP>AS2D_TECH_MP_MASS_MEDIA</SoundMP> <Button>Art/Interface/Buttons/TechTree/television.dds</Button> </TechInfo>
Caveat:The <SoundMP> tag is for multiplayer games. I did some searching, and all the MP sound files just say "You have discovered Tech Name." I don't know if we want to get into adding the MP files, but if you do want to add them, you would add the MP audio the same way you add the regular audio.
I think it's a good idea to test your new quote before pushing it to the SVN. Here is my quick-and-dirty guide to testing a new quote:
- Start Caveman2Cosmos.
- Start a Custom Game with the following settings: Duel size, Mastery Victory on, no rivals, No Barbarians checked.
- Build the starting city.
- Go into Worldbuilder.
- Raise the starting city size to 11.
- Give the city a Good (Fusion Power). It's close to the bottom of the building list so it is easy to find.
- Give your civilization the Divination tech and all the technologies needed as prerequisites for the tech you are trying to test.
- Have the city build the Oracle. It will take one turn with Fusion Power.
- Select the tech you want to test. After the Oracle movie plays, you will get the popup for the tech and the quote should play if you did everything right.
I hope this helps. Let me know if there are any problems with this guide.