R.E.D. World War II development thread

has something changed in civ5 game basic or the mod code itself recently? all of a sudden, fall of france event is not working at all. i reinstalled civ5 and fresh downloaded versions of the vanilla mod, and still it doesnt work.

nothing changed around that, and I still can't reproduce the crash.
 
@ozzi: while I think we'll don't need the D790 and BR810 project (I will make the Joffre project require the D520 and BR690 project instead) you should not get error from missing ID, both projects are automatically added to the DB at the same time the units are added.

Can you check in the debug DB if the D-790 and Br-810 units are there, or are they missing too for you ?
 
@ozzi: while I think we'll don't need the D790 and BR810 project (I will make the Joffre project require the D520 and BR690 project instead) you should not get error from missing ID, both projects are automatically added to the DB at the same time the units are added.

Can you check in the debug DB if the D-790 and Br-810 units are there, or are they missing too for you ?

Sorry haven't seen this before now. i was playing as germany in that game but it was easy to see there was something wrong because all the projects became available.

how ever it looks like i get that same msg
" WARNING: project (ID=11) is not defined in g_ProjectsTable" again.
not sure how the id's are given to projects, sometimes i got msgs that project id288 or something like that was missing, there aren't so many lines on project defines

and btw yes i think you are right, they are not needed anyway, i think i just added them when i added those other projects and forgot to remove when i saw they become available with Joffre project
 
how ever it looks like i get that same msg
" WARNING: project (ID=11) is not defined in g_ProjectsTable" again.
not sure how the id's are given to projects, sometimes i got msgs that project id288 or something like that was missing, there aren't so many lines on project defines
Warning messages are just, well, warning messages, I've implemented them as a reminder that something may require attention, but is (hopefully) not game breaking.

Error messages are those that require immediate attention as something is surely broken then.

In that case it says that a project is defined in the game database but as no entry in g_ProjectsTable, which is normal, I've coded the units SQL file so it add a project in the DB for every units, but we don't need all of them... It may be useful for scenario starting before 1939, but for the base game we just need to define later projects.

There are also military operations coded in projects that are not used in all scenario (there will be the "warning" message in those scenario, and it can be safely ignored)

So I've kept the
Code:
PROJECT_BR810			= GameInfo.Projects.PROJECT_BOMBER_BR810.ID
and
Code:
PROJECT_D790			= GameInfo.Projects.PROJECT_FIGHTER_D790.ID
lines in case a scenario want to use those, and left the Joffre projects requiring the D-520 and Br-690 projects as you've noted.
 
yes i thought warnings were not not so crucial
it just looked like projects weren't launching if that warning showed up but looks like it was my own mess, i had too many versions of mod lol

deleted those and downloaded on new from github and now it's fine again
 
try to download the zip of the dev branch from gitHub and use a diff tool to check for differences in your local version.

