EpicCasualWWiiEurope

Dadais

King
Joined
Oct 20, 2010
Messages
891
Location
France
wwii.scn is still a reference in my mind.
Wished to have an upgraded casual experience version of it using ToTPP and Lua new horizons.

https://forums.civfanatics.com/resources/epiccasualwwiieurope.28575/





Could be pushed way further, tried to keep the script somehow simple.
It also result with a event file vastly optimisable, probably allowing to earn few hundred lines if worked on.

Feedback is welcome !
 
Last edited:
CORRECTION POST :

Correction Uploaded :
1.1:
-- in rules.txt
¤"Einstein Masterstroke" wonders needs "State Laboratory" instead of "university" tech.
Thus reduces early race for it to Nazi and English.
-- in events.lua
¤Gives 12 Submarines to Nazi on first turn instead of 1.
¤Gives troops in Poland on first turn to Nazi if not played by human.

----------
1.2:
-- in rules.txt
¤Canon and Artillery, too fast, got mp reduced to 1. Howitzer mp reduced to 3.
¤Nazi,English and Soviet diplomatic technology AI values changes to and -4 militaristic factor.
-- in events.lua
¤Modified the "AlliedGiveBackCities" feature's occurence and effect to have it work more smoothy.
¤Corrected the AINazi Boost to be given to AI only.
¤Corrected Neutral Armies deployment, removing cruiser which transport neutral troop in sea.
¤Corrected Unit Type declaration, which issued errors in the URSS Baltic diplomatic event.

----------
2.0:
--All files
BuildersCamp folder holds "old" files, .sav, .lua, .txt and others to help people personnalize further their game.

-- in .scn files
Removed few "policemen" materials.
Added French Infantries near Belgium, "trapping" English corps towards Belgium.
Removed some Soviet universities.
Added (very) little gold to all player.

-- scenario rules
Tech Paradigm reduced from 200 to 150.
-- in rules.txt
¤Policemen replaced by "material" unit.
¤Diplomatic tech placed in technology groups, and groups restriction applied.
¤Partisans and Rebels, hiding in population, negates the city wall.

-- in events.lua _ _ _ _ _ _ _ _ _ _ _ !all file reshaped!
¤Convoy interception gives more money.
¤Material interception gives money.
¤Neutral armies deployment written again. Few changes and corrections.
¤Polish escape changes from "Varsovie" to "All Polish cities" with ajusted benefits.
¤Alliances liberation center, extended to all civilisations and all their allies, yet limited to "core" cities.
¤Music played when city taken extended to all civilisations
¤LiberationOfParis event trigger only if Paris is taken back from Nazi by English. Won't trigger if french takes back Paris by himself or taken by English from anyother than Nazi.
¤Added Tip about the alliances territories liberation system.
¤Added AIboost in Poland to AI Soviet too (alongside AI Nazi).
¤Enforce the diplomatic technologies techgroup restriction.
¤Boosted Colonial empires support for AIciv.
¤The "Lock Neutral Infantry" system desactivate when a neutral country mobilize its army.
¤Diplomatic Technologies granting unit now grant twice if civ is AIplayed.
¤Added a Nazi AI event after few turns on his western front.
¤Added a special government & ruler switch event for turc civilisation.

----------
2.1:
-- in events.lua
¤Corrections to the Rebel spawn System. It now works and seems correctly balanced.

----------
2.2:
-- in events.lua
¤Correction to the Turc Coup Event
¤Correction to the materials transformation
¤Material destroyed by neutral, or french in France, grant him partisans units instead of money
¤Limited English material generation to France and Spain

----------
2.3:
--in rules.txt
¤tanks small review with voltar help. (aka units.bmp) + Added tiger
¤Grant infantries, rebels and partisans unit ability to spot invisible unit (thanks to their numbers)
¤Reduced material defence to 0.
-- in events.lua
¤Get rid of unused tech from Turc on first turn.
¤Turn Stalin and Churchill into true Men on first turn.
¤Correct material generation of urss, wrongly created as English.
¤Baltic Armies generation bug was back. Corrected !

