[TOT] The Test Of Time Patch Project

That wouldn't prevent an aircraft unit from taking off in the middle of Berlin though.
 
Last edited:
I'm interested in learning more about the "on activation" trigger for units.

Earlier, I'd asked if it were possible for cities to only build air units, or only ground units, as some can currently only build naval units.

I'm hoping "on activation" can be a useful workaround. But I need it to be able to do this: On activation, check for unit type, then check for if it is on a certain terrain type, and if both are true, delete unit (possibly with a return of gold equivalent to the units' cost).

For example, I'd like to rework "Over the Reich" to get rid of some major headaches found in playtesting (namely, it isn't fun to have to play with a notepad next to you to keep track of everything you discover while you individually control the army, then the industry, then the airforce). It would be much better if I could have simply a "Germany" civ rather than "Luftwaffe, Germany, and German Industry." But, I don't want certain cities building certain units. So I'm thinking, if the game will automatically delete a certain type of unit that happens to be on a certain type of square, then the player can build an Fw190 in Berlin all they want, but they'll never be able to use it (because Berlin will be built on a "city" square which will trigger the deletion as soon as it is selected). The player would instead have to build the unit in an airfield city, like III/JG2.

This would of course require the player to actually read the readme, but I think it expands possibilities for scenarios quite nicely! (No more need for house rules in Second Front Redux, for example).

Would this work in principle? I wonder if the game would crash?

Edit-the more I think about it, this would solve a HOST of problems with that scenario...

You'll have something much better pretty soon. A trigger that runs when you press the 'build' button in a city, where you can return, for each unit/improvement/wonder whether it can be built or not. I'll post some examples later.
 
There's an issue I've encountered in the development of the Operation Seelowe scenario. I would like to limit the number of units a diplomat or spy can bribe in a turn, independent of their movement allowance. Is it possible to have the "Attacks per turn" feature apply to the unit bribery function?

Yes, that could be an option, to put it in the attacks per turn patch, alternatively it could maybe be implemented in a new Lua trigger. Let me think about this.
 
You'll have something much better pretty soon. A trigger that runs when you press the 'build' button in a city, where you can return, for each unit/improvement/wonder whether it can be built or not. I'll post some examples later.

I'm loving these options! That sounds really cool - so basically you would hit build and depending on the city, you would only be able to build certain things? That takes area of recruitment, colonial troops, and airbases/naval bases to a whole new level!

The "on activation" would solve a problem I have with that scenario though... For the most part, it is an air scenario, but then the Allies invade France and start pushing in towards Germany. Every time they would capture an airfield it would be awkward on the old system of having several different civs. If I can simply delete any air units that end their turn in a "city" and only allow them to remain if they end their turn on an "airbase" - then that solves that problem right there. I really don't want the air units landing on cities.
 
I agree John. This is going to open up more realistic possibilities. Building a heavy bomber in a small, unindustrialized city isn't realistic, even if it takes a really long time. Build an aircraft factory first, and that's another matter.

I'd advise caution about ending the airbase function of cities and forcing planes to operate from airfields exclusively. You can't sentry planes on airfields, which is a minor pain. But the main problem is that any aircraft can land on an empty airfield, and that AI ground units don't usually stick around to garrison them. Yes, you can create immobile garrison units, but it still is fraught with problems. I just eliminated all airfields from my Seelowe scenario and moved all German and British aircraft to cities for exactly these reasons.
 
The airfields are also cities in Over the Reich. They look like airfields by restricting their size/walls options.

I only want aircraft to be able to "land" on airfield cities. By having "regular city" cities be built on specific terrain and then deleting aircraft that go onto such terrain, I could restrict air forces to "air base cities" and still allow ground forces from the same civ to capture them.
 
Yes but I see that as one of the "problems" with scenarios like Second Front and Over the Reich. You almost have to play with a little notepad next to you to keep track of what units one civ found vs. the other. I'm hoping lua streamlines things by allowing everything to fit nicely on one civ. It will be better for gameplay, IMO (and also save a civ that could be used for other things). Further, this would add true strategic importance to certain cities. Imagine if I made an updated version of "Up the Deadly Boot" - Foggia would go from being just another city to being THE city that the Allies want to key in on, as it would extend their air range (assuming it was an "airbase city").

Lots of fun ahead with lua, for certain! I hope all scenario designers are paying attention to this and the other threads! I know Grishnach, McMonkey and I are trying to pump out a few quality scenarios in the next few months featuring lua to help convince everyone else that the water is fine :)
 
