Musketeer/ Knight slot

Discussion in 'Civ2 - Scenario League' started by Tanelorn, Jan 27, 2020.

  1. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    3,607
    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).
     

    Attached Files:

    JPetroski and Tanelorn like this.
  2. Tanelorn

    Tanelorn Emperor

    Joined:
    Oct 5, 2002
    Messages:
    1,974
    Gender:
    Male
    Location:
    Athens, Greece
    Wow, thank you!
     
  3. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    3,902
    That is an Incredibly useful little script there.
     

Share This Page