Imperialism 3 - Now with 100% more Lua!

Tested out the barb (and my own unit) with the terrain/unit immunity code, and it doesn't seem to be kicking in...
Although, there is a very likely chance I am doing something wrong...I post the code here as it is for inspection.

Code:
local onTurn = {}

local desertTerrain = 0
local glacierTerrain = 7
local jungleTerrain = 9

local object = require("object")
local desertImmune = {}
desertImmune[object.uTribalRaiders.id] = true
desertImmune[object.uArabRaiders.id] = true
desertImmune[object.uTribalCavalry.id] = true
desertImmune[object.uBerberCavalry.id] = true
desertImmune[object.uMuslimCavalry.id] = true
desertImmune[object.uWarParty.id] = true

function onTurn.onTurn(turn)
    for unit in civ.iterateUnits() do
        if unit.location.terrainType % 16 == desertTerrain then
            local newDamage = math.floor(unit.hitpoints/4)
        if not desertImmune[unit.type.id] then
                unit.damage = math.min(unit.type.hitpoints-1,unit.damage+newDamage)
            end
    end   
        if unit.location.terrainType % 16 == jungleTerrain then
            local newDamage = math.floor(unit.hitpoints/3)
                unit.damage = math.min(unit.type.hitpoints-1,unit.damage+newDamage)
    end
    if unit.location.terrainType % 16 == glacierTerrain then
            local newDamage = math.floor(unit.hitpoints/2)
                unit.damage = math.min(unit.type.hitpoints-1,unit.damage+newDamage)
    end
        end
end
return onTurn
 
Update...The code now seems to be working...These riders have been out in the hot sands, and seem to be fine. The Berbers seem to be doing fine too.
HotBarbs1.png

Perhaps it was one of those "restart CIV2" situations, like SPR files, that won't work until the prog is shut down and started once more...

It could also be the healing state of the units catching up with the damage, which is fine as well.
 
Another update, with the now (hopefully) working "perilous terrain" Lua add-on. Barbs are back to full power. Get your maxims loaded!

Go into the "LuaTriggerEvents" folder, and then the "UniversalTriggerEvents" folder - Unzip here.

Just over-write the existing file.
 

Attachments

  • onTurn.zip
    533 bytes · Views: 33
OK, tested it. When I used the "over-ride SPR" option in @UNITS_ADVANCED, it voids the tribe colour SPR I am using for generic units.
Except for the worker and engineer units, who need the SPR over-ridden to show the SPR colours, which doesn't make sense to me...
I am guessing this is what @miccal2000 is seeing. There should be a file called "Static.spr" in his Imperialism III folder...Can he report if he has it?

Attached, and recommended to drop into the Imperialism III folder.

I downloaded the file and put it in the folder.

The units are OK, as I went into the rules.txt and edited it the hard way.

Still getting the moving sprites on resources, though.
 
Dumb question...how do i do that?
When I go into graphics options, it is greyed out.

Thanks!

Open the cheat mode, select "scenario parameters", and then select "edit special rules." Select "Terrain Animation Lockout" and "Unit animation lockout", so that they are both set to 0 instead of 1. This should make those options available again. If it works, Curt should probably change those for the next release.
 
specrules1.png

Editing the special rules is among the first tasks I do when making a scenario, as no-one on Earth wants to see the vanilla ToT GFX.

Myself and TooTall have not got this problem, as you can see from the above screenshot...And all the other screenshots.

So I am not sure what is going on with Miccal's ToT.

Can he provide a screenshot of his Imperialism folder contents, please?
 
View attachment 592013
Editing the special rules is among the first tasks I do when making a scenario, as no-one on Earth wants to see the vanilla ToT GFX.

Myself and TooTall have not got this problem, as you can see from the above screenshot...And all the other screenshots.

So I am not sure what is going on with Miccal's ToT.

Can he provide a screenshot of his Imperialism folder contents, please?
I'll go ahead and try these things this evening after work.

Thanks!
 
No probs, @miccal2000 , Hopefully we can get you sorted out.

I will be posting a major new update (all going well) today. It most likely will need a new playthrough.
Includes new rules, GFX, and Lua edits.
 
No probs, @miccal2000 , Hopefully we can get you sorted out.

I will be posting a major new update (all going well) today. It most likely will need a new playthrough.
Includes new rules, GFX, and Lua edits.

Yes, with all the important new changes you seemed to be implementing in the background I was starting to wonder if it made sense to continue with my current playthrough.

