Editing Civ2 ToT technology tree

At some point if I continue having these issues I'll need to start from scratch, but I wanted to save me the pain of editing the map again (as I have new terrain types), tribes, city placement, roads, units, etc!!

This script should save you nearly all of that work.
 
This script should save you nearly all of that work.

Ok that was amazing, thank you so much. In that thread I also found some more answers to my issue and I also learnt how to move cities to other squares, as in my original file some cities are misplaced in the map. With that functionality I can also quickly change the terrain under a city tile by moving it somewhere else, change the terrain and move it back. That was simply awesome, thanks.

I will use your scripts and will let you know how it goes. I will also take the opportunity to expand my original map a bit more in the south to include more of Morocco.

Quick question before I try the transfer: will starting a brand new game in a new map, using new rules.txt file allow me to save the correct values in @CIVILIZE2 and @LEADERS2 (as I want to have tech tribe specific groups) in the savegame, and then transfer cities/units etc with your script? Or will that overwrite the stored values of the tech groups? I ask because I read that these values are hard coded internally and to properly reset this we need specific events to reset the group's properly if the change to the rules file is done after the scenario is started.

Thanks!
 
Quick question before I try the transfer: will starting a brand new game in a new map, using new rules.txt file allow me to save the correct values in @CIVILIZE2 and @LEADERS2 (as I want to have tech tribe specific groups) in the savegame, and then transfer cities/units etc with your script? Or will that overwrite the stored values of the tech groups? I ask because I read that these values are hard coded internally and to properly reset this we need specific events to reset the group's properly if the change to the rules file is done after the scenario is started.

I'm not completely sure I understand what you're asking (partly because I only have passing familiarity with the non-lua aspects of scenario design). But, I don't think Civilize2 or LEADERS2 will cause you problems.

From the Lua Function Reference:

group (get/set - ephemeral)
tech.group -> integer

Returns the group of the tech.

This means that changes made to the tech group (I believe this is the \@CIVILIZE2 data) doesn't persist between a save and load. So, the game will always read from \@CIVILIZE2.

I didn't find enableTechGroup in the script, so I didn't change \@LEADERS2 from what the game would read from the rules.

enableTechGroup
civ.enableTechGroup(tribe, techgroup, value) -> void

Sets the value of tech group `techgroup` (0-7) to value `value` (0-2, 0 = can research, can own, 1 = can't research, can own, 2 = can't research, can't own) for tribe `tribe`.

If it turns out a tech group is wrong, you just need to input this command in the console, and then save the game.

With that functionality I can also quickly change the terrain under a city tile by moving it somewhere else, change the terrain and love it back. That was simply awesome, thanks.

You can use the console to change terrain as well, probably easier than moving a city.
Code:
civ.getCurrentTile().terrainType = desiredTerrainIndex
If you're writing events, however, it is preferred to set either the 'terrain' or 'baseterrain' key instead. (You could do that in the console as well)
 
This is simply amazing. All I read everywhere is that if you change CIVILIZE2 and LEADERS2 once the savegame is already generated, you're screwed basically and need to create a new events file to set up everything accordingly again...this, or hex-edit:
But now I see that with Lua all the nuisance is gone, and one can edit on the fly with the console if anything's wrong. Simply amazing.

And thanks for the command to directly change terrain in any tile (including city).

Regards,

Pablo
 
This script should save you nearly all of that work.

You're my hero! It worked like a charm :)

2022-02-13 02_48_46-Civilization II_ Test of Time.png


And not only that...I can tweak the XXXXXpasteGameData.lua before importing to save me extra time with corrections :)

Thanks again!!
 
Nope, there's something wrong after the transfer. Apparently everything was fine, but once I saved the new game as a scenario, when I close Civ and then start to "begin scenario", the game enters in "infinite loop" mode. Civ2 doesn't crash, but doesn't respond either, just keeps thinking. This only happens when I save after the data transfer, if I don't save it looks good.

So I tried a second transfer having DebugView opened during the process but I didn't see any error message...the game just doesn't respond and doesn't load the title page.

I don't know if it has to do with the extra scenario parameters (no pollution, no tech by conquest) that the script doesn't include, but anyway i tried manually to have everything set up again and as soon as I save, if I load, Civ hangs...have you ever experienced this @Prof. Garfield ?

So what I will try when I have more time is to amend XXXXXpasteGameData.lua to remove different chunks of data. First try not to load units, save and see what happens, then terrains, cities, etc, until I locate the "offending" part that breaks it.

Thanks,

Pablo


.
 
