The Spanish Civil War v4 for ToT + ToTPP + Lua - Development Thread [ON HOLD]

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
I'm having so much fun with all the standard Civ graphics that I decided to go a step further and start messing with the DLL files. Prior to this, I have been enhancing the batch file to cater for backups and messing with the main game directory files. The batch will kick off Civ2 automatically and then restore the original files once done playing with no manual intervention needed :)

1660652040467.png

Once you exit the game:
1660652074338.png

If you run this for the first time, the backup of the original DLL files is taken automatically:
1660652218049.png
 
Last edited:

Dadais

King
Joined
Oct 20, 2010
Messages
760
Location
France
Haha there's no end to the joy of creation the fantastic material today's ToTpp* is providing us !

*TheNamelessOne, but also all others like Fairline, Tanelorn, catfish with graphics, Profgarfield with Lua, knighttime, Jpetrovski, Tootall-2012, blake00 for pioneering these design opportunities, and everybody including you for this new emulation !
 
Last edited:

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
Haha there's no end to the joy of creation the fantastic material today's ToTpp* is providing us !

*TheNamelessOne, but also all others like Fairline, Tanelorn, catfish with graphics, Profgarfield with Lua, knighttime, Jpetrovski, Tootall-2012, blake00 for pioneering these design opportunities, and everybody including you for this new emulation !

Definitely! Cheers to them! :hatsoff::bowdown::worship:
 

Knighttime

Prince
Joined
Sep 20, 2002
Messages
364
I'm having so much fun with all the standard Civ graphics that I decided to go a step further and start messing with the DLL files. Prior to this, I have been enhancing the batch file to cater for backups and messing with the main game directory files. The batch will kick off Civ2 automatically and then restore the original files once done playing with no manual intervention needed :)

Once you exit the game:

If you run this for the first time, the backup of the original DLL files is taken automatically:
This type of batch file system is what I used in Medieval Millennium, which was written when TOTPP 0.15.1 was the latest release. (Yours actually goes a step further, to swap files and put them back in a single script -- I had two scripts, one to install my mod and another to uninstall it.)

But as of TOTPP 0.16, this is no longer necessary. You can place updated .dll files in your scenario directory, without touching the ones in the game's main directory at all. Scenarios (and mods) will now look there first, and use any .dll file found there instead of the base version.
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
This type of batch file system is what I used in Medieval Millennium, which was written when TOTPP 0.15.1 was the latest release. (Yours actually goes a step further, to swap files and put them back in a single script -- I had two scripts, one to install my mod and another to uninstall it.)
Yes my idea is that players directly kick off the batch file, and it automatically sets up the files and executes the game. Once civ2 is closed, it automatically restores back any "common" overwritten files in the root folder. I actually have a shortcut to the batch file in my desktop and it really speeds things up to run the scenario :)
I need to try your Medieval Millennium mod out. I have so much catch up to do on regards of the latest Civ modpacks/scenarios...shame on me :hammer2:
But as of TOTPP 0.16, this is no longer necessary. You can place updated .dll files in your scenario directory, without touching the ones in the game's main directory at all. Scenarios (and mods) will now look there first, and use any .dll file found there instead of the base version.
I didn't know! Thanks for that. Anyway I'll leave it like this for now as I'm having some crazy ideas I want to implement and see if they work...

Thanks again for your insights
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
And the DLL files work! Still not convinced with the radio buttons, but it's getting there :) I have loads of work ahead but this is the most rewarding part.

Screenshot of "we love the king" for the Nationalist side:

View attachment 636856
Now I am entirely happy with the radio buttons and check boxes as they follow the same pattern as the normal buttons. Styles for both sides using @Fairline 's amazing shields in the check boxes :)

1660686620250.png

1660686724583.png


1660687839655.png

1660688000819.png

What do you think? Any feedback is appreciated!

Thanks,
Pablo
 
Joined
Feb 11, 2012
Messages
831
For my part, I have to say I’m highly impressed by the level of care and detail you are putting into your project. It is shaping up to be quite a scenario!

All the graphics you have shared so far are looking great!
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
For my part, I have to say I’m highly impressed by the level of care and detail you are putting into your project. It is shaping up to be quite a scenario!

All the graphics you have shared so far are looking great!
Thank you!

1660693701149.png
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
I'm currently reworking my terrain and icon files using Mercator's smooth tile shapes, they look much easier to work with!

Link: http://civ2.mercator.fastmail.fm.user.fm/reference/tile_metrics.html
Done, now the political map looks much better thanks to the improved coastline. Also now that I'm getting better at it I improved the big icons and used smoother textures and transitions :)
1660840699217.png


1660840734556.png

1660840761767.png


Please note this is not imported into the scenario yet, therefore it doesn't have the TOTPP landmarks with the city names, the previous screenshot was just a PoC.

Pablo
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
This morning I did a full revamp on the Title.gif files, inspired on the classic ones I did 20 years ago, and I also experimented with the common user interface, I really like how it looks :)

Main menu (Republican)

1661011629438.png


New Scenario Title (Republican)
1661011717286.png


