R.E.D. World War II development thread

Ok, thanks, I'll look at it.
 
ALso, on the 1942 scenario, two more cities to correct:

Marseille(southern france)
Halifax(eastern Canada)

Correct spelling of Marsiele and Hailfax.
 
And thanks for the report too :D
 
One more:
In the 1942 scenario, the american cruiser is named *Balitmore*
It should be *Baltimore*

Ill post again if I find more!
 
How to : Mod in the scenario define files


I've tried to make the mod as customizable as possible to allow the inclusion of very different scenarios type, from strategic size to more tactical map.

There is a set of basic "default" rules, that are defined in the following files from the "\My Documents\My Games\Sid Meier's Civilization 5\MODS\R.E.D. WWII Edition (v xx)\Lua" folder :
  • RedDefinesGlobal.lua
  • RedDefinesRules.lua
  • RedDefinesUnits.lua
  • RedDefinesClasses.lua
  • RedDefinesProjects.lua

None of those files are made to be edited, they define some value for the core scripts, but you can refer to them to edit existing (or new) scenarios.

Because all the scenario files are loaded after the default files, they can override any value to something more fitting to the scenario.

Now let's talk of the content of the files:


RedDefinesGlobal.lua

Contains the general definition for global constant used by the script.

I won't detail it, but just point some value that are commonly used in the other parts of the scripts/define files:

The Major civilization IDs are set there, so you can refer to FRANCE for this civ ID instead of GameInfo.Civilizations.CIVILIZATION_FRANCE.ID

This refer to an existing civilization, as set in NewCivilizations.xml like any other civilization mod.

The minor are scenario dependent, and thus are the only values that does not have a default definition, because you may want to use a minor civ instead of a major civ. For example, Greece is a minor civilization in the America/Euro 1936 map, and the value from the default file

Code:
[B]GREECE [/B]= GameInfo.Civilizations.CIVILIZATION_GREECE.ID

is replaced by this one when the 1936 files are loaded:

Code:
[B]GREECE [/B]= GameInfo.MinorCivilizations.MINOR_CIV_GREECE.ID

The IDs used for buildings, promotions and new processes (War Bonds/"we need you") are also defined in this file.

there are some enumeration types, for better readability in the diplomatic function (DOF, DOW, etc...) or the combat function (MELEE, RANGED, INTERCEPT, etc...)


There are also some tables:

g_Allied, g_Axis: used in diplomacy functions, to determine who can declare war to who in alternate history mode

g_Calendar : the custom calendar. You can speed up or slow down the time scale by adding/removing values in dayList. 3 values (like { "1", "10", "20" } )will make a month last 3 turns, 10 values = 10 turns. A small for ... do ... end loop then fill the g_Calendar table with all entry that will be shown in game on the top panel. When editing your hown calendar for your scenario, first copy all the calendar block, and then just edit the dayList table.

g_Major_Buildings : the default list of buildings allowed for each major civs. Note that the index refer to the civ ID we've defined at the beginning of the script. Also note that the list is incomplete for some civilization, for example France don't have heavy bombers unit, so no need to allow them to build large air factory...

g_Buildings_Req, g_Buildings_Exclusion : used in the core script to manage which buildings are needed or are exclusive to each others.

g_Minor_Buildings : default list of buildings allowed to minor civilizations.


RedDefinesRules.lua


This files contains the default rules. Nearly all values in it are commented, so simply refer to it, and ask here if any question arise...


RedDefinesUnits.lua


Contains some other enums, the short names for each unit ID that have been added to the mod, and some tables used for the units functions in the core files:

g_Major_Units : default list of available units for each civs. Note that it's a reversed restriction list, any unit not listed will not be available in game, but any units defined here and that have not been defined to be one of the civilization unique unit won't be available in game too. For example, if you put GE_INFANTRY in the french list, it won't do anything, because the German infantry is defined to be the UU for Germany in the unit table in the game database.

g_UnitUpgrades : the upgrade path of each unit. It may handle shortcut and multiple upgrade, but I've not tested, and would suggest simple path only (like A -> B -> C preferred to A -> B / A-> C / B -> C)

g_Paradrop : List of units ID that can paradrop from a city.

g_NoSupplyPenalty : Maybe a bad naming here, it's the list of units that won't lose combat statistic when out of supply line (aka behind enemy lines), but they still won't get reinforcements.

g_UnitMaxNumber : Units (like capital ships) that can be build only once in the game, and the number that can be build. By default it's based on the historical name list, with a few "what if this civ had completed a third ship of this class". For example the line [GE_BATTLESHIP_2] = 2, means that the unit type GE_BATTLESHIP_2 (aka Bismarck Class) can only have 2 instance in game, and when one die it can't be rebuild.