here is what I have in my Lua.log when the game check for new projects:
Spoiler :
Code:
[119632.954] RedMain: Initializing new projects...
[119633.032] RedMain: M-11-39 tank design is completed.
[119633.110] RedMain: L6/40 tank design is completed.
[119633.173] RedMain: G.50 Fighter design is completed.
[119633.251] RedMain: KV-1 tank design is completed.
[119633.329] RedMain: M.B.152 fighter design is completed.
[119633.407] RedMain: M.S.406 fighter design is completed.
[119633.453] RedMain: BF-110 Heavy Fighter design is completed.
[119633.516] RedMain: Panzer III tank design is completed.
[119633.578] RedMain: Panzer IV tank design is completed.
[119633.672] RedMain: Cruiser MK III tank design is completed.
[119633.719] RedMain: Matilda II tank design is completed.
[119633.781] RedMain: Matilda I tank design is completed.
[119633.859] RedMain: Tetrarch tank design is completed.
[119633.921] RedMain:  - Type 5 Chi-Ri Tank Design date = Fail ! ( < 19430301 or Prob 10% < 20)
[119633.921] RedMain:  - Sturmpanzer VI Sturmtiger design lacks pre-required project.
[119633.921] RedMain:  - Marder II Ausf D design XP = Fail ! (XP = 0 < 250)
[119633.921] RedMain:  - IS-2 Tank Design lacks pre-required project.
[119633.921] RedMain:  - Yak-7 Fighter Design date = Fail ! ( < 19410901 or Prob 35% < 96)
[119633.921] RedMain:  - Avro Lancaster Bomber Design date = Fail ! ( < 19400101 or Prob 35% < 35)
[119633.921] RedMain:  - Heinkel He 177 design date = Fail ! ( < 19410601 or Prob 10% < 59)
[119633.921] RedMain:  - Ilyushin Il-2 design date = Fail ! ( < 19401115 or Prob 15% < 6)
[119633.921] RedMain:  - Ilyushin Il-4 design date = Fail ! ( < 19400101 or Prob 8% < 31)
[119633.921] RedMain:  - M4A1(76)W Sherman IIA tank design lacks pre-required project.
[119633.937] RedMain:  - Fiat M14/41 tank design XP = Fail ! (XP = 0 < 350)
[119633.937] RedMain:  - A27M Cromwell design XP = Fail ! (XP = 0 < 150)
[119633.937] RedMain:  - A39 Tortoise design date = Fail ! ( < 19450701 or Prob 15% < 33)
[119633.937] RedMain:  - SU-152 design lacks pre-required project.
[119633.937] RedMain:  - Panzerjager V Jagdpanther design lacks pre-required project.
[119633.937] RedMain:  - SU-100 design lacks pre-required project.
[119633.937] RedMain:  - Macchi C.205 Veltro design lacks pre-required project.
[119633.937] RedMain:  - Mitsubishi G4M Betty design date = Fail ! ( < 19410401 or Prob 10% < 20)
[119633.937] RedMain:  - M4A2(76)W Sherman IIIA Tank Design XP = Fail ! (XP = 0 < 75)
[119633.937] RedMain:  - Spitfire Mk V design XP = Fail ! (XP = 0 < 250)
[119633.937] RedMain:  - Sturmgeschutz III Ausf F design XP = Fail ! (XP = 0 < 100)
[119633.953] RedMain:  - Marder III design lacks pre-required project.
[119633.953] RedMain:  - Panzerjager Tiger (P) Ferdinand design date = Fail ! ( < 19420901 or Prob 15% < 59)
[119633.953] RedMain:  - Spitfire Mk IX design XP = Fail ! (XP = 0 < 750)
[119633.953] RedMain:  - Sturmgeschutz III Ausf G design XP = Fail ! (XP = 0 < 250)
[119633.953] RedMain:  - Flakpanzer IV Mobelwagen design date = Fail ! ( < 19430801 or Prob 15% < 44)
[119633.953] RedMain:  - Sexton design date = Fail ! ( < 19430401 or Prob 25% < 22)
[119633.953] RedMain:  - Messerschmitt Bf-109T design date = Fail ! ( < 19390101 or Prob 15% < 38)
[119633.953] RedMain:  - Nakajima Ki-84 Hayate design lacks pre-required project.
[119633.953] RedMain:  - M4A3E2 Sherman Jumbo Tank Design XP = Fail ! (XP = 0 < 50)
[119633.953] RedMain:  - Messerschmitt Bf 109F design XP = Fail ! (XP = 0 < 250)
[119633.953] RedMain:  - A30 Challenger design lacks pre-required project.
[119633.953] RedMain:  - M4A1 Sherman II tank design date = Fail ! ( < 19400801 or Prob 15% < 49)
[119633.953] RedMain:  - M-26 Pershing Tank Design date = Fail ! ( < 19440601 or Prob 25% < 62)
[119633.953] RedMain:  - ISU-152 design lacks pre-required project.
[119633.953] RedMain:  - Laffly W15 TCC design date = Fail ! ( < 19400101 or Prob 20% < 62)
[119633.953] RedMain:  - Marder III Ausf H design XP = Fail ! (XP = 0 < 100)
[119633.953] RedMain:  - Panzerjager VI Jagdtiger design lacks pre-required project.
[119633.953] RedMain:  - Messerschmitt Bf 109G design XP = Fail ! (XP = 0 < 750)
[119633.953] RedMain:  - Valentine Tank Design lacks pre-required project.
[119633.968] RedMain:  - Gloster Meteor design date = Fail ! ( < 19440401 or Prob 15% < 51)
[119633.968] RedMain:  - Messerschmitt Me-262 design date = Fail ! ( < 19440401 or Prob 20% < 43)
[119633.968] RedMain:  - Kawasaki Ki-61 Hien design lacks pre-required project.
[119633.968] RedMain:  - A15 Crusader Tank Design lacks pre-required project.
[119633.968] RedMain:  - A22 Churchill design date = Fail ! ( < 19410401 or Prob 15% < 68)
[119633.968] RedMain:  - ARL-44 Heavy Tank Design date = Fail ! ( < 19440101 or Prob 15% < 11)
[119633.968] RedMain:  - Panzer V Panther Tank Design date = Fail ! ( < 19420901 or Prob 15% < 38)
[119633.968] RedMain:  - Panzer VI Tiger Tank Design date = Fail ! ( < 19420301 or Prob 20% < 14)
[119633.968] RedMain:  - T-34 tank design date = Fail ! ( < 19400601 or Prob 15% < 83)
[119633.968] RedMain:  - IS-1 Tank Design date = Fail ! ( < 19430101 or Prob 20% < 15)
[119633.968] RedMain:  - Fiat-Ansaldo M13/40 tank design date = Fail ! ( < 19390801 or Prob 10% < 46)
[119633.968] RedMain:  - Ansaldo P26/40 design date = Fail ! ( < 19430401 or Prob 10% < 93)
[119633.968] RedMain:  - Type 4 Ke-Nu Tank Design date = Fail ! ( < 19440101 or Prob 35% < 34)
[119633.968] RedMain:  - Breguet 690 design date = Checked ! ( >= 19390101 and Prob 15% >= 7)

