[TOT] &ToTPP with Lua : EpicWWiiEurope

Am I correct in guessing that you re-create the 'loser' unit after combat, if the unit didn't actually get defeated? That method wasn't really explored in Over the Reich, since we don't have access to the variable governing how many turns the unit has been in the air (this is the same variable that controls how much work a settler has done, and what the caravan commodity is), and turns aloft is very important in Over the Reich.
You're totally right.

Truth is, I took advantage of aa reaction to get rid of the range influence and its consumption for planes, which aren't on air for more than a month after all, range thus being set to 1.
Yet this doesn't find an easy solution on settlers and caravan.

It's impressive you're seeing with a look from a far all these limits !

@JPetroski did stuff like that a little while ago. I was planning on doing some videos related to the template once it is completed.
It should help a lot to advertise the template indeed !
 
Human bombing is done, few correction applied left and right by the way.
Took Advantage of this to add the battlegrounds (pollution) generation in fighting rounds on defender tiles (except between planes).


Tiles improvements targatable have a bombing resistance,
against which planes have a bombing maximal power (fighters < light bombers < heavy bombers)

Before that test, all planes have a precision test (heavy bombers < fighters < light bombers)


Met an issue with allocating last moveSpent possible to planes in code, bringing strange behaviours.
Placed a strong movepoint restriction on bombing use as to evade the problem and thinking about the solution (to avoid last moveSpent removal eg)
 
Last edited:
This is an interesting approach to the matter. We found that we had to limit moveSpent reductions to 1 MP remaining as we weren't able to access values for turns aloft / range. I'm not sure if that's the issue you are running into or not.
 