I don't know if it has to do with the extra scenario parameters (no pollution, no tech by conquest) that the script doesn't include, but anyway i tried manually to have everything set up again and as soon as I save, if I load, Civ hangs...have you ever experienced this @Prof. Garfield ?

No one's reported that so far. If you send me the files, I'll have a look.

This is rather weird. This shouldn't cause any sort of infinite loop loading a game, since it is only changing game data (which could be changed via cheat menu), not introducing any code.

Maybe there's an issue with custom resources. Try enabling them before pasting the game (CTRL+F8). I don't have any other ideas at the moment.
 
Maybe there's an issue with custom resources. Try enabling them before pasting the game (CTRL+F8). I don't have any other ideas at the moment.

That was exactly it!! I enabled the custom resources, then transferred the game and saved as a scenario. When I started the scenario this time it worked fine and didn't crash.

I can't thank you enough, thanks to your script and help I have been able to start a fresh new game in an expanded map, with amended @CIVILIZE2 and @LEADERS2 settings (allowing me tribe specific techs), and with your script, correct the starting technologies of the tribes and also be able to do some small amendments.

I found a weird behaviour though, when I started the scenario I was able to discover 3!! technologies in a row in the same turn as soon as I loaded the game, I never saw that before in a Civ game, and none of them is Philosophy. But I'll do adjustments to the tech paradigm and see what happens, probably I messed up something. At least the weird effect of not saving the starting techs of a tribe which I originally reported in this thread, it's gone.

Many thanks again.

Regards,

Pablo
 
I found a weird behaviour though, when I started the scenario I was able to discover 3!! technologies in a row in the same turn as soon as I loaded the game, I never saw that before in a Civ game, and none of them is Philosophy. But I'll do adjustments to the tech paradigm and see what happens, probably I messed up something. At least the weird effect of not saving the starting techs of a tribe which I originally reported in this thread, it's gone.

Well not, to boast, just if you missed the message thus the point :
What capt my attention is the "Reinforcement in 1 turn", which would indicate the tech are simply searched in the "scenario" turn spent when we're saving one (following my maybe wrong comprehension).
Tech Paradigm 20 only divide per two the time spent to search techs, which is not that much when few techs are distributed.

Have you tried something like that with Lua (in the civ.scen.onKeyPress function) to check in your save game science costs and then compare with science output, as to adapt tech paradigm ?
Spoiler test code :
if keyCode == 49 then -- lowercase "1" (49) --test

for i=0, 7, 1 do
print (civ.getTribe(id).name .." tech cost : " civ.getTribe(id).researchCost )
end
end



To notice, when the game says "NewTech every 1 turn", it does only mean "the next tech will be reached in one turn", allowing to have multiple tech per turn if tech paradigm is low and science output high.

You may have a check at your tech paradigm validity by changing it in the rules section.
This will be overwritted by the .scen tech paradigm, yet will allow you to adjust it on your savegame before saving the scenario.

To notice, when the game says "NewTech every 1 turn", it does only mean "the next tech will be reached in one turn", allowing to have multiple tech per turn if tech paradigm is low and science output high.

Good thing you pointed out the source of your issue. :goodjob:
 
Sorry @Dadais I completely missed your post, it was a long night (until 5:30am) trying to fix the damn thing with the game transfer, the starting techs and the civilize2/leaders2 settings. I will have a deep look at your points and will let you know if I manage to fix these weird tech advances. Thanks!
 
No worry : less issues in creator's way means more wonderful scenarios !
Hi again, the research costs is quite balanced between both tribes, I ran the Lua commands you mentioned:

Nationalist Spanish - researchCost: 75
Republican Spanish - researchCost: 72

What would be in your experience, and given the above values, a good tech paradigm value (scen parameter in Rules.txt) to get one technology per turn? And for one tech every 2 turns? Or just I do trial & error and see?

I'm thinking in my scen I could dinamically adjust the tech paradigm by events (using the command civ.scen.params.techParadigm) as ideally I'd like to get more techs in the beginning and less through the end of the scenario, is that even possible to set up the parameters once a scenario is already started?

Thanks,

Pablo
 
What would be in your experience, and given the above values, a good tech paradigm value (scen parameter in Rules.txt) to get one technology per turn? And for one tech every 2 turns? Or just I do trial & error and see?

That's not an easy thing to work out. This thread looks like it aggregates the known information about how technology cost works. If you start off with few technologies, then each additional tech will make a pretty big jump in technology cost. Doubling the number of techs you have will roughly double your tech cost. Similarly, if you increase your science production as you progress through the game, it will take less time to research each tech.

If you want a constant tech rate, I would suggest using Lua to bestow (or take) beakers. The tribe object can tell you a tribe's science rate and research cost for example.
 
Back
Top Bottom