[TOT] &ToTPP with Lua : EpicWWiiEurope

Dadais

King
Joined
Oct 20, 2010
Messages
891
Location
France
Growing from the EpicCasualWiiEurope scenario, goal is there to push further the game experience and features provided by Lua.

Secondary project at the moment after the TES one, it still see advancement to bring fresh air in head.

Here's a list of what shall be coming with this more worked on version of the conflict :


-Rationnalise unit slot use (sharing more units slot between civ when possible)
-Remove Spain from civilisations & Have a Proper Neutral Civilisation
peace-blocked with all.
-Allow countries infantries production based on geographic&controller conditions./altered
-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 develop Grenade Launcher, granting bonus in fight to civOwningTech's infantries against tanks.
-Set a technology to develop Assault rifle, granting bonus in fight to civOwningTech's infantries against infantries.
-Set Factories and Refinneries units, bringing bonus to its supportingcities' production./altered
-Make Arsenal (boats), MassTransit/TankFactory (ArmoredUnits), RecyclingCenter/AirFactory (planes) needed to produce those units in a city.
Set bombing system to boats and artillery.
-Set a player-simplified ground-attack system to planes
and a bombing system to planes
-Set Airplanes reaction defense system up.
-Set Artillery defensive reaction system.
 
Last edited:
creation diary
Spoiler :
If you don't have space for munitions, you could replicate the AI defense by still having the bomber press "K" and then having that deal damage to nearby units, perhaps after targeting them via a menu, while also exposing the bomber to reactive defensive fire?

The AI can simply target each other via onActivation which shoul/d work just fine with the bomber as the actual triggering unit.
I'll continue here, as not to grow a big question in the small questions thread.

Here's the point :
temp.png

I got there twelve slots avaible for few units left :
factories&reffineries, long range bombers, light/medium bombers, Bombs, shells.

In my idea,
5 would be given to light bombers (eg il2, stuka, ba65, mosquito, potez)
5 would be given to shells, (ground 7.5, ground 10, ground&sea 15, sea 20, sea 38)
1 would be given to industries (merging factories and reffineries)
Only 1 would be left.
LongRangeBomber would be left out. May modify actual planes for their true operation range (with one tile being equal to around 30km irl) if AAreaction can be set.


About bombing, i'm not sure at the moment about concept to put in this scenario.
-For boats and artilleries, i'd like to use the munition system, using the "k" key and shells. That answer to the will to have boats bomber coasts from afar and artilleries beeing able to pose a threat to boats.
-I'd like to give opportunity for a bomber to destroy a tile improvement : Thus use the "k" key for planes to try their luck destroying a tile improvment (destroy bridges from the sky !) under them
-I'm furthermore unwilling to use the same bomb unit for different sizes of planes, thus looking for another way to have things done.


AA and artillery reaction is yet another question, for Lua only to discuss, whether it's doable or not.
 
Last edited:
I'd consider making your smaller ships direct attack only and reserving the ranged attack for heavy cruiser and up to save a spot.

Your idea about using k attacks to change terrain improvemens is very interesting! If you get it working I won't be able to resist adding it to Cold War (with proper credit of course)
 
Also just as an aside, you could probably make it AI friendly. Think of it like this...

1. OnActivate checks to see if the AI bomber is on a tile determined to be an "enemy" (likely, in a hostile polygon).

2. It then checks what improvements the tile has.

3. If certain improvements are present, A probabilityRoll has the AI decide if they will attack, or carry on.

4. If they decide to attack, you have several arguments for if flak fires, if the attack is successful, etc. Etc.
 
creation diary
Spoiler :
I'd consider making your smaller ships direct attack only and reserving the ranged attack for heavy cruiser and up to save a spot.
Well, smaller ship shall share their shell with heaviest artilleries (the 150mm), which seems somehow closed to history ?
Your idea about using k attacks to change terrain improvemens is very interesting! If you get it working I won't be able to resist adding it to Cold War (with proper credit of course)
No need for credit if it's build and recycled. ;)
I'll have to study tile.improvement bitmask for that :(
 
Last edited:
I'll have to study tile.improvement bitmask for that :(