----------
3.0:
--in rules.txt
¤German tanks review with voltar help. (aka units.bmp)
¤AICapitalisationLimit raised to 1000
¤Terrain types raised to 16, adding scenario purpose ones. (aka terrain1.bmp / Describe.txt)
-- in events.lua
¤Corrected cities allocation in Diplomatic Tech events.
¤Corrected military units weight on Rebel generation system.
¤Corrected a Nazi balkan variable which blocked its execution.
¤Scenario zone creation at the beginning of a new game.
¤Correction of the ZoC bug associated with diplomatic tech events.
¤Neutral Infantries lock is tighten up to avoid armies exchanges between different neutrals, especially before annexions
¤Corrected bug in URSSBaltic event which gave URSS all neutral unit on map...
¤Corrected bug in URSS NE Romania event (unit creation location value)
¤Corrected city occupation bug in Diplomatic Tech Events.
¤correction on militaries unit weight on rebel generation.
¤Corrected BalkanNaziEvent test variable allocation.





/From 1.x version, first dl the Major fix to upgrade to 2.0 then DL the last fix.
/From 2.x version, just DL the latest fix.
/Or DL the full version updated again here

Correction not uploaded yet /BUG Report :

-Mass Transit is buildable, but pollution is disabled.
 

Attachments

  • EpicCasualWWiiEuropeMajorFix2a.7z
    6.2 MB · Views: 58
  • EpicCasualWWiiEuropeMajorFix3a.7z
    435.7 KB · Views: 91
Last edited:
First Fix :
1.1:
-- in rules.txt
¤
"Einstein Masterstroke" wonders needs "State Laboratory" instead of "university" tech.
Thus reduces early race for it to Nazi and English.
-- in events.lua
¤
Gives 12 Submarines to Nazi on first turn instead of 1.
¤Gives troops in Poland on first turn to Nazi if not played by human.
 
-Giving back home cities to allied doesn't work !
---\Issues with "city.originalOwner" vanilla game changes. Have to see that with veteran civ modders. Feature may be doomed.

It seems the "city.originalOwner" is rather a "previousOwner-ExceptIfpreviousPreviousOwnerIsOwner" variable. I am wrong ? Guess that means more work to have a "giveback between allies" system work.


Seems that variable is modified by the game AFTER "civ.scen.onCityTaken(function(city,defender))"
So, solution is to put it in this function instead of the civ.scen.onTurn(function(turn))"

That leaves as question : what to do with the occupying unit ?
Guess a civ.getActiveUnit() in the "civ.scen.onCityTaken(function(city,defender))" shall select it, thus allowing to change its owner to the legit city owner.

What's left then is to avoid the invader from becoming originalOwner ...

Well, that's not for the best but ... they're allied after all ?
Well,some cities may leave the range of action of that feature, yet, that shall somehow be working now ?
 
Last edited:
It seems the "city.originalOwner" is rather a "previousOwner-ExceptIfpreviousPreviousOwnerIsOwner" variable. I am wrong ? Guess that means more work to have a "giveback between allies" system work.

I state the following in my fourth Lua lesson:
Another way to specify a region is to define it to be within a certain distance of some cities. Write a function inHomesteadRome(tile,distance) that determines if a tile is within distance squares of a city that Rome founded (based on city.originalOwner). It turns out that city.originalOwner changes whenever a city is captured, so once a city is liberated, the "originalOwner" is the former occupier. (We could define "Rome" based on a list of cities at the start of the game, but to update that list for new cities founded, we need Lua tools not yet discussed.)
It looks like I came to the same conclusion the last time I investigated the issue.

It might make sense to define what cities are given back simply based on regional location. The generalLibrary has a function gen.inPolygon that might be useful, and I've also attached a polygonScript.lua file that might help you specify polygons. Use the load script button in the console to start the polygonScript.lua . There is an option to give you some explanation about how it works.
 

Attachments

  • gl+polygonScript.zip
    21.5 KB · Views: 50
Aouch, bad student spotted !
Appologies Prof.Garfield. I tried to avoid to dig in the region definition system. Truth is, that would makes many things easier indeed.

I'll dig then..

Much thanks
 