g_UnitMaxInstance : allow a limitation of unit number by instance. A line [FR_B1] = 1, would mean the French could have only 1 char B1 in game at any time, but that it can be rebuild when killed.

g_Minor_Units : the list of allowed units for minor civs.


RedDefinesClasses.lua

Short name for each class ID from the game database, and the table used for class management in game:

g_Unit_Classes :
  • Capture : define if the unit can capture enemy territory.
  • Moral : not used
  • NumType : this is used for unit naming, and a reference to the "main" default class of the unit.
  • MaterielRatio : % of materiel in the reinforcement calculation. Used in conjunction with REINFORCEMENT_BASE from the rules define.
  • MaxHP : Not Used
  • Buildings : Restriction list, the buildings listed here are mandatory to build the unit in a city.


RedDefinesProjects.lua

Last of the define files, it contains the enums IDs for the projects, and some default table:

g_Major_Projects : Default list of projects that can be build by each civilization.

g_ProjectsTable : define under which conditions a project is made available. See the in file comments for details.

g_UnitsProject : define if a project is needed by an unit before being made available.



The scenario files

Now you have a global vision of the defines values, you just need to know how to edit those. You may want to try to edit one of the file listed above, but I won't suggest it: the scenario may override the default values, and you will ask yourself (or me) why your change don't work.

So go and edit the scenario files instead :D

Those files are in a subfolder of the Lua folder, with more or less explicit name (like Europe1940 for the Europe 1939-1945 scenario)

Generally you'll have 3 files there : Red..., Script... and Defines...

As you've guessed, it's the Defines... file that you'll have to edit.

Let's take Defineseuro1940.Lua as an example.

First you'll note some value that are duplicate from the RedDefinesRules.lua file. remember, the scenario define file is loaded after the default file, and that's the value from the scenario file that will be used in game whan using the Europe 1939-1945 scenario.

Note that some of those values are in turn be overridden by the option chosen by the user on the setup screen, they are here for debug purpose when I choose to load a savegame with the value from the define file instead of the values selected by the user.

Then there is the calendar block, copied from the default file, but edited for the scenario time scale. Note how the start date is set by the line

Code:
local bStart = (month >= 7 and year == 1939)

Which means "this scenario calendar begins at the 7th month of the year 1939". the mod code only allows beginning at start of month, don't try to add a specific day in the start date line.

After that, the minor civs ID used in the scenario are defined. Of course the minor civs must first be added in the game database via the NewMinorCivs.xml, like any other mod...

And then you'll find this line :

Code:
g_Minor_Units = {}

You could look some paragraph up to refresh your memory, but let me do it: this table is used to stock the units that can be build by minor civilization. Here it's overriding the default table, with a new one that is empty. Yes, in this scenario the minor civilizations won't be able to build any units, only those available at start or mobilized when they enter war will be available to them.

Below are some optional tables, if not set the core engine won't use the corresponding features:

g_Reserve_Unit : contains a list of units that the AI can called when needed.
  • Prob : probability (in %) of the unit to be spawned in the AI capital when it calls it reserve. Note that there can be multiple unit listed, each with it's own probability. The probability test is done for each unit independently, at best the AI could get all units in one turn, but getting "100" on it's first unit probability check won't means it will be "100" for the other too.
  • ID : the unit type ID


g_Reserve_Data : contains the condition or an AI to call reseerve troops. See the comments in file for usage.

g_Combat_Type_Ratio : try to force the AI to respect ratio in it's army, again, see comments. Not sure if it works as intended, I've other issues to look at before this one, and it may be rewritten at some point with a strategic AI.

g_Max_Armor_SubClass_Percent : another attempt to restrict the AI's unit types, this time based on armor "main" class. (see RedDefinesClasses.lua)

g_Initial_OOB : that's the initial order of battle. While you can manually place the units on your map using the WB, this method is "safer", with the 256 units type limit, it will be easier for me to replace some unit types value in a text file than manually replace them on map when the limit will be fixed...
  • Name: name of the group of placed units, used for firetuner/lua.log debug printing only
  • X, Y : coordinate of the plot to place the group. A sea or land group can be composed of 7 units max (center plot + 6 around)
  • Domain : the domain type (Sea, Air, Land). Note: case sensitive "Sea", not "sea".
  • CivID: the owner of the units that will be spawned. Note that using this spawning method I can give any civ any unit (like Panther to USA or B-17 to Germany) independently of previous table and game database restriction.
  • Group : the units to be spawned on the plot
  • AI : (optional) if set to "true", the group wil lbe spawned for the AI player only.
  • IsMinor: (optional) if set to true, allows the code to understand this group must be placed for a minor civ. Failing to set this value when wanting to place a minor civ group will have strange result (as FRANCE and SPAIN could contain the same value, the distinction MUST be made)
  • UnitsName: (optional) Contains name for units (use the same order than the Group entry)
  • UnitsXP: (optional) give an amount of XP to the units from start (use same order than Group entry)
  • InitialObjective: (optional) give an objective via plot coordinate to the group. Not sure if working, and if it is, you should use the same objective for all groups)

