EpicCasualWWiiEurope

Major Fix coming !
The scenario seems to be stable by now, leaving the pollution project issue on a side for the moment.

Reviews are always welcomes, and have fun. Much thanks Voltar and Prof.Garfield for their help, bringing this scenario to another height.

Major Fix 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)
 

Attachments

  • EpicCasualWWiiEuropeMajorFix3a.7z
    435.7 KB · Views: 55
You mentioned changing tech paradigm to 150 in v2 but this has it back to 200.
 
Well doesn't matter does it?
The rules.txt in your v3.0 has it at 200
 
Well doesn't matter does it?
The rules.txt in your v3.0 has it at 200
Used the rules.txt parameter to estimate the scenario parameter before creating the.scn file.

I guessed the scenario parameters overrided the basic rule.txt one ?
May I be wrong ?

----- _____ ----- _____ -----

Furthermore, i kind of see major possibilities of enhancement with dialog object in LUA and the implemented "annexion" system, using state storage to keep many "factions relations values", which could bring the scenario to new heights.

That would change the civilisations played, (Main Axe/ Main Allied / URSS / Minor Axe / Minor Allied / (true) Neutrals / (French? A powerfull Neutral ? Give choice at the beginning if human player and alea if AI ?) / Barbarians) and would be Worked on after the TESStormcloakRebellion scenario where the "manymany factions system" would be tested.
I guess that would remove the "casual" from this scenario name once that's done, giving a new version and vision over the conflict.
 
Last edited:
Used the rules.txt parameter to estimate the scenario parameter before creating the.scn file.

I guessed the scenario parameters overrided the basic rule.txt one ?
May I be wrong ?

Yes this is correct - the scenario parameters that you establish right before you save as scenario will overrule those that are in the rules text.

Furthermore, i kind of see major possibilities of enhancement with dialog object in LUA and the implemented "annexion" system, using state storage to keep many "factions relations values", which could bring the scenario to new heights.

Have you had an opportunity to poke around a bit with Cold War? I used probability roles in conjunction with different states/flags to allow the AI to make different decisions. Here's the section of code that deals with the Cuban Missile Crisis. Basically, the AI has an opportunity to either select the historical path, or an ahistorical path. I didn't make it that complicated, but there's no reason you couldn't. It might be an interesting way to have the Dragonborn choose his side, for example, or other things.

The dialogue option is an extremely useful and powerful tool.

Spoiler :

Code:
--DIALOG EVENTS: An attempt at bringing bilateral choice to the MP game
--THE CUBAN MISSILE CRISIS
if turn >=1 and turn <=135 and civ.hasTech(object.tUSSR, civ.getTech(46)) and tribe == object.tUSSR and (object.cHavana.owner == object.tProEast and object.cSantiagoDeCuba.owner == object.tProEast) and diplomacy.peaceTreatyExists(object.tUSSR,object.tUSA) == true then 
    justOnce("The Cuban Missile Crisis Begins", function()
    if object.tUSSR.isHuman then 
    dialog = civ.ui.createDialog()
        dialog.title = "The Cuban Missile Crisis"
        dialog.width = 300
        dialog:addText("Cuba has asked Soviet Premier ".. tostring(object.tUSSR.leader.name) .." to install nuclear missiles on the island to deter a future invasion by the United States.  If we agree, this will all but certainly evoke a strong response from the Americans.  What should we do?")
        dialog:addOption("Install the missiles!", 1)
        dialog:addOption("Refuse Castro.  We can't risk nuclear war with the Americans...", 2) 
        state.cubanMissileCrisisBegins = dialog:show()
    else 
    local probabilityRoll = math.random()
    if (probabilityRoll <= 1 and probabilityRoll >=.25) then
        state.cubanMissileCrisisBegins = 1
    elseif probabilityRoll < .25 then
        state.cubanMissileCrisisBegins = 2
    end
    end 
    if state.cubanMissileCrisisBegins==1 then
            --A state will be set that will trigger American response on their turn after production.
            state.CubaMissileCrisisSovietsInstallMissiles = true 
            dialog = civ.ui.createDialog()
            dialog.title = "Agreement to Install the Missiles!"
            dialog.width = 300
            dialog:addText("Spy agencies everywhere report that preparations are being made to install Soviet missiles in Cuba!")
            dialog:show()
           
   
    end
    if state.cubanMissileCrisisBegins==2 then
            --The event ends, because the Soviets didn't push the issue, but this has consequences later.  It will set a state where Cuba will revert Pro-West.
            state.CubaMissileCrisisSovietsRefusedCastro = true 
            dialog = civ.ui.createDialog()
            dialog.title = "Castro is refused!"
            dialog.width = 300
            dialog:addText("The Soviets have refused to install nuclear missiles on Cuba! Castro is furious, claiming that without Soviet support, it is only a matter of time before he is overthrown!")
            dialog:show()
           
           
        end
   
    end)