This is an interesting approach to the matter. We found that we had to limit moveSpent reductions to 1 MP remaining as we weren't able to access values for turns aloft / range. I'm not sure if that's the issue you are running into or not.
Well, first issue, mostly yet not fully solved, was how to have the "unit screenboard" update (so the player don't have a wrong info about how many move poin are left).

The true issue was met with the "out of fuel" feature which should have been met with last movespent allocated by the bombing using "k" key :
-tryed to useunit activation, then activate back this unit for no result (expected, it doesn't have any movepoint left)
-tryed to destroy the unit once its movespent was >= to its unittype move, for no result, even with a centerView() refreshing the board as to make sure that wasn't a screen glitch.

Should have tested the unit condition at that moment, yet didn't take time to dig in more that situation.
I'll may recreate this situation with a simplier test game and a fighter.



The loft/range value was indeed posing a threat with units "rising back from death", while I anyway prefered to have planes not on sky for more than a turn on an immersion point, turns in this scenario being a month after all.
 
Last edited:
Well, first issue, mostly yet not fully solved, was how to have the "unit screenboard" update (so the player don't have a wrong info about how many move poin are left).

Let me know if you come up with a good solution.

-tryed to destroy the unit once its movespent was >= to its unittype move, for no result, even with a centerView() refreshing the board as to make sure that wasn't a screen glitch.

Wait, how have you tried to do this? civ.deleteUnit should always work.
 
Let me know if you come up with a good solution.
Here's the less bad I came up with, working most of th time, still yet with little flaws :

temp.png


To explain for others than you, I simply created a useless unit on a corner reserved for the scenario purpose (designed to avoid ZoC bug associated with mass units owner changes, recycled here)
made it the active unit, then destroy it and centered view to the next active-to-be unit, so both unitIHMframe and mapFrame were updated.

Situations where it doesn't update sometimes arise. I shall look at it again to check when it does so. I indistinctly remember it occured when moving to a next tile after bombing. Not sure throught.

Wait, how have you tried to do this? civ.deleteUnit should always work.
I think so to, which leads to an issue with the tests allowing it (for further investigations on civ2 planes behaviours)
I had a text pop-up not showing up supporting this guess.

I don't have the previous code to check tests before calling the function again (must have been something like "unit.type.move <= unit.moveSpent").
I tried to add a civ.ui.centerView(anywhere) to make sure the unit was still there and that wasn't a leftover picture.

I didn't thought about checking with console the unit data which could have been confirming a track. To reproduce, you may just add 'x' movepoints to active unit when pressing "k" then try to delete it once moveSpent is >= type.move.
Then, press "k" on a flying fighter to its sheduled end.

I'll may try this evening if i may reproduce this issue.

(I like a looser inadvertantly gave a negative moveSpent once, which stopped immediatly the unit)
 
Last edited:
I didn't thought about checking with console the unit data which could have been confirming a track. To reproduce, you may just add 'x' movepoints to active unit when pressing "k" then try to delete it once moveSpent is >= type.move.
Then, press "k" on a flying fighter to its sheduled end.

I'll may try this evening if i may reproduce this issue.
So, left my 32bit environnement to the 64bit install test station.
All was going on fine as intented.

Too sad the malfunctionning code is lost, the observed strange behaviour must have been generated by an error in it.
Basic test
Spoiler :
temp.png

Negative value test
Spoiler :
temp.png

Last test
Spoiler :
temp.png
With this last test, I changed the view to refresh it and have the remaining ghost picture of the plane go off
 
Last edited:
So !
A big part of the Lua code is (at least do I hope) done. All what's left from the shedule is working on :
-The Neutrals civilisation,
¤to glu to peace with all.
¤to make unable to develop more techs.


-the Turc civilisation, (maybe also URSS under conditions from uk/us)
¤Allow via a scenario menu's submenu to buy units from AtPeaceWithCivs (should probably have to check ability to produce said units before selling it)

-all civs
¤Add relationship bonuses between NotToDifferentC.C.P.Partners and relationship malus towards TooBigC.C.P.Partners
¤Developp the "territory" system, to ease work on it.
¤Enforce and developp the core territory dynamic system
and its resistances consequences
¤Set territories under control influences in a submenu.
¤Set neutral territories periodic (considering local politics currents strengh) influences
¤Set neutral territories civs influences and actions in a submenu
¤Set foreign territories influences and actions in a submenu

Once written, that's not so few ...

¤Miscelanious little stuff for flavour
 
Last edited:
I wouldn't use deleteUnit within the combat resolution event. I haven't tried it, but I suspect that nothing good can come of it. To ensure that the correct unit dies, set that unit's damage so that it the unit has at most 0 hp. (And, ensure the 'surviving' unit has at least 1 hp.)
creation diary
Spoiler :

Anwsering there as not to pollute the Boudica thread (thx for explaining the division of the resolutionscenariofunction into two function in Template by the way) :

error sourcesI tryed that solution to answer ugly situations coming with the AntiAirReaction system or the ArtillerySupportReaction system, where both units could have their hp reduced to 0 on the same turn.
Thus as a last check if both units had 0hp, deleted both units and returned false to the function.
Situations with only one unit down came with the usual way to get out of fight, with hp to 0 gone into the default function.

Seems to work, didn't see any issue at the moment, yet didn't check fully if errors could be born from that.

Guess I see how to build it tidier for later scenarii (or if it occurs issues),
having stronger stats parallel storage in the resolvingfight function, and resolve all situations, including creepy ones in the unitkilled function ?

Thought I had tested it.
Not sure, i did it again, result is catastrophic as you guessed :

I shall work back on it then. Much thanks !
 
Last edited:
I'm just glad you're around @Dadais . It's nice to have a "new" (meaning, hasn't really been active in scenarios for 20 years by our standards) designer who shows up and starts doing some groundbreaking work like this. I'm impressed that you're able to draw your own units, make your own maps, and code your own lua. I'm looking forward to seeing what you come up with in your various scenarios going forward. I think we're all in for a treat!
 
I'm just glad you're around @Dadais . It's nice to have a "new" (meaning, hasn't really been active in scenarios for 20 years by our standards) designer who shows up and starts doing some groundbreaking work like this. I'm impressed that you're able to draw your own units, make your own maps, and code your own lua. I'm looking forward to seeing what you come up with in your various scenarios going forward. I think we're all in for a treat!
That's too nice you silly, and sometimes feeling undeserved, yet welcomed as encouragements !

creation diary
Spoiler :
Correction in 'onResolveCombat' and 'onUnitKilled' was applied, I'm now on territories redesign, with its new form chosen.

Big and fat countries from EpicCasualWWII are abandonned. While previous on map "*" frontiers will stay still, new smaller "." frontiers are being added !
We shall have now new layers :
-Territories, smallest subdivisions which are 'core'able, and are under rules of a definite government if neutral (eg : both Croatia and Bosnia are under Yugoslav rules, while transdanubia is under hungarian's).
They shall be quite a few !
-Regions, intermediate divisions, used to reach territories in submenus (eg : "Paris", "Normandy" or "Burgundy" are territories in "France" region, while "England" and "Wales" are territories in the "Atlantic" region).
-We shall also have Areas, Where a "Western Europe" area would have in regions such as "France","Atlantic" and "Hispania" for exemple.

Next to that, "governement" shall have caracteristics like governement type, DemocraticPoliticalInfluences, FacistPoliticalInfluences, CommunistPoliticalInfluences, and CivilisationsAttitudes.
 
Last edited:
creation diary
Spoiler :
So, little more than 160 territories are defined.
I'm now updating (well, rebuilding from zero) their tile affectation function.

French cores - Done
Allied cores - Done
Italian cores - Done
Neutral cores - Done
German cores - Done
Turc cores - Done
Soviet cores - Done
 
Last edited:
creation diary
Spoiler :

temp.png

More than halfway of Neutrals done, still some to go !
Guess I'll set up a function to figure easily in which territory one is (and maybe give an easy path for interactions ?), maybe with the "k" keypress with no active unit ?
 
Last edited:
Sorry if it's not the place for my question, but I'm new in the site and I'm not sure about its working and if people use to visit it. Can anyone help me? I would like to know where I could find the concrete goals of each civilization in every scenario. I've downloaded a game version and I'm not able to find it anywhere. Thanks in advance...
 
So, all territories are defined, and a day was spent to hunt errors (with a dozen corrected).
Neutrals governements are listed, next is

-giving territories influences (democratic, facist, communist, islamic I guess), which is supposed to represent the simplified political currents having power over the territory population.
-set monthly "natural" evolutions to influences,


-gives governements natures (democratic, facist, communist, emirate),
-set neutral governements leaders,
-set neutral governements relation stats with played civilisations,

-set monthly risk of internal rebellion (considering governement nature and its influences, including the core influence on it),

then
-set the relation menu between neutral governements and HumanPlayer
-set relations between neutral governements and AI
-gives power to influence territories for money while selecting it (using the "k" key with no unit selected) for Human
-set said influences for AI.
 
Last edited:
Personnal issues and fall of spirit power led to a stop on the project.
Time was spent elsewhere, yet it's time to bring this project to its end.

Working time is back !
 
Well, first, thank you for this map! Jesus man, this is the amp of my World War II dreams!

May I use it? I want to make a VERY different World War II scenario.

Now your readme is unclear, you have a scenario for the Turks, the Italians and the Nazis. Is there a file for the Allies or are they not ready for prime time?
 
Well, first, thank you for this map! Jesus man, this is the amp of my World War II dreams!

May I use it? I want to make a VERY different World War II scenario.

Now your readme is unclear, you have a scenario for the Turks, the Italians and the Nazis. Is there a file for the Allies or are they not ready for prime time?
Off course you may use it, for whatever you wish. On the other side, even if I modified some parts of it, you shall see (in the readme i guess ?) for its main creator credits.
Civ2 greatness is brought by adding each other contributions, allowing new propositions.

The scenarii and readme files shall be ones from the "casual" version of this project, already finished ?
I guess I havn't uploaded files from this new noncasual project yet ?

I'm planning here to have a single .scn file for this "noncasual" project, allowing one to play with any main civilisation using it (playing with any minor civ with choice given at the beginning of the game is for other futur scenarii).
 
Last edited:
Back
Top Bottom