See Stalingrad define file for an example.


g_Reinforcement_OOB : same as above, but allow spawning mid-game, using a date as index in the form yyyymmdd. (again see Stalingrad define file for an example)


g_MinorMobilization_OOB : same as g_Initial_OOB, but with a particularity, made to be use with the option CLOSE_MINOR_NEUTRAL_CIV_BORDERS set to true. The groups defined in that table will spawn only at the moment the neutral CS is entering war (from diplo script, or being DOWed in alternate history mode). Can only contain minor civs, and the flag IsMinor must still be defined.


g_Minor_UU : allow definition of Unique Units by class for minor civs.


g_ProjectsAvailableAtStart : define which projects a nation should have already completed at the start of the scenario.

g_MinorProtector : one of the diplomacy features. Here you can define virtual "protectors". When a civ declare war to a protected minor civilization, all the protectors will declare war to the aggressor.

g_Victory : allow custom victory screen to be shown, linked with the NewVictories.xml database update file.


The virtual allied and axis are set again in the file, it's redundant here, but have no consequence.


g_Major_Diplomacy : another diplo table. It contains custom diplomacy change based on the calendar.
  • [index]: date of the diplo change in the form yyyymmdd
  • Type : see RedDefinesGlobal.lua (DOF = declaration of friendship, DOW = declaration of war, etc...)
  • Civ1: the civilization declaring (war, denouncing, etc)
  • Civ2: the other civilization

g_Minor_Relation : define the relation between minor and major civs. 30 is friend, 60 is ally.

g_Major_Minor_DoW, g_Major_Minor_Peace, g_Minor_Minor_DoW, g_Minor_Major_DoW : define the peace/war state for minor civs

g_Cities : allow placement of buildings in cities at game start. The Key tag is used to define a special victory condition, in which you must capture all your enemy key cities before they take yours. Note that in the 1939 scenario, if playing Germany you get all key cities of France and UK before entering war with USSR, you win.
 
Thanks for this awesome MOD, and your time developing it. I would like to ask if there is a way to make the AI airplane strikes appear quicker. I mean if a fighter plane is attacking a submarine it goes over the tile 7 times. It isn't a problem but in the latter game it takes like 10 minutes per AI turn, and it'd be nice if it were less. Thanks again. (Germany 1939-1945)
 
Thanks for the link Gwynin. Does it work with the mod? and can I retro activate it for the game I am already playing?
 
yes, it's compatible with savegames.
 
One minor fix is that the German paratrooper icons (the boxed x) in the 1939 scenario are just normal infantry icons as opposed to the paratrooper icons (a boxed x with two lines) which the US paratroopers have.
 
I vaguely remember reading somewhere that it messes with the tile capture system. Is that true?
I don't see how it can have an effect on the tile capture system, so false I'd said. Didn't remember that report too, if you have a link, I'll have a look at it :)

One minor fix is that the German paratrooper icons (the boxed x) in the 1939 scenario are just normal infantry icons as opposed to the paratrooper icons (a boxed x with two lines) which the US paratroopers have.
yes, thanks. edit: New icons set are introduced with v.31, all the paratroopers will have real symbol on next beta.
 
Trying to run my mod but it won't work!
EDIT: Think it is the wrong data files mod
 
opening photo
View attachment 303554View attachment 303555View attachment 303556
here are some things to add to make dip and open photos better(more in the next post
View attachment 303557View attachment 303558View attachment 303559
diplomacy
View attachment 303560
icons
View attachment 303561View attachment 303562
speech(it is the speech of the leader announcing to the people that we are at war with a song after it)
i cant upload it to civfanatics (size compressed 27.3)and i cant also email it(up to 25)so tell me to upload it on utube or tell any other ideas)(EDIT READ NEXT POST FOR YOUTUBE DOWNLAOD AND CONVERSION TO MPE ,very ease)

icon for troops(if u want)
View attachment 303563

now the info
firsty about the governor
the leader of Hellas was Ioannis Metaxas.he was a fascist but not like the german or italian imagine something like a fascism with freedom and not so ultranationalist.he took power with the help of the king and destroyed the previus goverment but even so the people soon loved him.he did a very important thing,he united the Hellines(greeks) something that only leader like Alexander the Great achived.he was the one who told the italians that we wont give them parts of our land and that we wont let them pass thought it when one night they threatened us with 7.000.0000 soldiers.