FYI, the General Library has had tile improvement functionality for a little while now.

Code:
--gen.hasIrrigation(tile)-->boolean
--gen.placeIrrigation(tile)-->void
--gen.removeIrrigation(tile)-->void
--#gen.hasMine(tile)-->boolean
--#gen.placeMine(tile)-->void
--#gen.placeMineUnderCity(tile)-->void
--#gen.removeMine(tile)-->void
--#gen.removeMineUnderCity(tile)-->void
--#gen.hasFarmland(tile)-->boolean
--#gen.placeFarmland(tile)-->void
--#gen.removeFarmland(tile)-->void
--#gen.hasAgriculture(tile)--> boolean
--#gen.improveAgriculture(tile) --> void
--#gen.degradeAgriculture(tile) --> void
--#gen.removeAgriculture(tile)--> void
--#gen.hasRoad(tile)-->boolean
--#gen.placeRoad(tile)-->void
--#gen.removeRoad(tile)-->void
--#gen.hasRailroad(tile)-->boolean
--#gen.placeRailroad(tile)-->void
--#gen.removeRailroad(tile)-->void
--#gen.hasTransportation(tile) --> boolean
--#gen.upgradeTransportation(tile) --> void
--#gen.degradeTransportation(tile) --> void
--#gen.removeTransportation(tile) -->void
--#gen.hasFortress(tile)-->boolean
--#gen.placeFortress(tile)-->void
--#gen.placeFortressForce(tile)-->void
--#gen.removeFortress(tile)-->void
--#gen.hasAirbase(tile)-->boolean
--#gen.placeAirbase(tile)-->void
--#gen.placeAirbaseForce(tile)-->void
--#gen.removeAirbase(tile)-->void
--#gen.hasPollution(tile)-->boolean
--#gen.placePollution(tile)-->void
--#gen.removePollution(tile)-->void
--#gen.removePollutionForce(tile)-->void
--#gen.hasTransporter(tile)-->boolean
--# NOTE: Can't placeTransporter
--#gen.removeTransporter(tile)-->void
--#gen.setTerrainType(tile,terrain)-->void
 
FYI, the General Library has had tile improvement functionality for a little while now.

Spoiler :

--gen.hasIrrigation(tile)-->boolean
--gen.placeIrrigation(tile)-->void
--gen.removeIrrigation(tile)-->void
--#gen.hasMine(tile)-->boolean
--#gen.placeMine(tile)-->void
--#gen.placeMineUnderCity(tile)-->void
--#gen.removeMine(tile)-->void
--#gen.removeMineUnderCity(tile)-->void
--#gen.hasFarmland(tile)-->boolean
--#gen.placeFarmland(tile)-->void
--#gen.removeFarmland(tile)-->void
--#gen.hasAgriculture(tile)--> boolean
--#gen.improveAgriculture(tile) --> void
--#gen.degradeAgriculture(tile) --> void
--#gen.removeAgriculture(tile)--> void
--#gen.hasRoad(tile)-->boolean
--#gen.placeRoad(tile)-->void
--#gen.removeRoad(tile)-->void
--#gen.hasRailroad(tile)-->boolean
--#gen.placeRailroad(tile)-->void
--#gen.removeRailroad(tile)-->void
--#gen.hasTransportation(tile) --> boolean
--#gen.upgradeTransportation(tile) --> void
--#gen.degradeTransportation(tile) --> void
--#gen.removeTransportation(tile) -->void
--#gen.hasFortress(tile)-->boolean
--#gen.placeFortress(tile)-->void
--#gen.placeFortressForce(tile)-->void
--#gen.removeFortress(tile)-->void
--#gen.hasAirbase(tile)-->boolean
--#gen.placeAirbase(tile)-->void
--#gen.placeAirbaseForce(tile)-->void
--#gen.removeAirbase(tile)-->void
--#gen.hasPollution(tile)-->boolean
--#gen.placePollution(tile)-->void
--#gen.removePollution(tile)-->void
--#gen.removePollutionForce(tile)-->void
--#gen.hasTransporter(tile)-->boolean
--# NOTE: Can't placeTransporter
--#gen.removeTransporter(tile)-->void
--#gen.setTerrainType(tile,terrain)-->void
More than half is done !
 
