GravityGames
Chieftain
- Joined
- Jan 20, 2015
- Messages
- 35
Hello and welcome to my Civilization: Beyond Earth custom sponsor tutorial. I hope to eventually cover everything about making custom sponsors, but Im writing this as I make a sponsor (and teaching isnt really my gift either), so bear with me, as Im learning too. Alright, so lets get started.
Step 1: Starting Your Project:
Alright, so the first step is quite obviously to start your sponsor project, and the first step to do that is to get an idea. If you dont have a specific idea, and simply want to try your hand at making a sponsor, then why not be a nice person and take a request? Im quite sure the ratio of modders to regular gamers is rather low, and there are many unanswered requests to choose from. Granted, some of these requests may just be stupid, but theres no harm in looking. If all else fails, you could just do an alternate history faction, but theres understandably a lot of those, so Id save that as a last resource, lest you want to risk making another Space Rome/Japan/murica/etc. Against my better judgment, rather than use progress from my Grom mod as an example, Im instead going to take a request (that was likely made in jest to begin with anyway):
Shang Mu (Zao)-
UA- Units and Buildings cost 25% less gold, +1 gold for each city, +5% gold for each trade route
UU- Infantry Truck: Replaces Landships, removes debuf for attacking cities, and more movement and combat strength
UB- Zaos Shopping Mall: Replaces the Stock Exchange, provides +2 gold and +50% gold
granted this is actually a Civ 5 request (you can tell right away from the unique unit and building parts), but considering that I sprung for that insane Steam deal not too long ago (the one with Civ 3, Civ 4, Civ 5 and Civ:BE for only 30 bucks), and I accidently bought the DLC thinking it was the expansions, and Ive already spent pretty much my entire gaming budget between that and Freedom Planet (What? Im a retro gamer. 60 bucks is normally enough to take me up through November, and then I just ask for anything else I want for Christmas. So I probably wont be getting Brave New World or Gods and Kings anytime soon. Though I probably wont be able to wait until next year TBE ), Im going to use this request for my tutorial. AFAIK, no one else plays Vanilla Civ 5 these days anyways (and honestly the setting of BE is probably more fitting as well)
Alright, if you have your idea ready, the next step is to start a new project. If you havent already, download the Civilization: Beyond Earth SDK from Steam, run it, select ModBuddy, and start a new project. Fill in all the information boxes that pop up and prepare to begin! You should start with a completely empty project. Do not fear, the void will NOT devour you, so long as you fill it with all the files you need. So lets begin in step 2.
Step 2: Letting Beyond Earth Know That You Exist:
We need to let the game know our custom sponsor exists. To do so, we need to create a new XML file. Right click on the root of your project, move your mouse down to add, and select the New Item option. Select the Game Rules (XML) option, and choose a fitting name. It can be anything you want, but Im going to try and stick as close to Firaxiss naming conventions as possible (though not exact as to prevent replacing the stock sponsors). Im going to name mine CivBECivilizations_ShangMu.xml. Now, with your new XML created, you can begin actually making your sponsor. To do so, Im going to look at each define the official sponsors have, and then add them to my XML and change them as needed. Heres the code, Ill explain each variable, dont worry:
and what each line does:
<Civilizations> and <Row>: These define the tables, and tags like these are used in a lot of places in Civilization: Beyond Earth XMLs, more specifically the <Row> tag.
<Type>: This is how your sponsor will be referenced in your XML files.
<Description>: This is what your nation will be called in-game. Dont enter your text directly, well add the text properly soon, for now, just choose a fitting name for the text entry.
<ShortDescription>: This is the shortened version of the description tag. For instance, USA as opposed to United States of America
<Adjective>: The adjective applied to units owned by this sponsor.
<CivilopediaTag>: Related to the civilopedia, Im honestly not quite sure what this one does, as Ive yet to mess with Civilopedia entries.
<DefaultPlayerColor>: The colors used by this sponsor. Dont worry, Ill cover how to make a custom color set later.
<ArtDefineTag>: Something to do with art used for GUI, etc. Not quite sure exactly what it does.
<ArtStyleType>: Something to do with art used for GUI, etc. Not quite sure exactly what it does.
<PortraitIndex>: Related to the icon used. In cases where youre not using the default icons, this will be set to 0 about 99% of the time.
<IconAtlas>: The image to use for the sponsor icon. Right now, the default image is being used, ARCs part to be exact.
<AlphaIconAtlas>: As far as I know, this is the version of the icon that gets recolored in certain parts of the GUI.
<GradientIconAtlas>: EDIT: As far as I know, this goes unused.
<GlowIconAtlas>: EDIT: As far as I know, this goes unused.
<MapImage />: Im assuming that this is a leftover from Civ 5
<ArtStyleSuffix> and <ArtStylePrefix>: Not quite sure to be honest.
<IntroductionQuote>: The quote that appears on the loading screen.
<IntroductionImage>: EDIT: This actually does affect the image that shows on the loading screen. I played as Brasilia and the image was radically different.
<IntroductionAudio>: Im pretty sure this is the audio that plays during the intro. Ive seen mods that use it, but if I recall, all of the stock sponsors are completely silent here.
<Personality>: Not sure if this actually affects the personality of the sponsor in any way (as far as I know, its all set in a different place, but I could be wrong), so I set to the closest thing to a warmonger in the game just in case
Now we need to add the default names for cities:
You can add as many city names as you want, but the official sponsors all have either ninteen or twenty. I would personally define at least twenty entries.
Now we need to define the buildings that our sponsor starts with. I know what youre thinking, my sponsor doesnt start with a free building, why would I need to set it to start it off with one? Unless your sponsor IS going to start with one that is, in which case you stayed silent. For the majority who fit into group one, thats technically incorrect, every sponsor starts out with a headquarters building, so we need to define that for our sponsor like so:
Likewise, each sponsor starts with the habitation tech, which is in the center of the tech web:
Now we need to tell the game which leader to use for our sponsor. Well create Mayor Zao in a later step, for now, to the disappointment of nearly everyone who actually knows who the heck Ive been making, well simply use ARCs leader.
Then we need to add spy names:
Finally, we need to let the game know that our sponsor cant spawn alien drones (yes, the regular sponsors do it to, Im surprised theres actually an alien unit without a human equivalent )
now I know what youre thinking, and no. All this is still not enough to get your sponsor to show up in the game. Theres still a bit more we need to do to even get it to appear, much less act unique. Now we need to add that text I mentioned earlier. Create another XML file (well, you dont have to, but it helps to keep things organized ), and name it whatever you like. Im going to go with CivBETextEntries_ShangMu.xml (not sure where this stuff is in the vanilla files, I actually havent looked before).
Now, the code for the text XML:
The Language attribute defines what language the text is in, and the main reason why you cant just type in text willy-nilly wherever you like (that and the fact that itll give you an error if you try). Civilization: Beyond Earth will replace this with some text with the same Tag but a different Language for that specific languages region if we define it as well. An example:
If I put this text into the game, people could choose to be alerted to the fact that I speak English and not Spanish in either English or Spanish (though the Spanish is likely horribly misspelled...), get it? Good. Now the text in the Tag attribute should look familiar (with the exception of TXT_KEY_CIV_INTRO_SHANG_MU_TEXT_0, but Ill get to that), and thats because it is. That text is what we referenced in the first XML. Now the last tag is special, remember the % symbol in one of the tags in the first XML, well in Beyond Earth, the % symbol can be used to replace any number. That means during the loading screen, the game will look forTXT_KEY_CIV_INTRO_SHANG_MU_TEXT_0, then TXT_KEY_CIV_INTRO_SHANG_MU_TEXT_1, and so on. This is how you get different text to appear for the same event, like how the sponsors have more than one greeting. You should be able to use this knowledge to fill in the other text entries, but Im going to do that later, as we have enough for our faction to show up on the sponsor select screen. Now, if all went well, we SHOULD be able to see our faction almost. Before we leave ModBuddy, we want to save and compile our work. Click the icon with two floppy disks to save all of the open files, then click on the Build tab at the top and select Build Solution. Now our mod should appear when we open the mod section in Beyond Earth, so lets go check!
https://dl.dropboxusercontent.com/u/29071079/Civ%20Modding/Beyond%20Earth/Custom%20Sponsor%20Tutorial/001.png
Well, the mod shows up in the mods section, but when I went to set up the game (not shown), Shang Mu didnt appear. Sorry, I forgot the most important part (and also sorry for all the mods I have installed, but lets face it, the stock sponsors are all really, REALLY boring, and this is coming from someone who actually likes the game. Hence why I have 64 hours of playtime so far on Civ:BE and only about half the achievements. Because I have to play with the boring stock sponsors ). Go back to the Mod Buddy window and right click on the top of our project, click properties, and the Mod Properties window should appear. Click on actions, then click add. Now, select OnModActivated for the event, UpdateDatabase for the action, and select one of your XMLs for the file. Repeat for the other XML. NOW save and compile, and see the mod appear.
https://dl.dropboxusercontent.com/u/29071079/Civ%20Modding/Beyond%20Earth/Custom%20Sponsor%20Tutorial/002.png
LOOK! THERE IT IS! RIGHT BELOW ARC! with ARCs ability. Thats because we set ARCs leader as our sponsors leader, thats where the abilities are tied to. Well, Im going to get working on the next part of the tutorial, where Ill cover making custom icons, in the meantime, why not fill in those extra text entries? Hope this helped someone get started!
Step 1: Starting Your Project:
Alright, so the first step is quite obviously to start your sponsor project, and the first step to do that is to get an idea. If you dont have a specific idea, and simply want to try your hand at making a sponsor, then why not be a nice person and take a request? Im quite sure the ratio of modders to regular gamers is rather low, and there are many unanswered requests to choose from. Granted, some of these requests may just be stupid, but theres no harm in looking. If all else fails, you could just do an alternate history faction, but theres understandably a lot of those, so Id save that as a last resource, lest you want to risk making another Space Rome/Japan/murica/etc. Against my better judgment, rather than use progress from my Grom mod as an example, Im instead going to take a request (that was likely made in jest to begin with anyway):
Shang Mu (Zao)-
UA- Units and Buildings cost 25% less gold, +1 gold for each city, +5% gold for each trade route
UU- Infantry Truck: Replaces Landships, removes debuf for attacking cities, and more movement and combat strength
UB- Zaos Shopping Mall: Replaces the Stock Exchange, provides +2 gold and +50% gold
granted this is actually a Civ 5 request (you can tell right away from the unique unit and building parts), but considering that I sprung for that insane Steam deal not too long ago (the one with Civ 3, Civ 4, Civ 5 and Civ:BE for only 30 bucks), and I accidently bought the DLC thinking it was the expansions, and Ive already spent pretty much my entire gaming budget between that and Freedom Planet (What? Im a retro gamer. 60 bucks is normally enough to take me up through November, and then I just ask for anything else I want for Christmas. So I probably wont be getting Brave New World or Gods and Kings anytime soon. Though I probably wont be able to wait until next year TBE ), Im going to use this request for my tutorial. AFAIK, no one else plays Vanilla Civ 5 these days anyways (and honestly the setting of BE is probably more fitting as well)
Alright, if you have your idea ready, the next step is to start a new project. If you havent already, download the Civilization: Beyond Earth SDK from Steam, run it, select ModBuddy, and start a new project. Fill in all the information boxes that pop up and prepare to begin! You should start with a completely empty project. Do not fear, the void will NOT devour you, so long as you fill it with all the files you need. So lets begin in step 2.
Step 2: Letting Beyond Earth Know That You Exist:
We need to let the game know our custom sponsor exists. To do so, we need to create a new XML file. Right click on the root of your project, move your mouse down to add, and select the New Item option. Select the Game Rules (XML) option, and choose a fitting name. It can be anything you want, but Im going to try and stick as close to Firaxiss naming conventions as possible (though not exact as to prevent replacing the stock sponsors). Im going to name mine CivBECivilizations_ShangMu.xml. Now, with your new XML created, you can begin actually making your sponsor. To do so, Im going to look at each define the official sponsors have, and then add them to my XML and change them as needed. Heres the code, Ill explain each variable, dont worry:
Code:
<Civilizations>
<Row>
<Type>CIVILIZATION_SHANG_MU</Type>
<Description>TXT_KEY_CIV_SHANG_MU_DESC</Description>
<ShortDescription>TXT_KEY_CIV_SHANG_MU_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_SHANG_MU_ADJECTIVE</Adjective>
<CivilopediaTag>TXT_KEY_CIV_SHANG_MU</CivilopediaTag>
<DefaultPlayerColor>PLAYERCOLOR_ARC</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_CHINA</ArtDefineTag>
<ArtStyleType>ARTSTYLE_ASIAN</ArtStyleType>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>CIV_COLOR_ATLAS</IconAtlas>
<AlphaIconAtlas>CIV_ALPHA_ATLAS</AlphaIconAtlas>
<GradientIconAtlas>CIV_GRADIENT_ATLAS</GradientIconAtlas>
<GlowIconAtlas>CIV_GLOW_ATLAS</GlowIconAtlas>
<MapImage/>
<ArtStyleSuffix>_ASIA</ArtStyleSuffix>
<ArtStylePrefix>ASIAN </ArtStylePrefix>
<IntroductionQuote>TXT_KEY_CIV_INTRO_SHANG_MU_TEXT_%</IntroductionQuote>
<IntroductionImage>DOM_Blue.dds</IntroductionImage>
<IntroductionAudio>AS2D_DOM_SPEECH_UNITED_STATES</IntroductionAudio>
<Personality>PERSONALITY_BRASILIA</Personality>
</Row>
</Civilizations>
<Civilizations> and <Row>: These define the tables, and tags like these are used in a lot of places in Civilization: Beyond Earth XMLs, more specifically the <Row> tag.
<Type>: This is how your sponsor will be referenced in your XML files.
<Description>: This is what your nation will be called in-game. Dont enter your text directly, well add the text properly soon, for now, just choose a fitting name for the text entry.
<ShortDescription>: This is the shortened version of the description tag. For instance, USA as opposed to United States of America
<Adjective>: The adjective applied to units owned by this sponsor.
<CivilopediaTag>: Related to the civilopedia, Im honestly not quite sure what this one does, as Ive yet to mess with Civilopedia entries.
<DefaultPlayerColor>: The colors used by this sponsor. Dont worry, Ill cover how to make a custom color set later.
<ArtDefineTag>: Something to do with art used for GUI, etc. Not quite sure exactly what it does.
<ArtStyleType>: Something to do with art used for GUI, etc. Not quite sure exactly what it does.
<PortraitIndex>: Related to the icon used. In cases where youre not using the default icons, this will be set to 0 about 99% of the time.
<IconAtlas>: The image to use for the sponsor icon. Right now, the default image is being used, ARCs part to be exact.
<AlphaIconAtlas>: As far as I know, this is the version of the icon that gets recolored in certain parts of the GUI.
<GradientIconAtlas>: EDIT: As far as I know, this goes unused.
<GlowIconAtlas>: EDIT: As far as I know, this goes unused.
<MapImage />: Im assuming that this is a leftover from Civ 5
<ArtStyleSuffix> and <ArtStylePrefix>: Not quite sure to be honest.
<IntroductionQuote>: The quote that appears on the loading screen.
<IntroductionImage>: EDIT: This actually does affect the image that shows on the loading screen. I played as Brasilia and the image was radically different.
<IntroductionAudio>: Im pretty sure this is the audio that plays during the intro. Ive seen mods that use it, but if I recall, all of the stock sponsors are completely silent here.
<Personality>: Not sure if this actually affects the personality of the sponsor in any way (as far as I know, its all set in a different place, but I could be wrong), so I set to the closest thing to a warmonger in the game just in case
Now we need to add the default names for cities:
Code:
<Civilization_CityNames>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<CityName>TXT_KEY_CITY_NAME_SHANG_MU_1</CityName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<CityName>TXT_KEY_CITY_NAME_SHANG_MU_2</CityName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<CityName>TXT_KEY_CITY_NAME_SHANG_MU_3</CityName>
</Row>
</Civilization_CityNames>
You can add as many city names as you want, but the official sponsors all have either ninteen or twenty. I would personally define at least twenty entries.
Now we need to define the buildings that our sponsor starts with. I know what youre thinking, my sponsor doesnt start with a free building, why would I need to set it to start it off with one? Unless your sponsor IS going to start with one that is, in which case you stayed silent. For the majority who fit into group one, thats technically incorrect, every sponsor starts out with a headquarters building, so we need to define that for our sponsor like so:
Code:
<Civilization_FreeBuildingClasses>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<BuildingClassType>BUILDINGCLASS_HEADQUARTERS</BuildingClassType>
</Row>
</Civilization_FreeBuildingClasses>
Likewise, each sponsor starts with the habitation tech, which is in the center of the tech web:
Code:
<Civilization_FreeTechs>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<TechType>TECH_HABITATION</TechType>
</Row>
</Civilization_FreeTechs>
Now we need to tell the game which leader to use for our sponsor. Well create Mayor Zao in a later step, for now, to the disappointment of nearly everyone who actually knows who the heck Ive been making, well simply use ARCs leader.
Code:
<Civilization_Leaders>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<LeaderheadType>LEADER_ARC</LeaderheadType>
</Row>
</Civilization_Leaders>
Code:
<Civilization_SpyNames>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_0</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_1</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_2</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_3</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_4</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_5</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_6</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_7</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_8</SpyName>
</Row>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<SpyName>TXT_KEY_SPY_NAME_SHANG_MU_9</SpyName>
</Row>
</Civilization_SpyNames>
Finally, we need to let the game know that our sponsor cant spawn alien drones (yes, the regular sponsors do it to, Im surprised theres actually an alien unit without a human equivalent )
Code:
<Civilization_UnitClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_SHANG_MU</CivilizationType>
<UnitClassType>UNITCLASS_ALIEN_FLYER</UnitClassType>
<UnitType/>
</Row>
</Civilization_UnitClassOverrides>
now I know what youre thinking, and no. All this is still not enough to get your sponsor to show up in the game. Theres still a bit more we need to do to even get it to appear, much less act unique. Now we need to add that text I mentioned earlier. Create another XML file (well, you dont have to, but it helps to keep things organized ), and name it whatever you like. Im going to go with CivBETextEntries_ShangMu.xml (not sure where this stuff is in the vanilla files, I actually havent looked before).
Now, the code for the text XML:
Code:
<LocalizedText>
<Row Language="en_US" Tag="TXT_KEY_CIV_SHANG_MU_DESC">
<Text>Shang Mu</Text>
</Row>
<Row Language="en_US" Tag="TXT_KEY_CIV_SHANG_MU_SHORT_DESC">
<Text>Shang Mu</Text>
</Row>
<Row Language="en_US" Tag="TXT_KEY_CIV_SHANG_MU_ADJECTIVE">
<Text>Shang Mu</Text>
</Row>
<Row Language="en_US" Tag="TXT_KEY_CIV_SHANG_MU">
<Text>Shang Mu</Text>
</Row>
<Row Language="en_US" Tag="TXT_KEY_CIV_INTRO_SHANG_MU_TEXT_0">
<Text><< Placeholder Text >>[NEWLINE][NEWLINE]</Text>
</Row>
</LocalizedText>
The Language attribute defines what language the text is in, and the main reason why you cant just type in text willy-nilly wherever you like (that and the fact that itll give you an error if you try). Civilization: Beyond Earth will replace this with some text with the same Tag but a different Language for that specific languages region if we define it as well. An example:
Code:
<Row Language=en_US Tag=TXT_THE_ONLY_SPANISH_I_KNOW>
<Text>I dont speak Spanish, I speak English</Text>
</Row>
<Row Language=es_ES Tag=TXT_THE_ONLY_SPANISH_I_KNOW>
<Text> No habla espanol, habla engles.</Text>
</Row>
If I put this text into the game, people could choose to be alerted to the fact that I speak English and not Spanish in either English or Spanish (though the Spanish is likely horribly misspelled...), get it? Good. Now the text in the Tag attribute should look familiar (with the exception of TXT_KEY_CIV_INTRO_SHANG_MU_TEXT_0, but Ill get to that), and thats because it is. That text is what we referenced in the first XML. Now the last tag is special, remember the % symbol in one of the tags in the first XML, well in Beyond Earth, the % symbol can be used to replace any number. That means during the loading screen, the game will look forTXT_KEY_CIV_INTRO_SHANG_MU_TEXT_0, then TXT_KEY_CIV_INTRO_SHANG_MU_TEXT_1, and so on. This is how you get different text to appear for the same event, like how the sponsors have more than one greeting. You should be able to use this knowledge to fill in the other text entries, but Im going to do that later, as we have enough for our faction to show up on the sponsor select screen. Now, if all went well, we SHOULD be able to see our faction almost. Before we leave ModBuddy, we want to save and compile our work. Click the icon with two floppy disks to save all of the open files, then click on the Build tab at the top and select Build Solution. Now our mod should appear when we open the mod section in Beyond Earth, so lets go check!
https://dl.dropboxusercontent.com/u/29071079/Civ%20Modding/Beyond%20Earth/Custom%20Sponsor%20Tutorial/001.png
Well, the mod shows up in the mods section, but when I went to set up the game (not shown), Shang Mu didnt appear. Sorry, I forgot the most important part (and also sorry for all the mods I have installed, but lets face it, the stock sponsors are all really, REALLY boring, and this is coming from someone who actually likes the game. Hence why I have 64 hours of playtime so far on Civ:BE and only about half the achievements. Because I have to play with the boring stock sponsors ). Go back to the Mod Buddy window and right click on the top of our project, click properties, and the Mod Properties window should appear. Click on actions, then click add. Now, select OnModActivated for the event, UpdateDatabase for the action, and select one of your XMLs for the file. Repeat for the other XML. NOW save and compile, and see the mod appear.
https://dl.dropboxusercontent.com/u/29071079/Civ%20Modding/Beyond%20Earth/Custom%20Sponsor%20Tutorial/002.png
LOOK! THERE IT IS! RIGHT BELOW ARC! with ARCs ability. Thats because we set ARCs leader as our sponsors leader, thats where the abilities are tied to. Well, Im going to get working on the next part of the tutorial, where Ill cover making custom icons, in the meantime, why not fill in those extra text entries? Hope this helped someone get started!