[Add-on] Hungary, Balkan events

wte80

Chieftain
Joined
May 28, 2013
Messages
35
Location
Alabama
Well, I've been messing around some and finally got around to making... well, this.

Features:
  • Adds Hungary as a playable civ, led by Miklos Horthy. Unique units include their Infantry unit, the 38M Toldi I and 41M Toldi II light tanks, the 40M Turan I and 41M Turan II tanks, the 43M Zrinyi II assault gun, the Reggiane Re.2000 fighter, and the Caproni Ca.135 medium bomber.
  • Adds the 41M Toldi II as and upgrade (by project) for the Toldi I.
  • Adds the 41M Turan II as an upgrade (by project) for the Turan I.
  • Adds the 43M Zrinyi II assault gun and accompanying design project.
  • Nerf TACAM R-2 from tank destroyer to light tank destroyer, since it was built on a Panzer 35(t)/R-2 chassis. May need to compromise on a light tank destroyer's melee stat and a tank destroyer's ranged stat or something like that instead, but for now it is simply a light tank destroyer.
  • Expands the Romanian mobilisation OOB to be a good deal larger and include a couple R-2 (presently still called Panzer 35(t) ingame) units, and moves the spawn(s, now plural), since former location was in Transylvania.
  • Adds events for the cession of Bessarabia to the USSR, the Second Vienna Award (Northern Transylvania to Hungary), and the partition of Yugoslavia between Germany, Hungary, Italy, Bulgaria, Croatia (which is created on Yugoslavia's fall, of course), and Albania. The fall of Yugoslavia event will only fire if scripted events are enabled, though the others fire either way.
  • Changes calendar to four turns per month. I felt that one turn every ten days was simply not enough to get things done on accurate timescales. Day list is now 1, 8, 15, 22.
  • Messes with map down in the Balkans, adding the cities of Pecs and Podgorica, redoing/adding some roads/rails, and inserting urban areas for Kostice, Novi Sad, and Ljubljana.

Known non-features:
  • Hungary is using the Chinese flag and Miklos Horthy is using Chiang Kai-shek's art. This is not because I can't figure out how to mess with SQL/XML, but rather because I have (to my knowledge) no art for Hungary.
  • The fall of Yugoslavia DOES NOT incorporate Geodemon's shiny new way to fix the Fall of France crash, so it may cause crashes for those who had issues with the Fall of France in older versions. Sorry, but I've yet to wrap my head around all of what was done and how.
  • The Zrinyi I is not in game, and I do not intend to add it. It never entered service, and I don't care to burden Hungary with an unnecessary project.
  • Flavors for Miklos Horthy have not been replaced yet, so he's using the old values for... Askia??? I probably ought to fix that...
  • When Hungary joins in on Barbarossa and becomes allied with Hitler et al., the territory taken in the Second Vienna Award is (wrongly) handed back to Romania, including the plot containing Cluj but not the city itself. This is presumably the "liberate allied territory" functionality at work; I'll take a look and see what I can do.
  • None of the new stuff has non-English localization at all.

Installation:
Link to .zip in CivFanatics database: click here
Delete the main mod (or move your copy to some other location, if you want to be able to restore it without redownloading) from your mods folder, but not the data files. You will need v5 of the data files, see here for a download link if you do not already have them.

Feedback:
Leave any feedback, be it suggestions, criticisms, tips (anyone on fixing the territory going back to Romania?), bug reports, or really anything, below.

EDITED:Missed a non-feature: lack of localization
 
Looks awesome!!
Also, I don't mean to throw tasks at you, but I've been attempting to make a Norway civilization (cuz why not). But I am unable to Lua coding. Maybe eventually you could help me with this...
 
I'm happy to have modmods, I'll have a look :)

If I may have a suggestion for you and DEathgod65 it would be easier to release a full small mod with a different name/id and exclusion rules with the original, just keeping the dependency with the data file, this way you (and the users) could have both version installed at the same time (but select only one to play)