Main menu (Nationalist)
1661011826425.png


New Scenario Title (Nationalist)
1661011884714.png


Hope you like it!

Pablo
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
I believe in the end I'll start a new fantasy/sci-game from scratch and import all my data using ProfGarfield's script, my game didn't like these "on the fly" map imports :)
So today I was able to do this by starting a new Fantasy game and selecting my custom maps. It took some effort but finally I have managed to have a .scn file with my 4 maps and all the map 1 city/unit placement perfectly integrated without my cities disappearing after the import, so big thanks again to @Prof. Garfield for his copyGamePieces.lua script which is available here. That saved me the need to start again from scratch in order to have the additional maps :)

BTW, I haven't finished placing the initial units on scenario start (I currently placed only air, naval, the Army of Africa and some city garrisons) or finished tweaking the 4 maps and the remaining graphics, but I can't wait to get my hands dirty with Lua so I'll start with some basic event functionality as soon as I have the chance.
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
In-game, each time a city is captured or a unit moves successfully to another tile, the terrain in the same coordinates in the political map will be changing accordingly, as well as certain terrain surronding the city to avoid "gaps". Lua will allow me to handle this so the political map will be always up to date.
I'm loving Lua (and ProfGarfield's template) so far, with just a few lines of code I've built the basic Political Map functionality in the onEnterTile(unit,previousTile) routine, and works perfectly fine, I see the political map being updated real time as units move :):

Code:
    -- Change Political Map (map 1) - Only for units where domain = 0 (Ground)
    if unit.owner == object.pNationalistSpanish and unit.type.domain == 0 then   
        civ.getTile(unit.location.x,unit.location.y,1).baseTerrain = object.bNationalistSpain
    elseif unit.owner == object.pRepublicanSpanish and unit.type.domain == 0 then
        civ.getTile(unit.location.x,unit.location.y,1).baseTerrain = object.bRepublicanSpain   
    end

Now I need to enhance the functionality for when cities are captured, and deal with gaps in between areas, but it's really cool!!
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
Another Lua breakthrough: the enemy advances and attacks against the human player are getting tracked correctly on the Strategic map. Please note this map is not finished, but the below screenshots give a small heads up on what to expect:

In the Standard Map, the Nationalists have bombed several republican cities (Carmona, Ronda and Marbella):

1661435646056.png

The attacks get logged in the Strategic map (red squares). Please note this map is unfinished and is missing stuff:
1661435732230.png


Detail on the status on one of these cities in the Strategic Map:
1661435785460.png

BTW, this also tracks naval attacks and air attacks on ships :) In this provoked scenario, the AI controlled Republican Navy has intercepted the Human Player Nationalist convoys across the Strait of Gibraltar:

1) Standard Map:
1661437263534.png

2) Strategic Map:
1661437302663.png

1661437509293.png



On the Strategic Map I'm also tracking when the AI enemy breaks through the Human Player's own territory. In this example, I let the AI defenders of the "Virgen de la Cabeza" sanctuary to roam free on Republican Spanish controlled territory

1) Standard Map:
1661435917997.png

2) Political map tracks the movement of these troops:
1661435973779.png

3) Strategic map (please note this area is unfinished so it lacks many points of interests and landmarks).
The movement is only tracked when the tile actually changes "owner", therefore the sanctuary itself doesn't appear as an enemy offensive square
1661436013055.png

Detail of one of these squares:
1661436487844.png



Given the enemy advances/attacks is only to be featured in the Strategic Map for the last turn (to allow the human player to react to the latest enemy progress), these special tiles get cleared on every turn (this text is only there for debugging purposes):

I hope you all like this feature and start implementing in your own scenarios! :)

Regards,

Pablo
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
Of course, I can have a combination of both (offensives and attacks).

In this scenario, I let the AI controlled Nationalists to attack and expand freely against the Republican Human Player:

1) Before the AI turn:

1661438057584.png

1661438084010.png

1661438118591.png


2) After the AI moves:

1661438857755.png

1661438878846.png

1661438916386.png

A "combined" tile:
1661438938586.png

That's all for now, I guess now I need to dedicate multiple hours to finish these maps before moving on with Lua!

Pablo
 

Pablostuka

King
Joined
Mar 27, 2002
Messages
803
Location
Galway, IRL
Hi all,

So in the last days I've playing around with another new concept I want to implement for this scenario: a comprehensive espionage lua module. For this, I have put into use the always forgotten Future Technology tech, as Lua can deal with it and do its magic.

