I have been trying to re-work the Python code associated with my Golden Spike wonder to have it create a true transcontinental railroad (west to east across the building continent) instead of its current ability, which is upgrading all roads and paved roads to railroads. For now, I am doing it in four steps:
- Lay down railroads in every square directly west or east of the building city, skipping over water, volcanoes and tar pits.
- Lay railroads in the nearest square directly north or south of the impassable squares.
- Link the displaced railroads to the main railroad line.
- Add code to prevent the linking routine from getting stuck in a loop if it needs to go backwards to eventually go forwards.
Step 1 works fine. I am getting stuck on step 2 because I am trying to use CyMap().plot to locate the plots where the displaced railroads will go. I am getting an "Argument Error" when I actually try this code. I have attached a screenshot of the current error, my current version of the GoldenSpike.py file, and a save game that will build the Golden Spike as soon as you end the current turn. Can someone tell me what I am doing wrong? I think I am using the syntax the way it is used in other mods, and I have the feeling that something has been done to the plot function, but I don't know, so I'm asking.