creation diary
Spoiler :
AA and artillery reaction is yet another question, for Lua only to discuss, whether it's doable or not.
From what I foresaw, it could work using test of werabout units with each "onActivateUnit", yet would only work for AIs.
Human player don't need such an advantage.

Other solution would be a test at "onResolveCombat",
where in a "ground fight" defensor's tribe Artilleries on defensor tile would hurt a little the attacker.
where in a "plane vs ground fight" defensor's and allied tribe AAcanons one tile away or fighters few tiles around would grant opportunities to damage / strike down said plane, at risks for devensive planes
and test at "onKeyPress",
where with a "bombing plane" AtWar tribe AAcanons one tile away or fighters few tiles around would grant opportunities to damage / strike down said plane, at risks for devensive planes
?
 
Last edited:
creation diary
Spoiler :
So, conditional production applied on city improvements :

"Barracks" becomes "Training Grounds"
"Mass Transit" becomes "Canon Factory" (needed to build artilleries, tanks and warboats)
"Factory" becomes "Foundry"
"Manufacturing Plant" becomes "Refinery"
"SDI" becomes "Barracks" (needed to build infantries & Cavalries)
"Recycling Center" becomes "Auto Factory" (needed to build ArmouredCars, SPArtilleries, tanks, antitanks, engineer, freight, jeep)
"Geothermal Plant" becomes "Horror Working Camp"
"Flak defenses" becomes "Plane Factory" (needed to build ... well ... planes)
"Coastal Fortress" becomes "Arsenal" (needed to build boats & submarines)
"Arsenal" becomes "Naval academy"

Most city improvements got their buildingcost and upkeep changed.

Lua will comme after to set rules up.
Defenses bonus from CF, RB and SDI are indeed removed, one shall set off the report from SDI&RB while no boat shall be able to attack directly cities from sea.
 
Last edited:
creation diary
Spoiler :
So, i'll have to build a small event.lua file to clean the last .sav from the Casual version.

Before that, i'm thinking about the use of the two last slots :
temp.png

Still had the "industries (aka factory & refinery) in mind.
Yet, refinery is now a city improvement, and we see many "war factories" also in cities.

Was pondering about an expansion for the munition system.
What with having a "munition" variable for each civ ? Which would be generated each turn by "Ammunition factory" units ?
Munition variable in which one would dig to fire with its unit (rather than using money at that point) ?
 
Last edited:
Why not use the strategic bombing system knighttime built for OTR and used again in Medieval Millennium? Have the factory unit destroy the city improvements. Have the city improvements restore the factory unit.
 
creation diary
Spoiler :
Why not use the strategic bombing system knighttime built for OTR and used again in Medieval Millennium? Have the factory unit destroy the city improvements. Have the city improvements restore the factory unit.
To understand well :
We would have one slot used for "industries", where one "industries" would correspond to both Foundry, Refinery, Plane/Auto/Canon-Factory, Arsenal and Plants ?
Where "on improvement build", one would create a "industries" unit in a free (else self occupied) passable tile next to city (else in city) ?
Where "on industries killed", one would destroy one of these improvement chosen by alea ?

That would be interresting indeed !
 
Last edited:
Why not use the strategic bombing system knighttime built for OTR and used again in Medieval Millennium? Have the factory unit destroy the city improvements. Have the city improvements restore the factory unit.

To understand well :
We would have one slot used for "industries", where one "industries" would correspond to both Foundry, Refinery, Plane/Auto/Canon-Factory, Arsenal and Plants ?
Where "on improvement build", one would create a "industries" unit in a free (else self occupied) passable tile next to city (else in city) ?
Where "on industries killed", one would destroy one of these improvement chosen by alea ?

That would be interresting indeed !

I am planning on implementing a strategic bombing module for the Lua template, and I was planning to make it so that the unit type and location can together determine what improvement is destroyed and in what city. This would save unit slots compared to OTR. If you're interested in strategic bombing for your scenario, I'll make a point to build the module sooner rather than later. It's easier to build something when there is a 'target' to test it with. My initial plan was to build it before releasing version 1 of the Lua Template, but there were already several modules to build and test, and Boudicca didn't need strategic bombing.