economics and power
these time was one of the worst for Hellas because we were coming out of 4 wars(balkan 1 and 2 ,ww1 and minor asia war were we were betrayed by our allies and lost it)so Hellenic economy and army was in the worst condition in our long history.but ioannins metaxas with some very good economic moves could provide us weapons for 700.000 soldiers(had 200.000)some british artilery(had very old)some airplanes(nothing of big importance,about 78 planes,before about 3)and some ships and subs(had old)also even if british didnt supported us when russia italy and franch betrayed us in the minor asia war we have made a very good frendship with them.

when hellas got into war
at the night of 28 october 1940 the italian diplomat came to the house of metaxas asking him to make british ships leave agean , give key positions to italy and let italians pass thought the land to go to africa and attack brits from the north.metaxas answer was"so we are at war"it was avery logical answer because if he would help italy it was also a declaration of war to the allies and the british fleet cotrolled east mediteranean so the islands and supply would be cut also the greek would opose to give their land and would make a free Hellas in the islands so the unity that it was so hard to achieve would be destroyed.

army achievments
here is the most important part of the info.firstly to say that the hellenic army against the italian army airforce and navy was 1 to 10(maybe more)we had no tanks about 10 or less bombers old artillery old inf weapons and old ships.the first day of the war mousolini said that the next morning he will take his coffe near acropolis. a year passed and the italalians instead of moving forward moved backwards.the hellenic army took prisoners thousands of italians and albanias who helped them(some say that the albanians was against italy but this this lies only the vollunters were 5.000)they liberated many north epirus cities and it had more losses from the winter than from bullets(no tanks no airforce)in a big italinan counter attack they fought with 10 inf divisions and 2 tank against with 5 Hellenic and they lost 4 divisions and the greeks about 90 men and the Hellines counter attacked and moved even farther.the only way to destroy italian tanks was the small artillery but bassicaly the infarty was putting blankets in front of them so they would stuck and then be captured.when the germans and bulgarinas attacked we holded for a month against the three attackers and then fell but the battle continiued in crete where we destroyed the elite paratroopes of germany with only knifes and local people.after this remaing officers and troops went to africa and fought there.also our navy defeated the italian one prevented a sea invasion

hellenic help to allies

1 first victory for the allies side
2 make a very very serius damage to italy's army and prevented them from attack africa.
3 when the germans saw that the italinas couldt defeat hellas they moved half of the barbarossa attack army to help italy from the east which give time for the russia to prepare and most important for the winter to come.
(there may be more but i cant remember now)

other nations about hellas

tsortsil "from know on we wont say that greeks fight like heroes but that the heroes fight like greeks"
russians "we won the war thanks to the greeks"
even hitler let free the capture Hellines and let the officers kepp their guns
(there are more but i cant remember)

lastly for the name
DONT put greece PUT Hellas which is the real name official and used by us(Ellada)
Hellas=Greece (country name)
Helenic=Greek(things like divisions)
Hellines=Greeks(the people)
Merarchia=Division
Aeroporia=Airforce
Piroboliko=Artilerry
Naftiko=navy

unis
fine to me except the infarty which i think it would be better to put the italian one with dark green colors but if u cant change the color leave the brithsh one(hellines used the italian one but sometimes the used the british too)

land
hellenic islands given to turkey
a manufactory should be put north west hex of the thessaloniki and one north east f athens(if u want to put more for balance do it)
put olimpus
some farms in thessaly(near olimpus)
rivers

i have also a lot of photos but i could put any more attachments

Some quality info! I'm a Hellenic/Polish - Australian and I didn't know what Hellens thought of Metaxas. What do you think their trait shall be?
  • 'Heros fight like Hellens' +15% :c5strength: and double damage needed to retreat (as Gedemon said)
  • 'Sons of Spartans' discipline promotion
  • 'Fierce Hellens' no combat penalty for cut supply lines
 
I can confirm that the unit limit problem is solved with the DLL source code available :D

But don't add new units yet, I want to update the units configuration system first.
 
I can confirm that the unit limit problem is solved with the DLL source code available :D

But don't add new units yet, I want to update the units configuration system first.

Awesome!
Ya as soon as you get that system working I'll add more units, probably tank destroyers and assault guns (I think this is what you guys wanted right?).

and to answer your question about the screens in the other thread I do have an update ill post some time (I still have to edit more things). I took a break for awile so I forgot some of the changes that I did make so I guess I'll just post the entire versian I have.
 
okay, 2 bad news, 1 good news:

Bad:
- I don't know why it has worked once, but I can't pass the unit limits anymore. Yep that's very bad. Now if it has worked once...
- The DLL for R.E.D. WWII can't be loaded with the mod, unless I found a workaround you'll have to manually replace the vanilla DLL. that means no "public" release, but a new beta *soon*

Good:
- I've added a new combat event successfully, I'll be able to fully restore the functionality as they were before the .674 patch.
 
Top Bottom