and here is what you have:
Spoiler :
Code:
[305132.375] RedMain: Initializing new projects...
[305132.375] RedMain: M-11-39 tank design is completed.
[305132.406] RedMain: L6/40 tank design is completed.
[305132.406] RedMain: G.50 Fighter design is completed.
[305132.406] RedMain: KV-1 tank design is completed.
[305132.438] RedMain: M.B.152 fighter design is completed.
[305132.438] RedMain: M.S.406 fighter design is completed.
[305132.438] RedMain: BF-110 Heavy Fighter design is completed.
[305132.438] RedMain: Panzer III tank design is completed.
[305132.469] RedMain: Panzer IV tank design is completed.
[305132.469] RedMain: Cruiser MK III tank design is completed.
[305132.469] RedMain: Matilda II tank design is completed.
[305132.469] RedMain: Matilda I tank design is completed.
[305132.500] RedMain: Tetrarch tank design is completed.
[305132.500] RedMain:  - Sturmgeschutz IV design lacks pre-required project.
[305132.500] RedMain:  - Semovente M43-105/25 design lacks pre-required project.
[305132.500] RedMain:  - Sd.Kfz.124 Wespe design lacks pre-required project.
[305132.500] RedMain:  - Macchi C.205 Veltro design lacks pre-required project.
[305132.500] RedMain:  - A24 Cavalier design lacks pre-required project.
[305132.500] RedMain:  - A34 Comet design lacks pre-required project.
[305132.500] RedMain:  - Sturmpanzer IV Brummbar design lacks pre-required project.
[305132.500] RedMain:  - Sd.Kfz.165 Hummel design lacks pre-required project.
[305132.531] RedMain:  - Joffre Class design lacks pre-required project.
[305132.531] RedMain:  - Joffre Class design lacks pre-required project.
[305132.531] RedMain:  - Sturmpanzer VI Sturmtiger design lacks pre-required project.
[305132.531] RedMain:  - SU-85 design lacks pre-required project.
[305132.531] RedMain:  - Mitsubishi A7M Reppu design lacks pre-required project.
[305132.531] RedMain:  - Yakovlev Yak-9 design lacks pre-required project.
[305132.531] RedMain:  - M24 Chaffee design lacks pre-required project.
[305132.531] RedMain:  - Operation Weserübung available in Euro1940
[305132.531] RedMain:  - Operation Seelöwe available in Euro1940
[305132.531] RedMain:  - SU-152 design lacks pre-required project.
[305132.531] RedMain:  - SU-100 design lacks pre-required project.
[305132.563] RedMain:  - A15 Crusader Tank Design lacks pre-required project.
[305132.563] RedMain:  - Marder III design lacks pre-required project.
[305132.563] RedMain:  - ISU-152 design lacks pre-required project.
[305132.563] RedMain:  - IS-2 Tank Design lacks pre-required project.
[305132.563] RedMain:  - Kawasaki Ki-61 Hien design lacks pre-required project.
[305132.594] RedMain:  - Nakajima Ki-84 Hayate design lacks pre-required project.
[305132.594] RedMain:  - M4A1(76)W Sherman IIA tank design lacks pre-required project.
[305132.594] RedMain:  - Kawasaki Ki-100 design lacks pre-required project.
[305132.594] RedMain:  - Semovente M42M-75/34 design lacks pre-required project.
[305132.594] RedMain:  - M4A2 Sherman III tank design lacks pre-required project.
[305132.594] RedMain:  - A30 Challenger design lacks pre-required project.
[305132.625] RedMain:  - Panzerjager 38(t) Hetzer design lacks pre-required project.
[305132.625] RedMain:  - Sd.Kfz.138-1 Grille design lacks pre-required project.
[305132.625] RedMain:  - Panzerjager V Jagdpanther design lacks pre-required project.
[305132.625] RedMain:  - Flakpanzer V Coelian design lacks pre-required project.
[305132.625] RedMain:  - Panzerjager VI Jagdtiger design lacks pre-required project.
[305132.625] RedMain:  - Panzerjager IV design lacks pre-required project.
[305132.625] RedMain:  - Panzer VIB Konigstiger design lacks pre-required project.
[305132.625] RedMain:  - No trigger data, Sovetsky Soyuz class battleship design is immediatly available.
[305132.625] RedMain:  - No trigger data, KV-2 Heavy Assault Gun design is immediatly available.

