First things first, you will need the Civilization V SDK. If you don't already have it, open Steam, open the little Library dropdown menu, hit Tools, find the Civ V SDK on the list (I believe it's under S for Sid Meier's), and install it.
Next, you'll need to find the folder where your mods are kept. It should probably be something like C:\Users\Walker\Documents\My Games\Sid Meier's Civilization 5\MODS or similar, but it's fine if it isn't. In that folder, you will (presuming you have them installed, naturally) see folders for the R.E.D. WWII mods. Select the folders (both the main mod and the data files, since you'll be adding art &c. to the game), hit copy (not cut), and then paste them to some other location. The copies over in that location will serve as backup in case of errors caused by my directions.
That's all the preliminary stuff out of the way.
Now, to add the art you've created. It needs to be saved as a .dds file, which frankly I don't know jack about. Open up the folder for the data files. It should contain three folders (Art, Audio, and Units) and a .modinfo file. Open up the art folder. It contains several folders, but we're only interested in Scenes and LoadingScreens for now. Add your diplo scene to the Scenes folder. I strongly recommend using scene_norway.dds as the filename, particularly if you mean to eventually publish this. This will make it consistent with the other filenames used, and consistency (a) makes remembering it easier (well, at least if you/whoever is working with multiple civs) and (b) makes it easier to spot typographical mistakes in the code, which can be a cause of headaches if you aren't careful. Add your loading screen to the LoadingScreens folder. I recommend dom_norway.dds as the filename. While you're in the art folder, you can take a gander at the icons folder. The files in it are various collections of icons (leaders (like the icons for the civ select screen/Civilopedia/so on), flags, promotions, unit icons, and a couple other things). If you want to get the Norwegian flag into the game, you would want to edit the ones with names starting with WW2FlagsAtlas. They reason for the multiple files with the different numbers in their names is because each contains differently-sized icons. The same idea goes for a leader portrait (Haakon VII, I presume?). If you had made new unit models/textures/whatever other devilry, they would go in the R.E.D. WWII Data Files (v 5)\Units\Other Europe (for Norway) folder, but making a unit model from scratch is as I understand it not a small task. Thankfully, there are some generics that we can use for this example.
Anyhow, now on to the coding. Open up the file 0- ReplaceCivilizations.sql in the SQL folder located within the main mod folder (i.e. not the data files). You can either use an ordinary old text editor (Notepad comes with Windows and works just fine, Word is actually not recommended for this, umm... I'm told Notepad++ is nice for coding purposes, though I can't speak for it myself, but at any rate any text editor works) or you can fire up the SDK, choose ModBuddy on the menu, and instead of creating a project or whatever it calls them, just hit File -> Open -> File and open this SQL file we're working with. Up top, you'll see this:
Code:
-- Insert SQL Rules Here
DROP TABLE IF EXISTS 'Civilizations';
CREATE TABLE Civilizations ('ID' integer primary key autoincrement , 'Type' text not null unique , 'Description' text , 'Civilopedia' text default NULL , 'CivilopediaTag' text , 'Strategy' text , 'Playable' boolean default 1 , 'AIPlayable' boolean default 1 , 'ShortDescription' text default NULL , 'Adjective' text default NULL , 'DefaultPlayerColor' text default NULL , 'ArtDefineTag' text default NULL , 'ArtStyleType' text default NULL , 'ArtStyleSuffix' text default NULL , 'ArtStylePrefix' text default NULL , 'DerivativeCiv' text default NULL , 'PortraitIndex' integer default '-1' , 'IconAtlas' text default NULL , 'AlphaIconAtlas' text default NULL , 'MapImage' text default NULL , 'DawnOfManQuote' text default NULL , 'DawnOfManImage' text default NULL , 'DawnOfManAudio' text default NULL , 'PackageID' text default NULL , 'SoundtrackTag' text default NULL , foreign key (Description) references Language_en_US(Tag), foreign key (Strategy) references Language_en_US(Tag), foreign key (ShortDescription) references Language_en_US(Tag), foreign key (Adjective) references Language_en_US(Tag), foreign key (IconAtlas) references IconTextureAtlases(Atlas), foreign key (AlphaIconAtlas) references IconTextureAtlases(Atlas));
The long and short of all of this is that we're replacing the existing table of civs and their information. Notice how the first line has two dashes at its beginning. This means that it is a comment and is not executed as part of the code. The same applies in Lua as well, although the XML uses a slightly different notation for comments. Now, below all this are lines that look like this:
Code:
INSERT INTO Civilizations VALUES(0,'CIVILIZATION_AMERICA', 'TXT_KEY_CIV_AMERICA_DESC', NULL,'TXT_KEY_CIV5_UNITEDSTATES', NULL,1,1,'TXT_KEY_CIV_AMERICA_SHORT_DESC', 'TXT_KEY_CIV_AMERICA_ADJECTIVE', 'PLAYERCOLOR_AMERICA', 'ART_DEF_CIVILIZATION_AMERICA', 'ARTSTYLE_EUROPEAN', '_EURO', 'EUROPEAN', NULL,3, 'WW2_FLAGS', 'WW2_FLAGS', 'MapAmerica512.dds', 'TXT_KEY_CIV5_DAWN_UNITEDSTATES_TEXT', 'DOM_Washington.dds', 'AS2D_DOM_SPEECH_UNITED_STATES',NULL,NULL);
and some that look like this:
Code:
--INSERT INTO 'Civilizations' VALUES(10,'CIVILIZATION_IROQUOIS', 'TXT_KEY_CIV_IROQUOIS_DESC', NULL,'TXT_KEY_CIV5_IROQUOIS', NULL,1,1,'TXT_KEY_CIV_IROQUOIS_SHORT_DESC', 'TXT_KEY_CIV_IROQUOIS_ADJECTIVE', 'PLAYERCOLOR_IROQUOIS', 'ART_DEF_CIVILIZATION_IROQUOIS', 'ARTSTYLE_SOUTH_AMERICA', '_AMER', 'AMERICAN', NULL,12,'CIV_COLOR_ATLAS', 'CIV_ALPHA_ATLAS', 'MapIroquoi512.dds', 'TXT_KEY_CIV5_DAWN_IROQUOIS_TEXT', 'DOM_Hiawatha.dds', 'AS2D_DOM_SPEECH_IROQUOIS', NULL,NULL);
Notice those two dashes again? This line has been "commented out," i.e. it isn't being executed right now. We need to add another civ, though, so remove them from one of the lines. I'm going to use the Iroquois one for this example. You should also change the value immediately after VALUES( so that it is one more than any of the civs not commented out, though this example has that done already, which is why I'm using it. Change CIV_COLOR_ATLAS and CIV_ALPHA_ATLAS to WW2_FLAGS and WW2_FLAGS, leaving the single quotation marks and commas in place. If you later add a Norwegian flag, change the 12 right before that to the number corresponding to that flag's position in the icon file, otherwise, 32 should give you a blank. You'll wind up with this after all that:
Code:
INSERT INTO 'Civilizations' VALUES(10,'CIVILIZATION_IROQUOIS', 'TXT_KEY_CIV_IROQUOIS_DESC', NULL,'TXT_KEY_CIV5_IROQUOIS', NULL,1,1,'TXT_KEY_CIV_IROQUOIS_SHORT_DESC', 'TXT_KEY_CIV_IROQUOIS_ADJECTIVE', 'PLAYERCOLOR_IROQUOIS', 'ART_DEF_CIVILIZATION_IROQUOIS', 'ARTSTYLE_SOUTH_AMERICA', '_AMER', 'AMERICAN', NULL,32,'WW2_FLAGS', 'WW2_FLAGS', 'MapIroquoi512.dds', 'TXT_KEY_CIV5_DAWN_IROQUOIS_TEXT', 'DOM_Hiawatha.dds', 'AS2D_DOM_SPEECH_IROQUOIS', NULL,NULL);
Save and close that file. No other values need to be modified there; rather, we're going to change them in the XML.
Now go to the folder labeled XML and open NewCivilizations.xml up. Again, you can use ModBuddy or any text editor. Up top, you'll see a bunch of rows like this:
Code:
<Delete Type="CIVILIZATION_IROQUOIS"/>
Remove the one for the civ you just chose, in this example the Iroquois, so they pull up a chair and stay. Next up you'll see blocks of text like this:
Code:
<Update>
<Where Type="CIVILIZATION_AMERICA"/>
<Set>
<Description>TXT_KEY_RED_WWII_AMERICA</Description>
<ShortDescription>TXT_KEY_RED_WWII_AMERICA_SHORT</ShortDescription>
<CivilopediaTag>TXT_KEY_WW2_SCENARIO_CIV_AMERICA</CivilopediaTag>
<DawnOfManQuote>TXT_KEY_RED_EURO1940_AMERICA_BRIEFING</DawnOfManQuote>
<DawnOfManImage>dom_america.dds</DawnOfManImage>
<MapImage>mapUSA.dds</MapImage>
<PortraitIndex>3</PortraitIndex>
<IconAtlas>WW2_FLAGS</IconAtlas>
<AlphaIconAtlas>WW2_FLAGS</AlphaIconAtlas>
</Set>
</Update>
Add this one:
Code:
<Update>
<Where Type="CIVILIZATION_IROQUOIS"/>
<Set>
<Description>TXT_KEY_RED_WWII_NORWAY</Description>
<ShortDescription>TXT_KEY_RED_WWII_NORWAY_SHORT</ShortDescription>
<CivilopediaTag>TXT_KEY_WW2_SCENARIO_CIV_NORWAY</CivilopediaTag>
<DawnOfManQuote>TXT_KEY_RED_EURO1940_NORWAY_BRIEFING</DawnOfManQuote>
<DawnOfManImage>dom_norway.dds</DawnOfManImage>
<MapImage>Earth1936startscreen.dds</MapImage>
<PortraitIndex>32</PortraitIndex>
<IconAtlas>WW2_FLAGS</IconAtlas>
<AlphaIconAtlas>WW2_FLAGS</AlphaIconAtlas>
</Set>
</Update>
Change the 32 as needed to another value if you added a flag. Also, you could just type out your intended long country name, short country name, Civilopedia description, and loading screen text here instead of typing those TXT_KEY things, but you would lose the ability to have localization into other languages if you did. You'll now see these:
Code:
<Row>
<CivilizationType>CIVILIZATION_ENGLAND</CivilizationType>
<TechType>TECH_SATELLITES</TechType>
</Row>
Add another one with CIVILIZATION_IROQUOIS in between the CivilizationType tags. After that are rows that read like this:
Code:
<Delete CivilizationType="CIVILIZATION_IROQUOIS"/>
Remove the Iroquois one. You'll next see bits like this:
Code:
<Update>
<Where Type="LEADER_ALEXANDER"/>
<Set>
<Description>TXT_KEY_LEADER_METAXAS</Description>
<CivilopediaTag>TXT_KEY_CIVILOPEDIA_LEADERS_METAXAS</CivilopediaTag>
<ArtDefineTag>DiploGreece.xml</ArtDefineTag>
<PortraitIndex>17</PortraitIndex>
<IconAtlas>WW2_FLAGS</IconAtlas>
</Set>
</Update>
Add one like this:
Code:
<Update>
<Where Type="LEADER_HIAWATHA"/>
<Set>
<Description>TXT_KEY_LEADER_HAAKON_VII</Description>
<CivilopediaTag>TXT_KEY_CIVILOPEDIA_LEADERS_HAAKON_VII</CivilopediaTag>
<ArtDefineTag>DiploNorway.xml</ArtDefineTag>
<PortraitIndex>32</PortraitIndex>
<IconAtlas>WW2_FLAGS</IconAtlas>
</Set>
</Update>
Same deal with the TXT_KEYS and the leader portait index as with for the the last time and the flags. You can skip the flavors for now, but go down to the blocks like this and this
Code:
<Update>
<Where LeaderType="LEADER_ELIZABETH"/>
<Set>
<TraitType>TRAIT_NEVER_SURRENDER</TraitType>
</Set>
</Update>
Code:
<Row>
<Type>TRAIT_RESISTANCE</Type>
<Description>TXT_KEY_TRAIT_RESISTANCE</Description>
<ShortDescription>TXT_KEY_TRAIT_RESISTANCE_DESC</ShortDescription>
</Row>
and add at least a placeholder like this:
Code:
<Update>
<Where LeaderType="LEADER_HIAWATHA"/>
<Set>
<TraitType>TRAIT_NORWAY</TraitType>
</Set>
</Update>
Code:
<Row>
<Type>TRAIT_NOWAY</Type>
<Description>Place held</Description>
<ShortDescription>Place held</ShortDescription>
</Row>
Adding a trait that does stuff is more complex, and the specifics depend on what you want it to do. You're done here. Save this file and close it.
Now open the file 6- Define New Units.sql in the SQL folder. Copy the line
Code:
SELECT 'SWEDEN_INFANTRY', NULL, '', 'Infantry', 'Infantry_Sweden_v2', 'INFANTRY', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL UNION ALL
and paste it right below, then change SWEDEN_INFANTRY in that copy to NORWAY_INFANTRY without removing the quotation marks/comma, and change Infantry_Sweden_v2 to Infantry_Generic, as it points to a unit model etc., and we don't have an infantry model specifically for Norway. Follow the same pattern for other unique units you wish to add, taking note of what all generic units exist over in the data files. For the others, you will also need to change the unit's display name, which is the column
before the file name (so in this case the one that reads Infantry). Once you've added such UUs as you want to, save and close that file. Open up the Lua folder and open RedDefinesGlobal.lua up. Scroll til you see
Code:
FRANCE = GameInfo.Civilizations.CIVILIZATION_FRANCE.ID
ENGLAND = GameInfo.Civilizations.CIVILIZATION_ENGLAND.ID
USSR = GameInfo.Civilizations.CIVILIZATION_RUSSIA.ID
GERMANY = GameInfo.Civilizations.CIVILIZATION_GERMANY.ID
ITALY = GameInfo.Civilizations.CIVILIZATION_ROME.ID
AMERICA = GameInfo.Civilizations.CIVILIZATION_AMERICA.ID
JAPAN = GameInfo.Civilizations.CIVILIZATION_JAPAN.ID
CHINA = GameInfo.Civilizations.CIVILIZATION_CHINA.ID
GREECE = GameInfo.Civilizations.CIVILIZATION_GREECE.ID
and add in
Code:
NORWAY = GameInfo.Civilizations.CIVILIZATION_IROQUOIS.ID
right below. Don't leave the .ID part out, and don't misspell civilization like someone named me may once have done. This defines the variable NORWAY as the ID (which is actually just a number) for your Norwegian civ. This allows us to reference it by that name later. Scroll down, and where you see
Code:
g_Allied = {
[FRANCE] = true,
[ENGLAND] = true,
[USSR] = true,
[AMERICA] = true,
[CHINA] = true,
[GREECE] = true,
}
add
on a new line after the line Greece is on but before the closing bracket/brace/whatever it's called. This table is listing out who all will eventually be on the same side. Where you see
Code:
g_Major_Buildings = {
[FRANCE] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, SHIPYARD, OIL_REFINERY}, -- LARGE_AIR_FACTORY, : no bombers or heavy bombers
[ENGLAND] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, OIL_REFINERY},
[USSR] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, OIL_REFINERY},
[GERMANY] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, SYNTHETIC_FUEL_PLANT, OIL_REFINERY},
[ITALY] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, OIL_REFINERY},
[GREECE] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, SHIPYARD, OIL_REFINERY}, -- LARGE_AIR_FACTORY, : no bombers or heavy bombers
[JAPAN] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, OIL_REFINERY},
[AMERICA] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, OIL_REFINERY},
[CHINA] = {FACTORY, ARSENAL, HARBOR, RADIO, BARRACKS, ACADEMY, BASE, HOSPITAL, BANK, COURTHOUSE, BARRICADE, LAND_FACTORY, SMALL_AIR_FACTORY, MEDIUM_AIR_FACTORY, LARGE_AIR_FACTORY, SHIPYARD, OIL_REFINERY},
add a new line for Norway. Just copy China's unless you want to disable the air factories for Norway, which okay maybe. You are now done with this file, so save and close. Now open RedDefinesUnits.lua up. The beginning defines variables to represent units. Add the Norwegian units you added in the SQL to the appropriate location for their kind, using the format that the other units use, i.e.
Code:
NO_INFANTRY = GameInfo.Units.UNIT_NORWAY_INFANTRY.ID
or
Code:
NO_SLEIPNER = GameInfo.Units.UNIT_DESTROYER_SLEIPNER.ID
if you'd added the Sleipner class of destroyers. Scroll down to
Code:
g_Major_Units = {
[FRANCE] = {
FR_INFANTRY, FR_LEGION, FR_PARATROOPER, FR_MECH_INFANTRY, FR_SPECIAL_FORCES,
FR_W15_TCC, FR_AMR35_ZT3, FR_37L,
FR_R35, FR_R40, FR_H35, FR_H39,
FR_S35,
FR_B1, FR_ARL44, FR_CHAR_2C,
FR_SAU40,
FR_MS406, FR_D520, FR_D790,
FR_MB152,
FR_POTEZ630,
FR_LN401, FR_AMIOT350, FR_BR690, FR_BR810,
FR_FANTASQUE, FR_GALISSONIERE, FR_SUBMARINE, FR_BATTLESHIP, FR_BATTLESHIP_2,
ARTILLERY, AA_GUN, AT_GUN, FR_MOBILE_AA_GUN,
FR_CARRIER},
etc. etc. and add an entry for Norway. It should include any Unique units you've added as well as some basics, like the guns labeled ARTILLERY, AA_GUN, AT_GUN (these are the howitzer, the field gun, and the anti-aircraft gun, by the way). So for example yours might look something like this:
Code:
[NORWAY] = {
NO_INFANTRY,
NO_SLEIPNER, CRUISER, SUBMARINE,
ARTILLERY, AA_GUN, AT_GUN},
You could also if you chose include units from other civs that represent imported planes/what have you. You shouldn't need to do anything else to this file unless you add special forces or capital ships or other stuff not presumably applicable here.
Now it gets scenario specific. In the scripts files (i.e. ScriptEuro1940.lua in the Lua\Europe1940 folder for Europe 1939), change all instances of GetPlayerIDFromCivID (NORWAY, true, true) or GetPlayerIDFromCivID (NORWAY, true) to GetPlayerIDFromCivID (NORWAY, false) because Norway is no longer a city state. In the scenario defines files (i.e. DefinesEuro1940.lua in the same place), a good deal will need to be changed. The line NORWAY = GameInfo.MinorCivilizations.MINOR_CIV_NORWAY.ID near the top must be removed. Add Norway to this (or its equivalent for that scenario):
Code:
g_Units_Maintenance_Modifier = {
[FRANCE] = 0,
[ENGLAND] = 10,
[USSR] = 0,
[GERMANY] = 0,
[ITALY] = 7,
[GREECE] = 5,
}
Add desired starting forces here, in groups not larger than seven that will spawn on the specified square or adjacent, and getting the coordinates from WorldBuilder (another SDK tool):
Code:
g_Initial_OOB = {
{Name = "French north army", X = 33, Y = 44, Domain = "Land", CivID = FRANCE, Group = {FR_INFANTRY, FR_INFANTRY, FR_AMR35, FR_B1, FR_S35} },
bla bla bla units
Add Norway also to these two tables, same format as the other civs in them:
Code:
-- Victory types
g_Victory = {
[FRANCE] = "VICTORY_ALLIED_EUROPE",
[ENGLAND] = "VICTORY_ALLIED_EUROPE",
[USSR] = "VICTORY_USSR_EUROPE",
[GERMANY] = "VICTORY_GERMANY_EUROPE",
[ITALY] = "VICTORY_AXIS_EUROPE",
}
-- Virtual allies
g_Allied = {
[FRANCE] = true,
[ENGLAND] = true,
[USSR] = true,
[GREECE] = true,
}
And then the diplomancy... remove them from the g_Minor_Relation table, add declarations of war (Type = DOW) and alliances (Type = PEA) (just an alliance with Britain once Germany declares war is enough to cover it) to the g_Major_Diplomacy table on the historic date (don't bother with Italy declaring war on Norway; if Germany is at war with Norway once they become allies it'll happen anyhow). That would read like this in the g_Major_Diplomacy table:
Code:
[19400409] = {
{Type = DOW, Civ1 = GERMANY, Civ2 = NORWAY},
{Type = PEA, Civ1 = NORWAY, Minor = ENGLAND},
},
Then remove them from the g_Major_Minor_DoW table. If you want to add buildings to their cities, mess around in the cities list down at the bottom. They're already in it, and some of their cities even show how it's done. You're now done in that file; save and close. Now open up the appropriate .lua file in the GameSetup folder within the main R.E.D. WWII mod folder. You'll see something like this table up at the top:
Code:
ScenarioCivilizations = {
-- [0] = "CIVILIZATION_MONGOL", -- Fake civilization defined as player one in scenario tab of WB (with a starting plot in the middle of nowhere), and killed at start of any game. Used to fix a hotseat bug that make the player one of any scenario always human whatever the settings here
[1] = "CIVILIZATION_FRANCE",
[2] = "CIVILIZATION_GERMANY",
[3] = "CIVILIZATION_ENGLAND",
[4] = "CIVILIZATION_ROME",
[5] = "CIVILIZATION_RUSSIA",
[6] = "CIVILIZATION_GREECE",
}
Add
Code:
[7] = "CIVILIZATION_NORWAY",
or whatever is appropriate to make the number in brackets one more than the previous one.
You're done coding! Hit save and breathe a sigh of relief. Now all that's left is map editing. Open up WorldBuilder (part of the SDK), open the Scenario Editor, and add Norway to the list of players, change their colors to be right, set their era to industrial, and tick the boxes for them to be in contact with all teams, but don't remove the city-state version of Norway from the list of city-states just yet. Replace each of the CS Norway's cities with a city of the same population belonging to the civ Norway (the one that'll say Player [whatever number] in the dropdown menu fro whose city to create). Also edit Oslo's buildings, it needs to have a Palace. Now change all of the CS Norway's plots to belong to the civ Norway, then delete the CS Norway from the list of city-states. You are now ready to go and test your work, which should yield a playable Norwegian civilization.