Last edited:
All I meant by quoting the paragraph was that I was more informed at that point than I am at present, not that you "should have remembered," or anything. In any case, I think I wrote the polygon script some time after I wrote the lessons (though it was one of the first things in lua that I attempted). Looking over how to define regions, of course, will help you use the polygon code to do what you want.
 
No worry Prof.Garfield, that's more self-mockery than serious blame.
"Region" definition and uses seems way more easy than feared. Time to play with it and evolve that Lua file.
 
Second fix :

1.2:
-- in rules.txt
¤Canon and Artillery, too fast, got mp reduced to 1. Howitzer mp reduced to 3.
¤Nazi,English and Soviet diplomatic technology AI values changes to and -4 militaristic factor.
-- in events.lua
¤Modified the "AlliedGiveBackCities" feature's occurence and effect to have it work more smoothy.
¤Corrected the AINazi Boost to be given to AI only.
¤Corrected Neutral Armies deployment, removing cruiser which transport neutral troop in sea.
¤Corrected Unit Type declaration, which issued errors in the URSS Baltic diplomatic event.


Taking a little more time, many effort is put into refinning the Lua code with regions definition, giving a more efficient, more complete code and feature less flawed than this rough somehow working system.
 
Major update comming,
Wrote back from scratch most of the lua file, applied some little changes, some bigger. Here's what is comming soon. With special thanks on Prof.Garfield again.

2.0:
--All files
BuildersCamp folder holds "old" files, .sav, .lua, .txt and others to help people personnalize further their game.
-- in .scn files
Removed few "policemen" materials.
Added French Infantries near Belgium, "trapping" English corps towards Belgium.
Removed some Soviet universities.
Added (very) little gold to all player.
-- scenario rules
Tech Paradigm reduced from 200 to 150.
-- in rules.txt
¤Policemen replaced by "material" unit.
¤Diplomatic tech placed in technology groups, and groups restriction applied.
¤Partisans and Rebels, hiding in population, negates the city wall.
-- in events.lua _ _ _ _ _ _ _ _ _ _ _ !all file reshaped!
¤Convoy interception gives more money.
¤Material interception gives money.
¤Neutral armies deployment written again. Few changes and corrections.
¤Polish escape changes from "Varsovie" to "All Polish cities" with ajusted benefits.
¤Alliances liberation center, extended to all civilisations and all their allies, yet limited to "core" cities.
¤Music played when city taken extended to all civilisations
¤LiberationOfParis event trigger only if Paris is taken back from Nazi by English. Won't trigger if french takes back Paris by himself or taken by English from anyother than Nazi.
¤Added Tip about the alliances territories liberation system.
¤Added AIboost in Poland to AI Soviet too (alongside AI Nazi).
¤Enforce the diplomatic technologies techgroup restriction.
¤Boosted Colonial empires support for AIciv.
¤The "Lock Neutral Infantry" system desactivate when a neutral country mobilize its army.
¤Diplomatic Technologies granting unit now grant twice if civ is AIplayed.
¤Added a Nazi AI event after few turns on his western front.
¤Added a special government & ruler switch event for turc civilisation.
 

Attachments

  • EpicCasualWWiiEuropeMajorFix.7z
    6.2 MB · Views: 60
Man this is amazing, I tried quickly playing as USSR using the Nazis .scn

One thing Germany kept attacking Baltics, and it kept spawning Baltic infantry every time they lost one. Then when I inherited them via the tech I inherited nearly 500 baltic infantry.

German AI attacks all the neutrals that it can reach, paradropped Kalmar and more
Germany and Italy went to war on like turn 3.
Turkey sneak attacked me on turn 4.
German sneak attacked me on turn 5.

However the borders are supposed to be isn't quite right, after inheriting baltics there's a bunch of tiles I can't access behind my lines now?

Overall, amazing map and effort, can't wait to see it evolve.
 
Much thanks for this feedback @voltar !

The baltic (and Belgium) mobilization bug got spotted in the middle of that major fix conception. It thus is corrected by it.
It is accessible from now on on the message fix above to DL, the complete version update in the DL section shall be uploaded tomorrow (time to sleep before Mme awake)

About the AI behaviour ... i'm quite helpless with it considering my wish to keep the freedom of the first wwii scenario proposed by microprose i cherrished so much.

