Page 1 of 1

Amending PoN save files

Posted: Sun Apr 29, 2018 6:28 pm
by loki100
There are times when this is easier than writing an event but its a bit daunting at first sight, especially if you don't know what you are looking for.

Since I've just done this as a PM for someone, thought I'd share with all. The specific goal was to delete a naval unit that had picked up a post-1910 replacement in a 1850s fleet. An annoying bug that seems to crop up now and then.

So:

First, make a copy of your .trn file (in case of errors).

Now open the .trn file, you'll find it somewhere like:

Image

Maybe a bit different on your computer but it should be similar.

When the file is open do a search for a ship name that is the unit you want to delete.

You'll find an entry like this:

Image

What we are interested is the line that starts {Unit}

Highlight everything from {Unit} down to the next {/Unit} - this will include 4 (maybe 3) subunits.

Simply delete that block.

Make sure there are no blank lines in the save file - ensure that the sequence {/unit} .. {unit} is what you can see.

Save, open the game and when you run that turn the unit should have been deleted.

An alternative is to identify the subunit that has the wrong type and try to correct this. Now this is trial and error (as the wiki is down and this has never been properly listed), but under a subunit you will see code like 1375 - its the second line after the text {subunit}

Image

Now this code tells the computer what model type to use. If you look at the codes for the 4 subunits in the unit you'll see that one is different. Correct that to match the others. It should then re-appear as a sail ship.

Good luck

Roger

Re: Amending PoN save files

Posted: Tue May 01, 2018 3:13 am
by Durk
This is very interesting and I can see its utility. I will hesitate to use it on a live game, but I have two which would benefit. I will experiment in the sandbox. Thanks very much for sharing.

Re: Amending PoN save files

Posted: Sat Jun 13, 2020 2:46 am
by Tom
Yes .... I suspect somewhere within there is information on which regions are known to a country. I am playing among others the generated CSA. It seems perhaps due to being an emergent nation, every turn i start with them, the entire map is black. I use RevealTI to play each turn, but I have to restart the game otherwise when I process end of turn, it reveals everything for others, which spoils their colonial game. Restarting the game each turn at least allows them to have some hidden map.

However, I'd like to avoid that by adding visible regions for the CSA. I am certain these must be stored in the save game file because it changes over the course of the game for each nation (and perhaps that will keep the map from being black?).

Any thoughts on where this is displayed in the save files? I thought about writing a script, but it would take a long time; better to just for example copy that section from the USA save to the CSA save.

Re: Amending PoN save files

Posted: Sat Jun 13, 2020 10:04 pm
by Tom
:cwboy: Appears might be different from SetKnownRegions ... scripting RevealTI does not work. Entering by hand, would take a long time to reference the region numbers list. Seems console commands do not work in scripting.

Hmmmm

Copy/paste from another country would be much faster.