Another question I have regarding "on activation." Is there any way to check to see if one unit is aboard a particular type of ship? For a WW2 scenario I'm dreaming up, here's the issue:

* The English channel (and the Royal Navy) ought to mean something. The Germans moving units from France, across the channel, and into England all in one turn shouldn't be possible. Your transports should have to move slowly enough that they can be intercepted and sunk unless you control the seas and/or skies.

* With that said, the Battle of the Atlantic shouldn't also have to move at a snail's pace.

So I need to have two types of transports: A landing craft transport that is slow, but units can move from on that turn/make amphibious assaults if you will (normal operation)
A freighter/liberty ship type unit - it moves more spaces per turn (to rapidly cover the Atlantic), but every unit aboard has its movement points reduced to 0 if it is aboard. (So this unit could carry supplies across the Atlantic, but would need to find its way to a friendly port to discharge units--they could not simply walk off of it and onto land as in the normal operation).

Does the code currently support this and if not would it be possible to add this? It seems insignificant but this is another one of those seemingly tiny things that would solve a huge problem in the game.

Even better would be if the units in question on the freighter can't discharge unless they are in a city with a certain improvement (in this case, a 'port'). This would make cities like Antwerp go from being "just another city" to being a KEY strategic city.

Thank you!
 
Release 0.15:
  • Added the Activate unit scrollbar patch.
  • Added two new options to the Reporting options patch.
  • Tons of new ways of interacting with the game from Lua. Some highlights:
    • The game's rules can now be modified on the fly, cosmic variables, unit types, improvements, techs, etc. These changes are ephemeral though, and it is up to the scenario designer to persist these changes and restore them on load;
    • New triggers for unit activation, city creation, combat resolution (still a work in progress), and for interacting with the city build list;
    • A dialog API to allow the player to select (an) option(s) and return the result to Lua;
    • A function to replace terrain graphics;
    • And many more.
    I will be updating the Lua reference thread with all the details.
  • The user can now opt to trust specific Lua event files during loading, removing the warning dialog when this file is loaded in the future.
As always, detailed information about the patches is available in the launcher. For an overview of all patches, as well as installation instructions & requirements, see the included README.txt. Happy gaming! :)
 

Attachments

  • TOTPPv015.zip
    367.3 KB · Views: 215
Editing as there isn't a bug I just messed up.
 
Last edited:
Editing as there isn't a bug, I just messed up.
 

Attachments

  • TOTTEST.sav
    94.5 KB · Views: 124
Last edited:
Ground units cannot attack the bomber, stealth fighter, or stealth bomber but they CAN attack the fighter unit. Attached is a save demonstrating this.

I'm pretty sure that is normal. A quick test in MGE tells me a cannon can attack a fighter that is placed out in the open.
 
Nevermind... Change the range of the units to 2 rather than 1 and they can't be attacked. I'm an idiot :)
 
Last edited:
Thanks for the new update, TNO!

PS
Just wondering, is there any way to add perma-alliances between civs that cannot be cancelled in-game?

I'd have to do some research into this. It should be possible in principle, even though the AI is notoriously belligerent.
 
@Grishnach was able to implement your system for tying unit production to the presence of certain city improvements. I've included a short video showing it off in Caesar's Gallic Wars thread here

I'm one happy camper :)
 
Hi all,

For those who may be interested, I've updated the LUA Reference Library pdf file to include TNO's latest changes found on his "[TOTPP] Lua function reference" thread found here. There have been many additions to the library since the last publication.

I've also updated the "Test of Time Patch Project" reference guide pdf to include the changes up to v0.15. The changes to the pdf, in this case, are more minor with a new feature added (#23. Unit Selection Scroll bar) and some additions to #68. Reporting options. Of note, TNO's has also reportedly fixed the #61. Attacks Per Turn feature, as part of the previous v0.143 release.

You can access both the TOTPP v015 and Lua Reference Library v2 PDF's on the "Scenario Creation Excel Sheet" thread located here.
 
Each unit, regardless of type, has it's own individual number. Could ToTPP enable us to use Lua (or traditional events for that matter) to use this as a trigger for an event? For example, destroying a specific infantry unit triggers some event, whereas destroying an identical, but different unit does not. That would allow using the same type of unit a number of times as individual triggers, instead of having to use multiple unit slots for multiple triggers.
 
Top Bottom