Musketeer/ Knight slot

Prof. Garfield

Deity
Supporter
Joined
Mar 6, 2004
Messages
4,008
Location
Ontario
Here's my first attempt at the 'copy game' script. Your destination game should be able to contain the entire source game. The destination map should be at least as large as the source map, and the destination game should have at least as many maps as the source game. (If you want to be able to cut off part of the source, let me know, and I'll make the adjustments.)

Extract this script, and place it somewhere convenient. Load your source game, open the Lua Console, and use the Load Script button to run copyGamePieces.lua. Select 'yes' for the text box. A message will be written to the console when the script finishes running. Something like:
Code:
Game data written to C:\Test of Time\1637823026pasteGameData.lua
The file will be written to your main Test of Time directory. The prefix number is derived from the current time, to minimise the chance of accidentally overwriting a file.

Next, load your destination game. Save a backup. Open the console, and Load Script the file that was just created. This message should appear in the console:
Code:
To paste the game data saved in this file into your new game, run the command
placeData(topLeftTileDestinationX,topLeftTileDestinationY)
The topLeftTileDestination is the tile where the (0,0) tile of your original game should go.
So, if you want the (0,0) tile of your original game to be on the tile (20,10), type this command into the console:
palceData(20,10)
Note: transporters are replaced by pollution, since Lua can't place transporters.

Choose the tile where the top left corner of the old map should go, and write down the coordinates. For example, (25,15). Then, type
Code:
placeData(25,15)
into the command bar beside the load script button.

Press Enter, and the game should be changed to have all the data copied into the new game. The starting year can't be copied, but a message will appear telling you the number to set the cheat menu to. If your scenario has transporters, you'll have to put them in manually as well.

If the script runs successfully, you'll get a message like this printed to the console:
Code:
The starting year for this scenario is 0
Everything Placed

Let me know if something goes wrong. This seems to work, but I've only tested on a relatively simple saved game, so there might be errors that didn't get caught. Feel free to send me the source and destination files if you have trouble (this is actually preferred, since it will be easier for me to diagnose and fix). Also let me know if you need any additional functionality (e.g. you want to renumber the landmasses).

EDIT: Updated script to require the player to enable custom resources for each map before pasting data. The previous version of the script simply enabled it automatically, but it turns out that command has a bug at this time.
 

Attachments

  • copyGamePieces.lua.zip
    5.4 KB · Views: 25
Last edited:

Tanelorn

Deity
Joined
Oct 5, 2002
Messages
2,157
Location
Athens, Greece
Note to self, city sizes:
1 - 10,000
2 - 30,000
3 - 60,000
4 - 90,000
5 - 150,000
6 - 210,000
7 - 280,000
8 - 360,000
9 - 450,000
10 - 550,000
11 - 660,000
12 - 780,000
13 - 910,000
14 - 1,050,000
15 - 1,200,000
16 - 1,360,000
17 - 1,530,000
18 - 1,710,000
19 - 1,900,000
20 - 2,100,000
21 - 2,310,000
22 - 2,530,000
23 - 2,760,000
24 - 3,000,000
25 - 3,250,000
26 - 3,510,000
27 - 3,780,000
28 - 4,060,000
29 - 4,350,000
30 - 4,650,000
31 - 4,960,000
32 - 5,280,000
33 - 5,610,000
34 - 5,950,000
35 - 6,300,000
36 - 6,660,000
37 - 7,030,000
38 - 7,410,000
39 - 7,800,000
40 - 8,200,000
41 - 8,610,000
42 - 9,030,000
43 - 9,460,000
44 - 9,900,000
45 - 10,350,000
46 - 10,810,000
47 - 11,280,000
48 - 11,760,000
49 - 12,250,000
50 - 12,750,000
51 - 13,260,000
52 - 13,780,000
53 - 14,310,000
54 - 14,850,000
55 - 15,400,000
56 - 15,960,000
57 - 16,530,000
58 - 17,110,000
59 - 17,700,000
60 - 18,300,000
61 - 18,900,000
62 - 19,530,000
63 - 20,160,000
64 - 20,800,000
65 - 21,450,000
66 - 22,110,000
67 - 22,780,000
68 - 23,460,000
69 - 24,150,000
70 - 24,850,000
71 - 25,560,000
72 - 26,280,000
73 - 27,010,000
74 - 27,750,000
75 - 28,500,000
76 - 29,260,000
77 - 30,030,000
78 - 30,810,000
79 - 31,600,000
80 - 32,400,000
81 - 33,210,000
82 - 34,030,000
83 - 34,860,000
84 - 35,700,000
85 - 36,550,000
86 - 37,410,000
87 - 38,280,000
88 - 39,160,000
89 - 40,050,000
90 - 40,950,000
91 - 41,860,000
92 - 42,780,000
93 - 43,710,000
94 - 44,650,000
95 - 45,600,000
96 - 46,560,000
97 - 47,530,000
98 - 48,510,000
99 - 49,500,000
100 - 50,500,000
Flags
 
Last edited:

Tanelorn

Deity
Joined
Oct 5, 2002
Messages
2,157
Location
Athens, Greece
Question. Is there a (Lua) way to remove all stackable terrain (airfields) from an old scenario, other than one by one, by hand?
 

Prof. Garfield

Deity
Supporter
Joined
Mar 6, 2004
Messages
4,008
Location
Ontario
Question. Is there a (Lua) way to remove all stackable terrain (airfields) from an old scenario, other than one by one, by hand?

You can enable debug scripts in the TOTPP Launcher, then use CTRL+SHIFT+F1 to open a menu to remove fortresses/airbases.
 
Top Bottom