end
--The Crisis Continues if the Soviets choose to install the missiles.
if turn >=1 and turn <=135 and tribe == object.tUSA and (object.cHavana.owner == object.tProEast and object.cSantiagoDeCuba.owner == object.tProEast) and diplomacy.peaceTreatyExists(object.tUSSR,object.tUSA) == true and state.CubaMissileCrisisSovietsInstallMissiles == true then 
    justOnce("The Cuban Missile Crisis Heats Up", function()
    if object.tUSA.isHuman then
    dialog = civ.ui.createDialog()
        dialog.title = "The Cuban Missile Crisis"
        dialog.width = 300
        dialog:addText("A U-2 spy plane has confirmed the existence of nuclear missile launch sites being prepared in Cuba! This can only mean that the Soviets intend to install nuclear warheads on the island! It is only 90 miles or so from Miami! How shall we respond to this outrage?")
        dialog:addOption("Invoke the Monroe Doctrine!", 1)
        dialog:addOption("Do nothing.  We can't risk nuclear war with the Soviets...", 2) 
        state.cubanMissileCrisisHeatsUp = dialog:show()
       
        else 
    local probabilityRoll = math.random()
    if (probabilityRoll <= 1 and probabilityRoll >=.25) then
        state.cubanMissileCrisisHeatsUp = 1
    elseif probabilityRoll < .25 then
        state.cubanMissileCrisisHeatsUp = 2
    end
    end 
       
    if state.cubanMissileCrisisHeatsUp==1 then
            --A state will be set that will compel the Soviets to respond.
            state.CubaMissileCrisisAmericaInvokesMonroeDoctrine = true 
            dialog = civ.ui.createDialog()
            dialog.title = "The Monroe Doctrine!"
            dialog.width = 300
            dialog:addText("President ".. tostring(object.tUSA.leader.name) .." has responded to the Cuban Missile Crisis by invoking the 'Monroe Doctrine' and declaring that the Soviet installation of nuclear missile batteries is in direct violation of its guidelines! American warships prepare to intercept Soviet freighters carrying nuclear missiles as the world holds its breath!")
            dialog:show()
            civlua.createUnit(object.uDestroyer, object.tUSA, {{230,80,0},{230,84,0},{232,86,0},{231,85,0}}, {count=1, randomize=false, veteran=false})
            civlua.createUnit(object.uDestroyer, object.tUSA, {{231,85,0},{232,86,0},{230,84,0},{230,80,0}}, {count=1, randomize=false, veteran=false})
            civlua.createUnit(object.uFreighter, object.tUSSR, {{232,80,0},{232,82,0},{232,84,0}}, {count=1, randomize=false, veteran=false})
           
   
    end
   
    if state.cubanMissileCrisisHeatsUp==2 then
            --A Soviet Military Base is established in Cuba
            dialog = civ.ui.createDialog()
            dialog.title = "America Backs Down!"
            dialog.width = 300
            dialog:addText("Fearing a nuclear war, President ".. tostring(object.tUSA.leader.name) .." backs down! The Soviets install a new military base just 90 miles off the coast of Florida, arming it with nuclear missiles!")
            dialog:show()
            for unit in civ.iterateUnits() do
        if unit.owner ~= object.tUSSR and unit.location.x == 225 and unit.location.y == 89 and unit.location.z == 0 then
            civ.deleteUnit(unit)
        end
end
            local newMissileBase = civ.createCity(object.tUSSR,object.lSovietMissileBase)
            newMissileBase.name = "Missile Base"
            object.lSovietMissileBase.terrainType = 15
            civlua.createUnit(object.uSovietInf, object.tUSSR, {{225,89,0}}, {count=6, randomize=false, veteran=true})
            civlua.createUnit(object.uMRBM, object.tUSSR, {{225,89,0}}, {count=2, randomize=false, veteran=false})
    end   
       
    end)
    end 