(merging back is also a possibility, but dependent of the scale of the changes, I've now realized that my framework is not ideal for modmods)

if you're not using modbuddy, it can be done just by editing the modinfo file, let me know if you're interested and need more info (again this is just a suggestion, I don't want to press on anything)
 
MacLazer: Well, as for making a civ: yes, that is within doable for me, and I could try to show how if you'd like sometime. (as an aside, be advised there's more than Lua to it, but the only really bad part if you just want to add a civ IMO is the SQL, and that isn't awful) However, unless I'm mistaken Norway doesn't have much in the data files (art, unit models/textures, etc.) right now, and I'm not much into the art-making business when I can avoid it... I'll see what if anything there is in the data files/other sources.

Geodemon: I'd be more than glad to do that, especially since it's your mod I'm goofing around with modifying. I'm fairly sure I know how to make it happen. Thank you for the idea; the more I think about it the more I realize it beats the "remove and impersonate" way I was doing it. :) I suppose an update is in order anyhow, since I need to make some fixes and revisions and I suppose try to make leader art/a flag for Hungary somehow.
 
@Geodemon: is the mod id referenced in the .dll anywhere? I'm getting some interesting combinations of problems when I try doing this, and that's the only place I haven't really replaced it where applicable in yet.
 
Just the version number of the DLL which is set in the DB, what kind of problems ?
 
MacLazer: Well, as for making a civ: yes, that is within doable for me, and I could try to show how if you'd like sometime. (as an aside, be advised there's more than Lua to it, but the only really bad part if you just want to add a civ IMO is the SQL, and that isn't awful) However, unless I'm mistaken Norway doesn't have much in the data files (art, unit models/textures, etc.) right now, and I'm not much into the art-making business when I can avoid it... I'll see what if anything there is in the data files/other sources.

Geodemon: I'd be more than glad to do that, especially since it's your mod I'm goofing around with modifying. I'm fairly sure I know how to make it happen. Thank you for the idea; the more I think about it the more I realize it beats the "remove and impersonate" way I was doing it. :) I suppose an update is in order anyhow, since I need to make some fixes and revisions and I suppose try to make leader art/a flag for Hungary somehow.

Ah I've already made a loading screen and a makeshift diplomacy screen and I can get a sound file as well, those aren't hard. But thanks. I won't pressure you into helping me, though. Take your time, your work on Hungary is great
 