I can't quite understand your innaccessible tiles issue ? May you developp this so I may correct that stuff (if not corrected with this new fix) please ?
The idea with the border design is to provide rough landmark on the map not to loose oneself, used with this new version on rough definition of "zones".
They may not at this moment be strictly followed.
 
Not good at paint but from Kaunas that unit can move to the two adjacent tiles arrowed. But it can't move from one of those tiles to the other.

There are many issues like this in Baltic region. I don't know LUA so I can't speak to this issue.
Also I opted to attack Norway they spawning Infantry also but only a few, but I guess that's the same issue you said you fixed or that's how it should be.
 

Attachments

  • Bad Painting.png
    Bad Painting.png
    63.7 KB · Views: 81
Not good at paint but from Kaunas that unit can move to the two adjacent tiles arrowed. But it can't move from one of those tiles to the other.

That seems like a zone of control issue. Units ignore ZOC when moving out from within a city, but not from 2 squares in the open (unless moving into an already occupied square. Perhaps there is an invisible unit?
 
Nah def not ZOC, it's specific tiles, and directions for those tiles and they're in Neutral areas, and i checked with cheat to see if there's anything to see.

I mean if it is ZOC it must be something with LUA rules or whatnot. I've been playing civ2 since it released and have no explanation. There's a bunch of such cases in the area that I noted but seems they can be bypassed from certain directions.
 
Go to game options, and turn on tutorial help. If it is a ZOC issue, the ZOC tutorial popup should show.

I was able to replicate this exact behaviour by creating a new unit of a different tribe on the same tile as a city.

Try inputting this code into the lua console (ctrl+shift+F3 to open the console), while the cursor is over one of your cities with a few units in it.

Code:
civ.createUnit(civ.getUnitType(33),civ.getTribe(0),civ.getCurrentTile())

You can check this by putting this code into the lua console, while the cursor is over an affected city

Code:
for unit in civ.getCurrentTile().units do print(unit) end

If you're playing the soviets, you should see units with owner=1 as part of their printed information. However, I expect you'll find some units with a different owner (probably owner=0).

Somewhere in the code, either new units are being created on soviet cities, or some units aren't being properly transferred to the soviets after annexation.
 
Prof. Garfield must have gotten it right.
I looked back in the old Lua file the process conducting to this situation :

The unit creation for baltic countries with that past version looked like
if a unit got killed, if it was a lithuania infantry or latvia infantry or estonia infantry and if ItAlreadyMobilized/BaltCountriesAreAnnexed.
Which it traducted this way :
if a unit got killed - if (it was a lithuania infantry) or (latvia infantry) or (estonia infantry and if it already happened ItAlreadyMobilized/BaltCountriesAreAnnexed).

It then created neutral units in cities despite you having annexed it, for every Lithuanian infantry or latvian infantry killed.

These units, maybe hidden in your cities under the swarn of your bugged infantries, then create ZoC. I remember there could be an issue if you tryed to enter the twin occupied city with one of your unit by the way, eg attacking your own unit in your own city ?


Luckily, That got corrected with that major fix, yet the old save may suffer from that situation, and would need to activate cheat mode to treat these both problems (too many unit spawned and neutral unit spawned in your soviet city).
 
Gosh, correction of unexpected errors with rebels generation system are currently under work for a "small" fix.
 
Little fix over that major one :

! Please make sure you have the Major fix downloadable here installed before installing this one !

Overwhise, you may also directly download again the full version updated here.

As always, feeback is most welcome, only time playtesting may find issues left for small fixes.
If you're a modder in heart, you may edit this to your taste, be it the scenario in itslef or the lua events code. Feel free, only goal is to enjoy.
 

Attachments

  • EpicCasualWWiiEuropeFix2b.7z
    24.5 KB · Views: 64
Second little Fix, with infos about the first


2.1:
-- in events.lua
¤Corrections to the Rebel spawn System. It now works and seems correctly balanced.

2.2:
-- in events.lua
¤Correction to the Turc Coup Event
¤Correction to the materials transformation
¤Material destroyed by neutral, or french in France, grant him partisans units instead of money
¤Limited English material generation to France and Spain
 
Last edited:
Top Bottom