1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Need help with adding Civ

Discussion in 'Civ5 - Creation & Customization' started by TterraggarretT, Jul 24, 2011.

  1. TterraggarretT

    TterraggarretT Chieftain

    Joined:
    Jul 22, 2011
    Messages:
    9
    Ok I am making a new civ and I followed the format of the basic XML as shown in "Kael's Modder's Guide" but when I enable the mod my civ does not appear in the selection. I need to know if the format has to be so precise that one typo or extra space could make it not work or is there another common problem that keeps it from working. Oh yeah this is for Civ V
     
  2. Locutus

    Locutus King of the Collective

    Joined:
    Oct 30, 2001
    Messages:
    365
    Location:
    Hengelo/Enschede, the Netherlands
    Yes, Civ5 is pretty finicky, getting one character wrong can indeed easily lead to a civ not appearing in the selection screen. But also note that Kael's guide is based on (pre?)-release Civ5, some of the patches have made changes to the XML structure so it's probably best not to copy over any of Kael's code samples directly, they make not work correctly anymore. Rather, take a civ from the standard game XML and add that to your mod as your base to work from. First only change the Type and test to see if it shows up in the game, then you can start making more extensive modifications.

    If you put the following code (pretty much the bare minimum you need to add a new civ) in a new mod, add the file name of your XML file to the Actions tab of the mod and use Build Solution, it should show an additional civ (derived off the Arabs but with Washington as leader) in the selection screen once you've loaded that mod in-game. If this doesn't work for you, you're probably doing something wrong in the process of creating and loading your mod. If it does work, you can use this code as starting point for creating new civs.

    Code:
    <GameData>
    	<Civilizations>
    		<Row>
    			<Type>CIVILIZATION_TEST</Type>
    			<Description>TXT_KEY_CIV_ARABIA_DESC</Description>
    			<ShortDescription>TXT_KEY_CIV_ARABIA_SHORT_DESC</ShortDescription>
    			<Adjective>TXT_KEY_CIV_ARABIA_ADJECTIVE</Adjective>
    			<CivilopediaTag>TXT_KEY_CIV5_ARABIA</CivilopediaTag>
    			<DefaultPlayerColor>PLAYERCOLOR_ARABIA</DefaultPlayerColor>
    			<ArtDefineTag>ART_DEF_CIVILIZATION_ARABIA</ArtDefineTag>
    			<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
    			<ArtStyleSuffix>_AFRI</ArtStyleSuffix>
    			<ArtStylePrefix>AFRICAN </ArtStylePrefix>
    			<PortraitIndex>1</PortraitIndex>
    			<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
    			<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
    			<MapImage>MapAbbasid512.dds</MapImage>
    			<DawnOfManQuote>TXT_KEY_CIV5_DAWN_ARABIA_TEXT</DawnOfManQuote>
    			<DawnOfManImage>DOM_AlRashid.dds</DawnOfManImage>
    			<DawnOfManAudio>AS2D_DOM_SPEECH_ARABIA</DawnOfManAudio>
    		</Row>
    	</Civilizations>
    	<Civilization_Leaders>
    		<Row>
    			<CivilizationType>CIVILIZATION_TEST</CivilizationType>
    			<LeaderheadType>LEADER_WASHINGTON</LeaderheadType>
    		</Row>
    	</Civilization_Leaders>
    </GameData>
     
  3. TterraggarretT

    TterraggarretT Chieftain

    Joined:
    Jul 22, 2011
    Messages:
    9
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created by ModBuddy on 7/26/2011 8:56:15 PM -->
    <GameData>
      <!-- TODO: Insert table creation example here. -->
     
      <!-- TODO: Insert table data example here.-->
      
      <!-- <GameData>
    	           <Civilizations>
    		               <Row>
    			                   <Type>CIVILIZATION_ISRAEL</Type>
    			                   <Description>TXT_KEY_CIV_ISRAELI_DESC</Description>
    			                   <ShortDescription>TXT_KEY_CIV_ISRAELI_SHORT_DESC</ShortDescription>
    			                   <Adjective>TXT_KEY_CIV_ISRAELI_ADJECTIVE</Adjective>
    							   <CivilopediaTag>TXT_KEY_CIV5_ISRAEL</CivilopediaTag>
    							   <DefaultPlayerColor>PLAYERCOLOR_ARABIA</DefaultPlayerColor>
    							   <ArtDefineTag>ART_DEF_CIVILIZATION_ARABIA</ArtDefineTag>
    							   <ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
    							   <ArtStyleSuffix>_AFRI</ArtStyleSuffix>
    							   <ArtStylePrefix>AFRICAN </ArtStylePrefix>
    							   <PortraitIndex>1</PortraitIndex>
    							   <IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
    							   <AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
    							   <MapImage>MapAbbasid512.dds</MapImage>
    							   <DawnOfManQuote>TXT_KEY_CIV5_DAWN_ARABIA_TEXT</DawnOfManQuote>
    							   <DawnOfManImage>DOM_AlRashid.dds</DawnOfManImage>
    							   <DawnOfManAudio>AS2D_DOM_SPEECH_ARABIA</DawnOfManAudio>
    					   </Row>
    		       </Civilizations>
    	           <Civilization_Leaders>
    		               <Row>
    			                   <CivilizationType>CIVILIZATION_TEST</CivilizationType>
    			                   <LeaderheadType>LEADER_WASHINGTON</LeaderheadType>
    		               </Row>
    	           </Civilization_Leaders>
           </GameData> -->
      
    </GameData>
    SO this should work right? Because it is not appearing and I know it is building and shipping right, I just need help narrowing down the problem.
     
  4. Locutus

    Locutus King of the Collective

    Joined:
    Oct 30, 2001
    Messages:
    365
    Location:
    Hengelo/Enschede, the Netherlands
    The main issue is that you use CIVILIZATION_ISRAEL for the civ itself and CIVILIZATION_TEST for the leader, you'll need to make sure those match of course.

    At the risk of pointing out the blindingly obvious, you've also commented out almost the entire code -- and you have two nested GameData tags. Get rid of lines 8 and 36 entirely (the inner GameData tags) and the civ should appear in the selection screen (it works for me).
     
  5. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    Yes, you've commented out the entire thing. ModBuddy would show you this by putting it all in green (the comment color). Anything between the <!-- and the --> will be ignored, which in your case is everything. Part of the reason ModBuddy does that coloration is so that it's obvious when you make a mistake like that.

    You've also left out all of the other tables a Civilization needs. Free starting tech, free starting unit (i.e., a Settler), all of the UU and UB overrides, city names, and so on. So your civ just wouldn't work even if you fix the bugs he mentioned, because without a Settler you'll lose the game the moment you try to start.
     
  6. Locutus

    Locutus King of the Collective

    Joined:
    Oct 30, 2001
    Messages:
    365
    Location:
    Hengelo/Enschede, the Netherlands
    No, you don't need any of the extra stuff, the code is fully functional as-is (at least with the changes I outlined) -- as I mentioned, this is the bare minimum code you need to get a functional civ.

    The game gives you 1 Settler by default if you don't specify starting units (you don't get the usual free Warrior though). Obviously, you don't get any UUs or UBs, unique city names, other starting items, etc -- but this is a working starting point to base more extensive changes on. I've used this as a basis for numerous civs myself (all for scenarios, so I don't need starting units anyway; but I've done plenty of testing with them on random maps).
     
  7. TterraggarretT

    TterraggarretT Chieftain

    Joined:
    Jul 22, 2011
    Messages:
    9
    Ok all i care about at this point is getting it to show up so is this correct format.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created by ModBuddy on 7/26/2011 8:56:15 PM -->
    <GameData>
            <Civilizations>
    		        <Row>
    			            <Type>CIVILIZATION_ISRAEL</Type>
    			            <Description>TXT_KEY_CIV_ISRAELI_DESC</Description>
    			            <ShortDescription>TXT_KEY_CIV_ISRAELI_SHORT_DESC</ShortDescription>
    			            <Adjective>TXT_KEY_CIV_ISRAELI_ADJECTIVE</Adjective>
    						<CivilopediaTag>TXT_KEY_CIV5_ISRAEL</CivilopediaTag>
    						<DefaultPlayerColor>PLAYERCOLOR_ARABIA</DefaultPlayerColor>
    						<ArtDefineTag>ART_DEF_CIVILIZATION_ARABIA</ArtDefineTag>
    						<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
    						<ArtStyleSuffix>_AFRI</ArtStyleSuffix>
    						<ArtStylePrefix>AFRICAN </ArtStylePrefix>
    						<PortraitIndex>1</PortraitIndex>
    						<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
    						<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
    						<MapImage>MapAbbasid512.dds</MapImage>
    						<DawnOfManQuote>TXT_KEY_CIV5_DAWN_ARABIA_TEXT</DawnOfManQuote>
    						<DawnOfManImage>DOM_AlRashid.dds</DawnOfManImage>
    						<DawnOfManAudio>AS2D_DOM_SPEECH_ARABIA</DawnOfManAudio>
    			    </Row>
    		</Civilizations>
    	    <Civilization_Leaders>
    		        <Row>
    			            <CivilizationType>CIVILIZATION_ISRAEL</CivilizationType>
    			            <LeaderheadType>LEADER_WASHINGTON</LeaderheadType>
    		        </Row>
    	    </Civilization_Leaders>
    </GameData>
     
  8. Locutus

    Locutus King of the Collective

    Joined:
    Oct 30, 2001
    Messages:
    365
    Location:
    Hengelo/Enschede, the Netherlands
    Have you tested it? It works for me...
     
  9. TterraggarretT

    TterraggarretT Chieftain

    Joined:
    Jul 22, 2011
    Messages:
    9
    Yeah I have tested it but it still does nothing.
     
  10. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    If he got it working and it doesn't work for you, then you probably made a mistake with the OnModActivated command. If you think you got that part right, then zip up your mod (Including the .modinfo file), attach it to a post here, and we'll look at it.
     

Share This Page