a lots of projects are missing...

Check that you'r using the new syntax:
Code:
Trigger = {Type = [B]TRIGGER_DATE, Date =[/B] 19420101, ProbPerTurn = 15},
and no more
Code:
Trigger = {Type = [B]"date", Value =[/B] 19420101, ProbPerTurn = 15},


and same for XP triggers.

That was done to allow projects with both date and/or XP triggers


edit: ok, good :)
 
New major update on GitHub:

- Change a few cities on the 1939 maps, tweak Oil deposit placement and values
- Add Oil consumption/rationing mechanism for the 1939-1945 Europe scenario (including new convoy routes and a Synthetic Fuel Plants building)
- Add "The MotherLand Calls" operation to USSR (available and repeatable when losing the war)
- Add auto-repair function for improvements pillaged by Special Forces
- Give Materiel and Oil when capturing a city, depending on it's size
 
I am playing Beta 4. It seems Italy is not at war with Egypt and therefore will not attack into British N.Afrika (it is surrounded by Egypt).
 
which scenario ?
 
Hello Gedemon - Sorry I may have been wrong. After placing Italian units using IGE into Egypt, they seem to be attacking now. I am playing Europe 1939-1945 scenario beta 4. Sorry if I have cried wolf.

On a side note, Romania, Bulgaria, Hungary have no starting units. Not sure about Finland.
 
units are spawned when war is declared.

BTW, please use this thread for development questions only (how to mod this or that), and the scenarios threads for scenario specific problems.
 
build with modbuddy ?

anything in the lua.log ?
 
to explain a bit, the project's zip does not include the modinfo file which is created when building the mod with modbuddy.

and since the last beta version there have been some change in the file structure (related to resources management)
 
small update on GitHub:

- add new building: oil refinery (can stock 1000 oil) for all nation
- better calculation for oil and materiel captured with a city (using ratio between city max stock and nation max stock)
- test bug fix for convoy units not displaying their cargo when reloading a game
- small UI improvement
- allow special forces to embark from anywhere
 
Update on gitHub:

- Add objective information to top panel in the 39-45 Europe scenario
- Add LN-401 project to France
- Edit flakpanzer 38(t) project to be date related and not an upgrade from flakpanzer I
- Add Stug III F and Stug III G to German build list
- Bug fix: do not use first owner but previous owner when calculating resources captured with a city...
- Special Forces can move after attacking
 
Hey Gedemon, i have downloaded a latest versions of the mod here and it looks like scripted events aren't working now?
Poland doesn't get vilnius at the start and it doesn't fall when Warsaw is captured
on lua log it seems all normal, it call for CityCaptured serial event but i can't see the mod ever loading RedEuro1940.lua and its functions

btw i tried just for fun if it would be possible to make a trait for Finland that it's troops keeps supply lines cut when entering Finish territory... that's what they did on winter war

added this

