In the Firaxis livestreams about modding Pete Murray first created a new building and then a new wonder. Well, what about units? Fear not, for here's what you need to do to add some simple units into the game! It is, however, strongly recommended that you first watch at least the first livestream to get an overview of the tools.
But, let's begin. If you did not watch the first livestream or have not installed the Beyond Earth Software Development Kit (SDK) yet, do that now. Go to your Steam client, then click Library to open the menu and select Tools. Find the Sid Meier's Civilization: Beyond Earth SDK entry, right click it and install it.
After the installation has finished, run it and select "ModBuddy". If it asks you to install some Visual Studio stuff, you must first download and install that one too.
Creating the mod
When you open ModBuddy it looks something like this:
Initializing a new project
Choose File > New > Project. Give your mod a name. The unit that I'm creating is called Cardboard Destroyer. It's a decoy unit that looks like a LEV Destroyer but is cheap and very weak, i.e. supposedly made out of cardboard. I thought it'd be fun to play with "LEV Destroyers" right from the beginning, though, because normally you'd only get to play with them in Purity late game. :)
So, give your mod a name and click "OK". I named it Cardboard_Destroyer. A rather blank screen appears. You should see a "Solution Explorer" window. If you don't, enable it from the View menu. Right click on the mod name in the Solution Explorer and select Add > New Item... and then "Game Rules (XML)". Name it, say, cardboarddestroyer.xml and hit "Add".
Getting into the business
A new tab opens up, with some minimal XML markup. This is for adding or updating the rows in the database that basically runs the game. In the Firaxis streams Pete Murray added some Building and Wonder data here, I'm going to add Unit data.
The important thing to know is, which database tables contribute to the entity that you are creating. In my case the tables are called "Units" and "UnitClasses". The existing unit definitions can be found from the Beyond Earth installation directory, in the assets\Gameplay\XML\Units\CivBEUnits.xml and assets\Gameplay\XML\Units\CivBEUnitClasses.xml files. I just copied some <Row>s from them and pasted them into the ModBuddy cardboarddestroyer.xml tab. I then edited some values, like the Combat value (the unit's Strength, Cost and text keys. Finally, I added some plain English description texts for my new unit, ending up with a result like this:
<?xml version="1.0" encoding="utf-8"?>
<Row Language="en_US" Tag="TXT_KEY_UNIT_CARDBOARD_DESC">
<Row Language="en_US" Tag="TXT_KEY_UNIT_CARDBOARD_PEDIA">
<Text>A decoy unit with limited fighting capabilities. Looks like a LEV Destroyer but is extremely weak and does not hover over the terrain.</Text>
<Row Language="en_US" Tag="TXT_KEY_UNIT_CARDBOARD_HELP">
<Text>Weak decoy unit that looks like a LEV Destroyer.</Text>
Now, we're close to having a playable mod at our hands, but we must do a couple of more things. Right click on the mod in the Solution Explorer again and choose Properties. Go to the Actions tab, click Add, select Event "OnModActivated", Action "UpdateDatabase" and File "cardboarddestroyer.xml". This tells the game that it should use your newly created XML file to update the database when the mod is loaded.
Next, click on the Build menu at the top menu bar and select Build Solution! This "builds" your mod, i.e. packages it as ready to play. If all goes well, you should see a text like this in the Output window:
------ Build started: Project: Cardboard_Destroyer, Configuration: Default x86 ------
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
However, in my case it didn't all go that well: I got an error that said "CivBEPath must be defined. Use the Project Properties window to set it to the location where Civlization Beyond Earth is installed.". Fortunately that was easily remedied: go to Tools > Options... > Civilization Beyond Earth and fill in your Beyond Earth installation and user data paths. For me, the settings look like this:
After I confirmed those settings and tried to build again, it succeeded!
Trying it out
Fire up the game. In the main menu select Mods and after a dialog screen a screen for selecting mods should appear, looking something like this:
Exciting! Check the checkbox next to the Cardboard Destroyer mod like in the picture and hit "Next":
Then proceed to setting up a game like you normally would. Once the game launches and you make a planetfall, you should see your new unit at the top left corner right away, because we made it available right from the beginning by setting TECH_HABITATION as its prerequirement technology:
It works, awesome! Now let's build one:
Wait for a few turns and voilá! You have your very own LEV Des.. I mean, Cardboard Destroyer! You can even try fighting some aliens with it:
So, there you have it: a very basic mod that adds one simple unit! Be bold and experiment with other data and values and please report back with your results. :)
1. Can you modify current 3d models of the existing units ?
2. If that's not an option, can you at least recolor the existing units, for example creating green tanks based on the yellow-red LEV Tank ?
3. Can you rescale existing units so that instead of 1 you'll have 2 smaller units, like two smaller LEV Destroyers ?
1. As far as I'm aware, yeah, but this is quite in-depth? Existing tutorials for Civilisation 5 will work here, but I haven't tried it myself.
2. Yes, absolutely. Again, the process is very similar to Civilisation 5. I've done this, you'll need various community-made tools and a bit of patience. http://forums.civfanatics.com/showthread.php?t=392773 - this is a useful link to get you started. The version of Nexus that is compatibly with Beyond Earth should also work with very little config, better than the Civ 5 tutorials describe anyhow.
Two things to bear in mind. One, some texture files won't open properly in anything but Photoshop (apparently). A really hacky workaround I developed is here - http://forums.civfanatics.com/showpost.php?p=13586125&postcount=9. Two, Nexus / Granny (the model editor) / the game doesn't like you editing the same damn model each time. If you change the texture (or model, I dunno), make sure to export it as a new name every time. This'll mean using that new name in the code you'll have to update as well.
3. As far as I know, yes. Look for mods on the workshop that do this - I haven't been able to get changes to the squad formation code to work ingame yet. The relevant code should all be in the art data files.
also i am trying to make a LEV tank so what would be in place of the "Domain_Land" and how would i chang ethe attack range?
I haven't tried this, but I believe you need to add two new tags: "<Range>2</Range>" and "<RangedCombat>12</RangedCombat>" where the first tells the range and the second tells the ranged combat strength.
If you want to make the vehicle hover, replace the "DOMAIN_LAND" with "DOMAIN_HOVER".