Shop  •   Avatar  •   FAQ  •   Search  •   Memberlist  •   Usergroups  •   Profile  •   Log in to check private messages  •   Log in  •  Register 

New/Moving Cities
Post new topic   Reply to topic     Forum Index -> Customization & Modding
View previous topic :: View next topic  
Author Message
dogcigar
Swabbie
Posts: 82



542 Gold -

PostPosted: Sun Sep 01, 2013 3:24 pm    Post subject: New/Moving Cities Reply with quote

Thinking about changing city locations and names as there are the 3 landlocked cities (including Panama) that I never go to. [once went to Gran Granada for a criminal but next time I`ll just forgo the 5grand].
Puerto Principe is kind of useful as a reference for treasure maps but Panama and Gran Granada are useless for me.

I saw in the old Pirates! there was a Belize which would make that region (Yucatan I think they call it) a little more interesting. There were some English loggers there. There was also a Puerto Caballos a bit further south but my short wiki research indicates the colony was a bit smaller.

My basic method would be patching the game , renaming Gran Ganada , changing location data, and giving it a port.

Anyway some questions from ya vast knowledge jlangsdo whenever you`ve got a minute. I was looking at the East Indies Mod. Concerning patching the program

1. Everything seems to be alphabetical. Is it necessary to keep cities in alphabetical order? If not could you just change GranGranada to Belize in the citynames_enu.txt, patch your new data, and make a new cities.txt file? If not I imagine I`d have to shift everything around and I`d probably stop right there.

2. What`s the significance of the cityloc.dta file.

3 I remember your Bermuda mod wasn`t patched and worked with new games renaming Eleuthera (ie not a savegame mod). I wouldn`t bother you but the link is down. What were the files involved? (Ofcourse this method would keep GranGranada/Belize Spanish but would probably work easily with a patch to GranGranada.
Back to top
View user's profile Send private message
jlangsdo
Cutthroat
Posts: 400



10932 Gold -

PostPosted: Sun Sep 01, 2013 4:38 pm    Post subject: Reply with quote

The list of cities doesn't have to be alphabetical (in fact, it has a few entries out of order - Santiago is between Santa Cantalina and Santa Marta).

The names are stored only in the txt file : citynames_enu.txt (for American English speakers). The contents of that file are then copied into the savegame file (CityName section in the pst files), along with fixing the temporary names for pirate havens, missions, and settlements.

So by changing citynames_enu.txt, you can change the name of an existing city in new games, but that file controls no other attributes.

Everywhere else, cities are referred to by their number in the list; Antigua is city number 0.

Note that if you are moving cities around, you may also want to move Coro (#5), which disappears in the game after the early eras.

cityloc.dta stores the locations, directions, and port directions of each city. This information is copied into the savegame file after you start (CityLoc section in the pst files). There are 4 numbers per city: 4-byte integers X and Y coordinates (462x293 grid multiplied by 1000), and then two 4 byte numbers that are in the range 0-15 for the port and fort directions (0 is north, 4 is east, 8 is south, 12 is west).

Here's the code I used to write out the cityloc.dta file while working on the East Indies mod, just so you can see what to use for packing. The 1344 zeros packed in afterwards are 84 lines of 0 for all of the missions, havens, and settlements.

Code:

open (LOC, ">Assets/East_Indies/cityloc.dta") or die "Failed to write to cityloc.dta\nQuitting";
foreach my $city (sort keys %c) {
  foreach my $id (sort {$a <=> $b} keys %{$c{$city}}) {
    print LOC pack "V", $c{$city}{$id}{X}*1000;
    print LOC pack "V", $c{$city}{$id}{Y}*1000;
    print LOC pack "CCCC", 0,0,0, hex($c{$city}{$id}{Port})*16;
    print LOC pack "CCCC", 0,0,0, hex($c{$city}{$id}{Fort})*16;
  }
}
print LOC (pack "C", 0) x 1344;
close LOC;
print "Wrote cityloc.dta\n";



I fixed the link for the Bermuda.zip file because that is a good place to start.

However, to make a landlocked city not-landlocked also requires an executable patch.

Code:

## xloc     yloc        has_port    flag range size   range2       zero   1660 1620/1640 0/1600
a5 01 00 00 75 00 00 00 06 00 00 00 01 0c 06 00 02 00 00 00 50 00 00 00 00 00 00 00 11 01 00 00    # Antigua     goods  for sale
...
a1 00 00 00 3d 00 00 00 00 80 00 00 00 14 14 00 19 00 00 00 82 00 00 00 00 00 00 00 11 11 01 00    # Gran Granada


Note that Gran Granada has 00 in the has_port column, where most of the cities have a 06.
Back to top
View user's profile Send private message
dogcigar
Swabbie
Posts: 82



542 Gold -

PostPosted: Sun Sep 01, 2013 4:44 pm    Post subject: Reply with quote

many many thanks
Back to top
View user's profile Send private message
dogcigar
Swabbie
Posts: 82



542 Gold -

PostPosted: Sun Sep 01, 2013 4:57 pm    Post subject: Reply with quote

Actually, I kind of like Coro. I often play the underrated 1620`s as French with that terrible barque and Coro is a good city to invade. Not many men to recruit in the 1620`s.
Back to top
View user's profile Send private message
dogcigar
Swabbie
Posts: 82



542 Gold -

PostPosted: Sun Sep 01, 2013 6:49 pm    Post subject: dta files Reply with quote

btw What`s the best way to edit(pack/unpack) dta files? I found an editor (for 30 days at least) but having trouble converting it from the gibberish to hex. I assume the data is in hex.
Back to top
View user's profile Send private message
jlangsdo
Cutthroat
Posts: 400



10932 Gold -

PostPosted: Mon Sep 02, 2013 1:54 am    Post subject: Reply with quote

I usually use this script:
hex.pl
which converts between a binary format and a plain text file. So I might convert the dta file to text, hack the text, then convert back to dta.

You could also use a hex editor like HexEdit to change the file directly.
Back to top
View user's profile Send private message
dogcigar
Swabbie
Posts: 82



542 Gold -

PostPosted: Mon Sep 02, 2013 4:46 am    Post subject: Reply with quote

thanks again,

I wonder what happens if you try to make Europe(s) into real cities if you were desperate to free up a couple of slots. eg move Europe to Trinidad and St Augustine. They`re on the edge of the map anyway. Does the game actually think there are some cities out there? Could they have ports and taverns et al? They`d have to cause a crash somewhere. Also you never hear of the Baron being seen in Europe ofcourse
Back to top
View user's profile Send private message
jlangsdo
Cutthroat
Posts: 400



10932 Gold -

PostPosted: Mon Sep 02, 2013 11:38 pm    Post subject: Reply with quote

There is a discussion in the "Bermuda Mod" thread about this - maplabel.dta has lines in groups of 44 for the 44 real cities; so that's the max. Europe and Florida Channel are not among them.
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 565



13127 Gold -

PostPosted: Tue Sep 03, 2013 5:39 am    Post subject: Hats Off Reply with quote

My hat is off to the both of you. Iwas reading threads from Jan 2013, and the wealth of information and expertise derived from then to now is exceptional.

Its making me feel a bit "mentally challenged" I haven't begun to reach your level.

Once again, Thanks for all the work done.
Back to top
View user's profile Send private message
dogcigar
Swabbie
Posts: 82



542 Gold -

PostPosted: Tue Sep 03, 2013 3:54 pm    Post subject: Reply with quote

Flattery will get you everywhere Smile
Back to top
View user's profile Send private message
fenirstardust
Powder Monkey
Posts: 16



363 Gold -

PostPosted: Mon Apr 30, 2018 4:19 pm    Post subject: Reply with quote

jlangsdo wrote:
I usually use this script:
hex.pl
which converts between a binary format and a plain text file.....

jlangsdo
rapidshare is no more and I am effing confused about what your world building mod/scripts are, i would like to make a new map but the info on here is daunting and a few people keep mentioning some world builder you made
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 565



13127 Gold -

PostPosted: Tue May 01, 2018 6:28 pm    Post subject: reply Reply with quote

jlangsdo built the Bermuda and east indies mod which did extensive work to the Pirates! map. Between the Bermuda thread and the East Indies mod thread a lot of the hows ands whys are explained. Even to this day I wouldn't try to do what jalangsdo did. If it is in your wheelhouse pirate and I would love a map of China SE Asia! Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Customization & Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group