@Geodemon: Well, straight away on the first turn (turn 0, whatever) I see two: Poland set fire to Wilno (which to me indicates that the old/unmodified CS AI is probably at work) and I have a production malus from unhappiness (which would suggest that happiness wasn't disabled, although the GUI still does as it's been told and doesn't report on it up top). At that point I don't see anything else, but I didn't play farther because those are both kind of large no-nos. I'll see if I missed the mod ID anywhere in the code (it was in a surprising number of spots) and/or lost a quote mark or something goofy like that when replacing it. Also, just to check, what is the DLL version number?

@MacLazer: That's actually really useful stuff to have though. I'll try to prepare you a how to thing on adding a civ in between shouting angrily at this latest problem in every language I know. :lol: But seriously, I'd be more than glad to show you how you could add Norway; I'll start typing it up some tonight.
 
@MacLazer: That's actually really useful stuff to have though. I'll try to prepare you a how to thing on adding a civ in between shouting angrily at this latest problem in every language I know. :lol: But seriously, I'd be more than glad to show you how you could add Norway; I'll start typing it up some tonight.

Wow man, thanks!
 
@Geodemon: Well, straight away on the first turn (turn 0, whatever) I see two: Poland set fire to Wilno (which to me indicates that the old/unmodified CS AI is probably at work) and I have a production malus from unhappiness (which would suggest that happiness wasn't disabled, although the GUI still does as it's been told and doesn't report on it up top). At that point I don't see anything else, but I didn't play farther because those are both kind of large no-nos. I'll see if I missed the mod ID anywhere in the code (it was in a surprising number of spots) and/or lost a quote mark or something goofy like that when replacing it. Also, just to check, what is the DLL version number?

my bad, didn't think of all those checks in the Lua code.

the problem you have seems related to one of the sql files not loading

DLL version is 3, but not relevant since v.38 of the mod

Don't lose more time, I'll have a look this WE to check if what I'm proposing is doable without too much work.
 
This how-to guide was written for MacLazer seeking to add Norway, but the same is applicable for other civs once you replace Norway with the other civ's name.

Spoiler :
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
Code:
[NORWAY] = true,
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.
 
Don't lose more time, I'll have a look this WE to check if what I'm proposing is doable without too much work.

the simple way: don't mess with the ID, too much work, just change the folder name to fit your mod (for example "R.E.D. WWII Hungary addon (v 40)", change the modinfo name (for example "R.E.D. WWII Hungary addon (v 40).modinfo", and change the name tag in the modinfo file itself.
Code:
<Name>R.E.D. WWII Hungary addon</Name>
I think it's not important to use the exact same name for the folder, file and <Name> tag, it's just better for consistency, but of course all three must be different of the main mod's names.

And nice "how to" :goodjob:
 
the simple way: don't mess with the ID, too much work, just change the folder name to fit your mod (for example "R.E.D. WWII Hungary addon (v 40)", change the modinfo name (for example "R.E.D. WWII Hungary addon (v 40).modinfo", and change the name tag in the modinfo file itself.
Code:
<Name>R.E.D. WWII Hungary addon</Name>
I think it's not important to use the exact same name for the folder, file and <Name> tag, it's just better for consistency, but of course all three must be different of the main mod's names.

Started over, did that, and it works, so I'm mostly set to release an update with those changes and a couple other things sometime in the next 24 hours. I may have caused those issues somehow else, but at any rate I've got it back under control now. Thank you for the help! :D
 
wte, i really really appreciate all the help you have given me in making this! It's a shame i couldnt figure out how to add it myself, but with your help I am well on my way, it's just that there is a problem. In the SDK's scenario editor for the 1939 map, there is no selection for Norway in the dropdown menu to add a new civ..? What do?
 
wte, i really really appreciate all the help you have given me in making this! It's a shame i couldnt figure out how to add it myself, but with your help I am well on my way, it's just that there is a problem. In the SDK's scenario editor for the 1939 map, there is no selection for Norway in the dropdown menu to add a new civ..? What do?
You are doing that after editing the SQL and XML to add Norway, right? If so, let me check my directions again; if not, there's your issue. Note also that you will need to have the version of the mod you've messed with enabled to do that, of course. But yeah, I'll reread what I wrote and see if I missed a step.

ALSO, new version of this is finally quasi-ready. Adds some art for Hungary/Romania, fixes Transylvania being given back in 41, and allows this and the main mod to both be installed (but don't enable both at once!). Also fixes (I'm fairly certain) the fall of Poland/Denmark error. However, data files will need to be replaced (for the added icons/art), though they should maintain compatibility with the base mod.
Data files: https://www.dropbox.com/sh/nxkmk2us0ty1t8i/AAB_YK4pcBgiFqh3e19ebGi7a?dl=0
Mod proper:
https://www.dropbox.com/sh/qtzi3b7tffecp6j/AADTUmM0xJe-qkm5W19TSlCna?dl=0
 
Yeah, I edited it after editing the SQL and XML , and I used the map from my modded red wwii edition folder. It was the correct map, and I triple checked for typos in the SQL and XML, as well as the lua files for the scenario... yet Norway is still not available for me to put down. Its strange. I'll look into it later.

Is it possible you missed something? I could send the folder that i keep my scenario in even though it is only compatible for red wwii v39
 
ok so i found out how to put down the civ in the scenario editor, except it said TXT_KEY_IROQUOIS instead of Norway... i put them down anyways. After this, i unsubbed from the mod in the workshop to put it and test my own version... but when i started it up i had a black screen and an error message said it can't load font data... i guess i just went about this all the wrong way and it appears this project is beyond my capabilities... :(
 
Is this add-on still supported? I have been looking for a mod of this sort for a while; however, I can't seem to manage to get it installed properly. I get an issue pertaining to Portugese Fighter files when I attempt to extract the data files to the add-on file; how do I get around this? Better yet, can anyone give me a run-down on how to install this and other similar modmods? I'm fairly new to this. :blush: Thanks!
 
Top Bottom