Musketeer/ Knight slot

Is this line? Looks empty...

No, we're looking for byte 686 (in decimal number notation), and it is a single byte. I cut and pasted from the spreadsheet (I expected you to refer to it directly, actually). The 1 was from a different box, saying that the data is 1 byte in size.

Since it looks like your hex editor shows offsets in hexidecimal, search for offset 2AE.

Sorry for the confusion.
 
I got my laptob back after a bios update mishap, and now though I have the original backed up files in my drive the game refuses to run. I get an 0xc0000022 error, meaning either corrupt or missing files...
I tried both mounting and burning the image but it stops after pressing the install button. I also tried running setup as admin, still no go. If I can find the original 1999 CD I seriously doubt it would play otherwise. Any suggestions?
Probably a permissions issue?
 
Last edited:
So did you copy your entire TOT folder (everything in it) and that won't run now? Or are you trying to run the installer?
 
I tried both. And I found out the backed up files do have a different (the old one?) owner name listed in permissions. I will find a way.
 
Question:
Can Lua be used to load a different rules.txt file?

Not directly (that is, not with something like civ.ui.loadTerrain(map, filename1, filename2) . However, with TOTPP 16, we can change most of the rules with individual function calls.

@tootall_2012 asked about this a short time ago in the TOTPP thread, so this is something that seems somewhat desirable. I think I might be able to do build a function that reads a rules file and makes the necessary conversions.
 
Thanks.
Another useful feature I always wanted was multiple buildable or available Da Vinci lab wonders, to make use of the upgrade mechanic by multiple/all civs...
Everything looks possible with ToTPP/ Lua, maybe someone has already thought of it.
 
Last edited:
Thanks.
Another useful feature I always wanted was multiple buildable or available Da Vinci lab wonders, to make use of the upgrade mechanic by multiple/all civs...
Everything looks possible with ToTPP/ Lua, maybe someone has already thought of it.

One option would be to periodically move Leonardo's Workshop to cities owned by different tribes. For example, during an afterProduction event, you could move Leo's to the capital of the next tribe in line, so they can have it when they research a new technology.

Another option is to have an event periodically check all the units in the game, and replace obsolete units with upgraded versions. We now have access to the turnsAloft/CaravanCommodity/settlerWorkPerformed field with TOTPP, so replacing units works even better than before.
 
So, we could basically swap out one unit type with another during play? Across the map? :cool:

I know Lua promotion works like this, but I didn't know it could do swaps en-masse?

Sure. You can use civ.iterateUnits() to create a loop over all the units in the game.

Code:
for unit in civ.iterateUnits() do
    -- check if the 'unit' should have something done to it
    -- if so, do that thing to 'unit'
end

There might be an issue here with replacement units either being included in the loop, or not included (I'm not sure what would happen). It would be best to make sure that any newly created units won't also qualify for replacement, and to run a similar loop a second time if replacement units must also be replaced in turn.

You can use loops like this during the scenario building process as well, to automate things. I think, for example, that in A Soaring Spirit I gave all barb cities courthouses via a script (looping with civ.iterateCities) rather than manually going through each city to make the change. In Over the Reich, a script gave all the targets veteran status, since that wasn't done during placement.

On limitation of Leonardo's Workshop, is that units have to be buildable to be upgraded to another buildable unit. In some scenarios (mine in particular) most units are not buildable. If you can work around that limitation, it would be helpful.

If you want to use Leo's (rather than a custom check and replace script), you can make the unit builable 'theoretically' (i.e. based on the standard Civ II rules), but use canBuildSettings to prevent construction. I happen to have a 'returnFalse' parameter that you can use for that purpose in the existing version of canBuild. The downside of this is that the civlopedia would make the player think the unit could be built.
 
Very useful, thank you all.
Just a small tidbit: on the year counter, can I change the word ΄year΄ to say ΄week΄?
 
Very useful, thank you all.
Just a small tidbit: on the year counter, can I change the word ΄year΄ to say ΄week΄?

Do you mean in the status window? If I understand what you're asking, I'm pretty sure you open labels.txt and change the line A.D. to Week, or whatever. Someone else may know better.
 
A.D. That is exactly what I wanted! Thanks!
Can you believe I have quit making a scenario in the past because of this?
Reminder, ToTPP: Control 9 adds rivers.
 
Last edited:
Question. Can Lua be used to change the dimentions of a savegame map, i.e. stretch it? Without losing all the data, units cities etc. unlike Mapedit?
 
Question. Can Lua be used to change the dimentions of a savegame map, i.e. stretch it? Without losing all the data, units cities etc. unlike Mapedit?

Not directly.

However, what it can do is copy all the game data and generate a script file with that data. You can then run the generated file in a new saved game to place all the stuff just as it was in the original. This seems like something that could be useful, even if you don't end up needing it, so I'll start writing it.
 
Basically I want to stretch the map south to include Tobruk and Alexandria, but I dont want to start from scratch. It is not a deal breaker, as an afterthought it would be nice to have more Royal Navy convoys/ actions in the scenario.
 
Top Bottom