--If the Monroe Doctrine is declared, the Soviets have one chance to avoid a war.  If they back off, nothing happens.  If they push forward, war is declared between the two powers and the base is established.
if turn >=1 and turn <=135 and tribe == object.tUSSR and (object.cHavana.owner == object.tProEast and object.cSantiagoDeCuba.owner == object.tProEast) and diplomacy.peaceTreatyExists(object.tUSSR,object.tUSA) == true and state.CubaMissileCrisisAmericaInvokesMonroeDoctrine == true then 
    justOnce("Last Chance for Humanity", function()
    if object.tUSSR.isHuman then
    dialog = civ.ui.createDialog()
        dialog.title = "The Cuban Missile Crisis"
        dialog.width = 300
        dialog:addText("The Americans have invoked an archaic position known as 'The Monroe Doctrine,' claiming that our installation of missile batteries in Cuba would violate their sphere of influence in the western hemisphere.  Several American warships have been sighted heading towards our convoy carrying the missiles.  If we push forward, there is a serious risk of nuclear war.")
        dialog:addOption("Call the Americans bluff! Push forward!", 1)
        dialog:addOption("We can't risk a nuclear holocaust.  Back down.", 2) 
        state.cubanMissileCrisisLastChance = dialog:show()
       
        else 
    local probabilityRoll = math.random()
    if probabilityRoll < .25 then
        state.cubanMissileCrisisLastChance = 1
    elseif probabilityRoll >= .25 then
        state.cubanMissileCrisisLastChance = 2
    end
    end 
    if state.cubanMissileCrisisLastChance==1 then
            --All hell breaks loose.  War declared between USSR and USA.  Military base established. 
            dialog = civ.ui.createDialog()
            dialog.title = "The world holds its breath!"
            dialog.width = 300
            dialog:addText("We have refused to back down to President ".. tostring(object.tUSA.leader.name) .."'s demand that we withdraw our missiles from Cuba! There is a very real possibility that this will spark a nuclear war! The world holds its breath!")
            dialog:show()
            local newMissileBase = civ.createCity(object.tUSSR,object.lSovietMissileBase)
            newMissileBase.name = "Missile Base"
            object.lSovietMissileBase.terrainType = 15
            civlua.createUnit(object.uSovietInf, object.tUSSR, {{225,89,0}}, {count=6, randomize=false, veteran=true})
            civlua.createUnit(object.uMRBM, object.tUSSR, {{225,89,0}}, {count=2, randomize=false, veteran=false})
           
   
    end
    if state.cubanMissileCrisisLastChance==2 then
            --Crisis averted.  Soviets get some minor backdoor concessions. 
            dialog = civ.ui.createDialog()
            dialog.title = "The world is spared!"
            dialog.width = 300
            dialog:addText("We have come to the brink of war with the Americans, but have managed to avert a disaster... For now.  We have agreed to remove our missile base from Cuba in exchange for some concessions from the Americans.")
            dialog:show()
            object.tUSSR.money = object.tUSSR.money + 300
   
    end
end)
end 
--If the Soviets backed down at the very beginning (not the second time) then Cuba reverts to Pro-West
if turn >=1 and turn <=135 and tribe == object.tUSA and state.CubaMissileCrisisSovietsRefusedCastro == true then 
    justOnce("Castro is Overthrown", function()
    dialog = civ.ui.createDialog()
        dialog.title = "Castro is Overthrown!"
        dialog.width = 300
        dialog:addText("The Soviets have refused to support Fidel Castro's grip on Cuba, calling him an unreliable upstart who risks dragging them into a nuclear war with the United States.  Without Soviet assistance, he is overthrown by Nationalist forces.")
        dialog:show()
        for unit in civ.iterateUnits() do
        if unit.owner ~= object.tProWest and unit.location.x == object.cHavana.location.x and unit.location.y == object.cHavana.location.y and unit.location.z == object.cHavana.location.z then
            civ.deleteUnit(unit)
        end
        if unit.owner ~= object.tProWest and unit.location.x == object.cSantiagoDeCuba.location.x and unit.location.y == object.cSantiagoDeCuba.location.y and unit.location.z == object.cSantiagoDeCuba.location.z then
            civ.deleteUnit(unit)
        end
end
        object.cHavana.owner = object.tProWest
        object.cSantiagoDeCuba.owner = object.tProWest
        civlua.createUnit(object.uLatinNat, object.tProWest, {{228,88,0}}, {count=5, randomize=false, veteran=true})
        civlua.createUnit(object.uLatinNat, object.tProWest, {{227,91,0}}, {count=5, randomize=false, veteran=true})
        civlua.createUnit(object.uMiG15, object.tProWest, {{228,88,0}}, {count=2, randomize=false, veteran=true})
        civlua.createUnit(object.uMiG15, object.tProWest, {{227,91,0}}, {count=2, randomize=false, veteran=true})
    end)