In my scenario, as a general rule civilization advances/technologies are considered decisions which the human player take. One decision then can lead to another decision and so on (that's what the Tech Tree defines). The Future Technology tech is seen here as the funding of the intelligence agencies. Every time the human player decides to provide funding to the intelligence agency (a.k.a. researching future technology), then onTurn a new espionage.lua module is invoked to perform random espionage actions against the enemy.

So far I have only coded the ability to provide the location of enemy ships, but I plan to implement to also be able to provide the location of specific enemy generals, build-up of enemy troops, get enemy cities investigated (like the classic civ Spy), get the "check intelligence" screen (open a temporary embassy with the enemy), etc. The possibilities are endless!

See how the "spy the enemy Navy" feature works in game with the below PoC test.

The decision is taken (FT tech is researched). Level 1 is because it's the FT 1, so it means it's the first time FT is researched. Please don't mind the tech icons as these are temporary from my old MGE scenario...

1661867608145.png


1661870820402.png


On the next turn, the new espionage.lua module is invoked. I wanted to mimic the old macro "RECEIVEDTECHNOLOGY" behaviour so the action happens on the turn after the techs are researched. Some nice Lua code will spy on the enemy as many times as how many levels of FT were researched on the previous turn, as my scenario allows multiple decisions (discoveries) per turn!

On the first time we decide to fund the intelligence agency, we get an extra text telling it's set up (text is provisional). Each tribe have their own intelligence agency name.

1661868744293.png


The random espionage action for now it's always "investigate navy" as it's the only feature I've coded. Then the Lua code will check a parameter table of navy ships with all their details. As I said in a previous post, I'm playing with the unit IDs to represent different ships of the same class (unit type) . See how the parameter table looks for this PoC (it needs to include many more ships, but to prove the code works it's just enough). I might even include additional fields, like the captain name, we'll see :)

1661879131850.png


Lua will randomly choose a ship from the parameter table, and provide a detailed report about it, including nearest city and distance (functionality sourced from @Prof. Garfield 's LST helpkey.lua module).

For ships inside a city it tells you where the ship is currently docked:

1661875825717.png


For ships on sea, it will tell you the closest city and distance (that's the helpkey functionality):

1661878740413.png


Of course this works for the Republican player too :)

1661880285698.png

1661880483708.png


I might include extra stuff and need to polish a bug on the city names i get (don't seem correct). I also need to see if there's any way to be able to use the letter ñ and "accents" in the text module to write names in Spanish properly...

That's all, I hope you like this new feature!

Regards,

Pablo
 

Dadais

King
Joined
Oct 20, 2010
Messages
760
Location
France
Hi all,

So in the last days I've playing around with another new concept I want to implement for this scenario: a comprehensive espionage lua module. For this, I have put into use the always forgotten Future Technology tech, as Lua can deal with it and do its magic.

In my scenario, as a general rule civilization advances/technologies are considered decisions which the human player take. One decision then can lead to another decision and so on (that's what the Tech Tree defines). The Future Technology tech is seen here as the funding of the intelligence agencies. Every time the human player decides to provide funding to the intelligence agency (a.k.a. researching future technology), then onTurn a new espionage.lua module is invoked to perform random espionage actions against the enemy.

So far I have only coded the ability to provide the location of enemy ships, but I plan to implement to also be able to provide the location of specific enemy generals, build-up of enemy troops, get enemy cities investigated (like the classic civ Spy), get the "check intelligence" screen (open a temporary embassy with the enemy), etc. The possibilities are endless!

See how the "spy the enemy Navy" feature works in game with the below PoC test.

The decision is taken (FT tech is researched). Level 1 is because it's the FT 1, so it means it's the first time FT is researched. Please don't mind the tech icons as these are temporary from my old MGE scenario...

View attachment 637977

View attachment 637983

On the next turn, the new espionage.lua module is invoked. I wanted to mimic the old macro "RECEIVEDTECHNOLOGY" behaviour so the action happens on the turn after the techs are researched. Some nice Lua code will spy on the enemy as many times as how many levels of FT were researched on the previous turn, as my scenario allows multiple decisions (discoveries) per turn!

On the first time we decide to fund the intelligence agency, we get an extra text telling it's set up (text is provisional). Each tribe have their own intelligence agency name.

View attachment 637980

The random espionage action for now it's always "investigate navy" as it's the only feature I've coded. Then the Lua code will check a parameter table of navy ships with all their details. As I said in a previous post, I'm playing with the unit IDs to represent different ships of the same class (unit type) . See how the parameter table looks for this PoC (it needs to include many more ships, but to prove the code works it's just enough). I might even include additional fields, like the captain name, we'll see :)

View attachment 637992

Lua will randomly choose a ship from the parameter table, and provide a detailed report about it, including nearest city and distance (functionality sourced from @Prof. Garfield 's LST helpkey.lua module).

For ships inside a city it tells you where the ship is currently docked:

View attachment 637985

For ships on sea, it will tell you the closest city and distance (that's the helpkey functionality):

View attachment 637991

Of course this works for the Republican player too :)

View attachment 637994
View attachment 637996

I might include extra stuff and need to polish a bug on the city names i get (don't seem correct). I also need to see if there's any way to be able to use the letter ñ and "accents" in the text module to write names in Spanish properly...

That's all, I hope you like this new feature!

Regards,

Pablo
That's great !

You can this way make the spyed unit "visible" by the spying tribe too ;).
Could be great with random (yet unseen) land units too !
Are you gonna take tech back once used (like I did in the tes scenario) or will one reveal more and more as turns are going forward ?

Definitly an Idea i'll implement someday someway in some scenarii ! Well thought !
 
Top Bottom