I think with the way the template is built, I can integrate new modules simply by providing an updated events.lua file, which the end user isn't 'supposed' to use anyway. I don't think we'll be too much longer with Boudicca, and after that I can remove the Boudicca specific code and release the template for use.

Was pondering about an expansion for the munition system.
What with having a "munition" variable for each civ ? Which would be generated each turn by "Ammunition factory" units ?
Munition variable in which one would dig to fire with its unit (rather than using money at that point) ?

In my munition module, I allow the creator to create an arbitrary function that determines if the unit can generate a munition or not. So it should be possible to check if there is ammunition stored 'near' the unit, and, if so, create the munition and decrement the stockpile. I would think twice about such a system. It might increase the micromanagement too much.
 
creation diary
Spoiler :
I am planning on implementing a strategic bombing module for the Lua template, and I was planning to make it so that the unit type and location can together determine what improvement is destroyed and in what city. This would save unit slots compared to OTR. If you're interested in strategic bombing for your scenario, I'll make a point to build the module sooner rather than later.
Thanks, i'll yet decline :
Many cities have too few tiles around them considering the number of improvements involved, as i'll stick to tiles right next to cities to avoid strange territories invasions.
I'll then stick to alea. That's not much to build anway :) .
edith : guess i'll allocate units and location to city improvement finally, to make existance test at the begin of each turn (to cover disband and support loss situations) easier.
I'll still put my hands on it, no worry ;) .
In my munition module, I allow the creator to create an arbitrary function that determines if the unit can generate a munition or not. So it should be possible to check if there is ammunition stored 'near' the unit, and, if so, create the munition and decrement the stockpile. I would think twice about such a system. It might increase the micromanagement too much.
Was imagining a nationwide stock for munition, as to make it easier indeed on calculs.
Was furthermore thinking of allowing another interraction with neutral (buying ammunitions from neutral stocks) civs
 
Last edited:
creation diary
Spoiler :
Considering recent changes, took time out of Lua to paint the new tech tree, enforcing changes to it and reducing risk of errors in rules.txt.

TechTree.PNG
 
Last edited:
creation diary
Spoiler :
Working on conditionnal improvement & (mainly) units production, that's way easier than feared to implement.

Thinking on some parameters of the ww2, and how i planned on having a "Ammo" variable for each civilisation, i was thinking of adding an "Oil" variable for each civilisation, conditionning the moving ability of motorised units at the beginning of each turn (and adding a new technology, "coal gasification").

Interresting idea ?
 
Last edited:
It is interesting, but when you say things like "for each civilization" I would suggest you use a "isHuman" check as the AI is all but guaranteed to fail hard using it.

I am using oil in my WW2 in Europe scenario but I'm not going to use ammo. One other suggestion I would have if you start utilizing "behind the scenes" mechanics is that you ensure you have a keypress event such as on tab that will bring up a menu that gives a status report, such as is done in OTR with our points system, or Napoleon with several of the systems in that scenario. It's just too much not to know about at any given moment.
 
creation diary
Spoiler :
It is interesting, but when you say things like "for each civilization" I would suggest you use a "isHuman" check as the AI is all but guaranteed to fail hard using it.

I am using oil in my WW2 in Europe scenario but I'm not going to use ammo. One other suggestion I would have if you start utilizing "behind the scenes" mechanics is that you ensure you have a keypress event such as on tab that will bring up a menu that gives a status report, such as is done in OTR with our points system, or Napoleon with several of the systems in that scenario. It's just too much not to know about at any given moment.

Sure, a status menu becomes necessary.
I was thinking of giving extra bonuses to AI (like for units somehow) to help them ?

That's just a thought at the moment, still wondering how to implement such a thing.
 
Last edited:
creation diary
Spoiler :
meeting an issue with the state table :
temp.png

temp.png
temp.png


// I don't get the error if I put in comment the "state = civlua.unserialize(buffer)" in the "civ.scen.onLoad" function:(
(.scn not build at the moment, working on a .sav file)
 
Last edited:
Top Bottom