end


Also just as an aside, here's a few things I've found useful in designing (you may well already know this but I'm just trying to help).

--onActivate is exceptionally powerful as well. Remembering that it fires each movement an AI unit makes, it can be utilized to have very precise goto commands, or other stuff.
--afterProduction is where you're going to want to place most AI unit created/bad things happen for the human events as it will give the AI initiative.

I'm looking forward to both of your projects. I too am working on a WW2 European scenario so it'll be interesting to see what they both bring. At some point, when you're ready to call this "done" let me know and I'll post a notification on the main page showing it off.
 
Much thanks JPetroski. That's always good to say whatever the other could know.

In this case, that's much usefull direcly as I havn't tested nor studied these two functions.
In any case, this being publicly written (even if already written elsewere) gives opportunity for anyone eyes to get caught with it !

I havn't touched the ColdWar scenario yet, while I spyed on playthrough discussions about it with great interest. Guess I shall have a go with it.
 
Last edited:
I'll write a small TodoList about what's planned for the "nonCasual" version, as to enrich it little by little and not to forget some while putting effort somewhere else. Maybe even inspiring others ? Here it is :

-Remove Spain from civilisations & Have a Proper Neutral Civilisation peace-blocked with all.
-Rationnalise unit slot use (sharing more units slot between civ when possible)
-Allow countries infantries production based on geographic&controller conditions.
-Set up advanced unit bonus system (in the pixers idea), eg adding "stug" with unremarkable stats yet with raised stats when fighting armors.
-Set up advanced Influence system towards neutrals factions (associated with shifting stance countries) eg locals TrustVariables/Alliances/Blockades/RebellionsSupport/Wars and their consequences, like shifting civilisation for cities and units if war is broken.
-Set a technology to developped advanced antitank warfare, granting bonus in fight to civOwningTech's infantries against tanks.
-Set Factories and Refinneries units, bringing bonus to its supportingcities' production.
-Make Arsenal (boats), MassTransit/TankFactory (ArmoredUnits), RecyclingCenter/AirFactory (planes) needed to produce those units in a city.

Unsure -Set bombing system to planes, boats and artillery.
_____Interested with Bomb units like main used, also in a %luck of a city improvement _____destruction in neighbourg cities or a tile improvement destruction in bomber location tile
------Would have loved a sky map to figure true bombardment and air defenses, yet IA wouldn't manage to play it, would it ? Well, its kinda late now to add such a map anyway.
Unsure, possible ? -Set Airplanes reaction defense system up.
Unsure, possible ? -Set Artillery defensive reaction system.
 
Last edited:
Top Bottom