-- check if russian unit has entered finish territory
if (player:GetName() == "TXT_KEY_LEADER_STALIN") then-- to not do that for all players units
Dprint (" - found russian unit (".. player:GetName() ..")", bDebug )
local closeCity = GetCloseCity ( playerID, unitPlot )
local plotKey = GetPlotKey ( unitPlot )
local firstOwnerID = GetPlotFirstOwner( plotKey )
local firstOwner = Players[ firstOwnerID ]
local unitPlotX = unitPlot:GetX()
local unitPlotY = unitPlot:GetY()
Dprint (" - Original owner of this tile was (".. firstOwner:GetName() ..")", bDebug )
if (firstOwner:GetName() == "Finland") then
Dprint (" - Russian unit in finnish territory!", bDebug )
if closeCity then
Dprint (" - Found own city nearby, checking distance", bDebug )
local cityPlot = closeCity:plot()
local cityPlotX = cityPlot:GetX()
local cityPlotY = cityPlot:GetY()
local distanceX = unitPlotX-cityPlotX
local distanceY = unitPlotY-cityPlotY
if ( distanceX > 1 or distanceX < -1 or distanceY > 1 or distanceY < -1) then
Dprint (" - distance x to closest city is (".. distanceX ..")", bDebug )
return false
end
end
end
end

on supply check function between where it's ignoring sea and air unit and closest city function

seems to be working, they haven't supply unless they capture a city, then they have supply again in tiles around that city

edit: tried to copy contents of RedEuro1940.lua to DefinesEuro1940.lua and after that scripts seems to work again
 
All files are loaded on my build:

Code:
[841593.663] RedMain: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[841593.663] RedMain: ++++++++++++++++++++++++++++++++++++++++++++++++++++++ R.E.D. World War II script started... ++++++++++++++++++++++++++++++++++++++++++++++++++++++
[841593.663] RedMain: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[841593.663] RedMain: Loading Red Defines...
[841593.663] RedMain: -------------------------------------
[841593.678] RedMain: Loading Red Rules Defines...
[841593.678] RedMain: -------------------------------------
[841593.678] RedMain: Loading Red Utils Functions...
[841593.678] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Debug Functions...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Route Connections...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Generic Functions...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Diplomacy Functions...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Units Utils...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Units Functions...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Resources Functions...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Updating all units flag...
[841593.694] RedMain: Loading Red AI Global Functions...
[841593.694] RedMain: -------------------------------------
[841593.694] RedMain: Loading Red Air AI Functions...
[841593.694] RedMain: -------------------------------------
[841593.710] RedMain: Loading Red Combat functions...
[841593.710] RedMain: -------------------------------------
[841593.710] RedMain: Loading Red Supply Routes Functions...
[841593.710] RedMain: -------------------------------------
[841593.710] RedMain: Loading Euro 1940 Defines...
[841593.710] RedMain: -------------------------------------
[841593.710] RedMain: [B]Loading Red Europe 1940 Scripts[/B]...
[841593.710] RedMain: -------------------------------------
[841593.710] RedMain: Loading Red Europe 1940 Functions...
[841593.710] RedMain: -------------------------------------

You won't see it loaded in TopPanel, ProductionPopup, etc.. as it's not needed there.

I'm not sure about UA for minor civs, but that's a good idea if we convert Finland to a major civ :)

I'd suggest to use

Code:
GetCivIDFromPlayerID(playerID) == USSR
instead of
Code:
player:GetName() == "TXT_KEY_LEADER_STALIN"

and
Code:
GetCivIDFromPlayerID(firstOwnerID) == FINLAND
instead of
Code:
firstOwner:GetName() == "Finland"

player:GetName() return "Joseph Stalin" on my computer, and both it and "Finland" will change depending on the language used (would be "Joseph Staline" and "Finlande" in French for example)

I suppose you could use GetKeyName to be safe, but I'd prefer to keep the same code everywhere when checking for player/nation.

USSR is defined in RedDefinesGlobal.lua and FINLAND is defined in DefinesEuro1940.lua
 
iI know it doesn't show up there but i didn't see it even in lua log. it's weird it behaves differently on different computers... i'm using win7 64 bit and tested it with both .70 and .144 version of the game. and every version before that has worked normally too

trying to figure out why i almost never can play longer than to turn 75-85 before the game crashes and after it does that i can't continue playing, maybe that's also only on my computer?
game crashes for various reasons, sometimes during my turn when moving a unit or attacking, sometimes during other players turns. but always when opening last end-turn autosave it crashes so that last line on lua log says updating player 6 data and after that
-------------------------------------
and there it ends. any suggestion where could i look?

thanks for the tips, i'm new on lua, was not sure at all how could i make it work
 
Top Bottom