Just a few quick recommendations and questions:
  • Add the Barbarian Tartar Cavalry to the immune table. There are important sized deserts in Central Asia and the Gobi desert that tend to decimate these units before they could assault Russian positions.
  • Perhaps increase the Russian Elite Regiment cost once more from 100 to 120 shields (as it's becoming a little too easy to produce them in larger quantities then you originally intended).
  • Since I haven't gotten to play a full scenario, my current research rate has dropped to one tech per 19 turns, I'm a little hesitant about making this recommendation but perhaps consider reducing the tech paradigm at least to 300/10?
  • I'm a little unsure, as I received the Industrialization tech, it seems I can only build Factories in cities that have the Grand Rail Station improvement in them. Is this a lua based or simply part of the base requirements?

I can confirm I haven't experienced any issues with regards the sprites misbehaving.
 
Thanks for the feedback, my good sir!

Add the Barbarian Tartar Cavalry to the immune table. There are important sized deserts in Central Asia and the Gobi desert that tend to decimate these units before they could assault Russian positions.

Excellent idea - I shall add this to my to-do list.

Perhaps increase the Russian Elite Regiment cost once more from 100 to 120 shields (as it's becoming a little too easy to produce them in larger quantities then you originally intended).

I'll take a look at the costs of the other Russian units, and bring it into line with it's power. I might even reduce the Elite Regt stats too. I'll see what can be done. :)

Since I haven't gotten to play a full scenario, my current research rate has dropped to one tech per 19 turns, I'm a little hesitant about making this recommendation but perhaps consider reducing the tech paradigm at least to 300/10?

In my game, I have airships operational in 1890...And one tech away from 1914-era planes. Britain is close behind me. So I was thinking of increasing the tech barrier to make research slower.

Do you think things are too challenging? We could perhaps try some other civ with the update before making this big change?

I'm a little unsure, as I received the Industrialization tech, it seems I can only build Factories in cities that have the Grand Rail Station improvement in them. Is this a lua based or simply part of the base requirements?

Yep. Factories need both a Bank and the Grand Rail Yard in order to be buildable.

I can confirm I haven't experienced any issues with regards the sprites misbehaving.

Glad to hear it. I am hoping someone else can DL and let us know if they have the same issue.
 
Thanks for the feedback, my good sir!
In my game, I have airships operational in 1890...And one tech away from 1914-era planes. Britain is close behind me. So I was thinking of increasing the tech barrier to make research slower.

Do you think things are too challenging? We could perhaps try some other civ with the update before making this big change?

Like I indicated, I was a little hesitant about this recommendation because I haven't been able to play a full game. I might have been influenced also by the fact that Russia starts as the most backward scientifically in this scenario so my point of view might have been somewhat skewed in that regard.

If you prefer to wait to see more results I'm okay with that.
 
I'll take a look at the costs of the other Russian units, and bring it into line with it's power. I might even reduce the Elite Regt stats too. I'll see what can be done. :)

Sorry for the back and forth on this one. Perhaps a simpler option is just to bring it back to your original design where you limited it's building to a few specific cities?
 
Sorry for the back and forth on this one. Perhaps a simpler option is just to bring it back to your original design where you limited it's building to a few specific cities?
Yeah, it might be the best way. Only the big imperial towns in the heartland, with strong military traditions.
 
New Imperialism update! Onwards into the cannon fire!
Pruss1.png

Many new features added, these include:
-------------------------------------------------------------------------------------------------------------------------------------------------
Updated tech tree - More logical progress towards modern naval, air and land weapons.

New Lua features, dangerous terrain, colonial limits on units/improvements/wonders all in place and working.

New units: Generals! All civs now have commander units to lead your campaigns.

New units: Japan can now build Imperial Armies, and upgrade them with National Infantry.

New unit: Guerrillas. With Guerrilla Warfare, whoever controls the Mexican cities can build tough Guerrillas.

New unit: Polish Lancers. Whoever owns the Polish cities can call upon elite Polish cavalry units.

New unit: Turk Cannon. The firepower of the Ottomans can be brought under your command if you rule Anatolia.
-------------------------------------------------------------------------------------------------------------------------------------------------
A new playthrough is required. ToTPP 15.1 with Lua required.

To keep it simple - Create a fresh Imperialism V5 folder in CIV2 ToT.
Extract all files this, and create a Sound Folder for the wavs.

Please log any bugs or feedback here.
 

Attachments

  • Imp3 V5.zip
    1.8 MB · Views: 35
  • Imp3 V5 Sound.zip
    5.6 MB · Views: 30
Here are the new units...
V5NewUnits.png

Imperial Army
Imperial Army II
Polish Lancers
Turk Cannon
Prussian General
Marshal
Tsarist General
Imperial General
Guerrillas
 
Curt, thank you very much for the update. :) I was able to start the new version without any problems and without any graphical issues. The only very small graphical glitch is the cursor control light in the middle of the date.

Cursor Control light.jpg

I will try a game with the new files as soon as I have the time for it. All is looking very interesting! :)
 
Ah, yes. That glitch is a ToTPP thing, and nothing I can change.
If you have the unit/city counter on, it moves the text to collide with the science status icon.
 
Top Bottom