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

Spanish frigates mod
Post new topic   Reply to topic     Forum Index -> Customization & Modding Goto page 1, 2, 3  Next
View previous topic :: View next topic  
Author Message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Thu Aug 29, 2013 2:57 pm    Post subject: Spanish frigates mod Reply with quote

Would it be possible to modify the Spanish so that they use the frigate class instead of war galleons? Do you think this would require a patch or is it something that can be done in the fpk files?

thanks for any help you can provide


Last edited by lurtz on Tue Sep 03, 2013 8:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Thu Aug 29, 2013 6:12 pm    Post subject: interesting...very interesting Reply with quote

while the game is clearly hardcoded for the spanish to use the galleons exclusively, and no one else can use them either, it would be interesting if possible because I think that this was in fact one of several significant reasons for the spanish downfall as the preeminent civilization AND the rise of the english in their place.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Thu Aug 29, 2013 6:40 pm    Post subject: Reply with quote

Thanks for your reply. The PHtrainer allows you to put Montalban and Raymondo in different ships (e.g. frigates or SOTLs) - I wonder if it the hardcoding could be worked around by a data setting change like that. Obviously those NPCs are special cases, but still?

As a last resort, could the fighting galleon model(s) be replaced with a copy/copies of the frigate model(s)? Would anyone know which files would be involved for such a change?

I saw in another thread where a user had replaced the mail runner with an upgunned ship named the interceptor. I wasn't sure how that was done - whether thru the PHtrainer or by some other means.

Also saw that the cargo capacity of a sloop had been increased via a patch.

It might be a total pain in the neck, but possibly by:
1) replacing war galleon models with frigate models
2) changing the galleons' vital stats thru a patch or patches
3) changing the ship class names in text.ini
you could accomplish what I'm thinking about?

Or maybe there are just 3 data changes that have to be made? Please anyone else chime in with ideas. Thanks.
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Thu Aug 29, 2013 7:20 pm    Post subject: interceptor Reply with quote

I made the interceptor by changing hardcoded values in the mailrunner class. I'm looking into trying to COMPLETELY swap out one ship type for a custom (see customization Jules Verne Nautilus). If this works then it may be possible to swap ship nifs. Jlangsdo has already swapped out the fencing nif's (can't remember the threads) but not all nifs are equal. Certain nifs have little interaction with other classses and some interact with everything.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Thu Aug 29, 2013 7:43 pm    Post subject: Reply with quote

Oh that was you with the interceptor! Sorry parksbanyon.

The ship models are contained in .nif files eh? I was just reading thru the East Indies mod thread and trying to follow the back & forth between you and jlangsdo. Most of it went over my head but I saw that jlangsdo mentioned the possiblitly of swapping "nif files and ship information" to effect a replacement of trade galleons with fluyts...

I assume the nifs are all stored in the /asset/npak.fpk files? But the "ship information" is probably in the executable and would have to be patched?

Looks like I better read back thru the modding forum to study up on nifs... thanks again for the replies and best of luck with your custom ship mod! Please post again about any progress you make.
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Fri Aug 30, 2013 6:29 am    Post subject: roger Reply with quote

will do.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Fri Aug 30, 2013 4:57 pm    Post subject: Reply with quote

Well, I have some progress to report.

I unpacked all the .FPK files from /Assets, then copied the obvious frigate related .nif files to the /Custom folder, replacing "frigate" in the names of these .nifs with "fastgalleon". Success! At least partial success. Fast galleons, war galleons, and flag galleons all now show in game as frigates.
I used the PHtrainer to put a fast, war, and flag galleon in my fleet at the same time and they all show up fine, and work in combat mode also.

I modified text.ini to replace the fighting galleon class names with the corresponding frigate class names, and that changed the names in game.

But I still have 3 challenges to overcome:
1) the animation of the sails & pennants of the fighting galleons isn't working right. The sails & the pennant are all rigidly immobile. So I'm still missing something, either another .nif file or something that needs to be copied into /Custom. If anyone knows where the animations reside, I'd be grateful if they passed that along.

2) as expected, these new "spanish frigates" still have the fighting & sailing characteristics of the original galleons. I'm guessing that fixing this will require a mod to the executable. I've never used a hex editor so I'm really reluctant to try this. But if anyone knows the locations of the ship stats in the executable, please sing out.

3) on the fleet status screen, the icons for the "spanish frigates" still show up as galleons, even though the class names have changed. This is probably yet another .nif that will have to be replaced via a renamed file in /Custom. This is actually kind of helpful right now while I'm sorting out the remaining problems with this replacement mod.

So that's it for now. I'm probably about 1/2 way home (the easy half!). Thanks for looking and as always suggestions are welcome.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Fri Aug 30, 2013 6:50 pm    Post subject: Reply with quote

More progress!

I copied all .KF and .KFM files related to frigates over to my /Custom folder and renamed "frigate" to "fastgalleon". In a few cases there were not exact matches for the file names between the two classes. Where I thought I safely could, I adjusted the original frigate .KF or .KFM file name to exactly replace the fastgalleon file.

Anyway, this looks like it has largely fixed the sail & pennant animation problem in both normal sailing and in combat.

Now if I can get smart & brave enough to modify the ship information in the .exe I think I will have completely replaced fighting galleons with frigates.

I'm really liking this mod so far. I normally would see only about one large frigate per game. Now, any place a war galleon would normally appear I get a large frigate instead!

Also, one of the most common Spanish "new warships" for me has always been the flag galleon. If this works right, I'm going to be seeing ships-of-the-line instead!

If anybody has insight about modifying the ships or the .exe I would love to read it. Thanks!
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Fri Aug 30, 2013 9:41 pm    Post subject: exe ship portion Reply with quote

U figured out the actual animation sub files are the .kf and kfm. and BTW Thnaks that verified a few things for me.

In regard to the ship portion of the exe, look at Customization & Modding/ Executable patch system.

Also search the forums for parksbanyon, your taking the same track As I did back in March and I went thru all the info already posted.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Fri Aug 30, 2013 11:49 pm    Post subject: Reply with quote

I will do that parksbanyon, thanks.
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Sun Sep 01, 2013 6:04 am    Post subject: thread titles Reply with quote

look up :
Editing the EXE
Executable patch system
Working on a perl savegame editor (for Mac)

I tried out the verne nautilus but still crashes.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Sun Sep 01, 2013 5:42 pm    Post subject: Reply with quote

Okay, I've been digging some more. By way of summary I'm going to jot down some things that bridger, jlangsdo, dogcigar, parksbanyon and probably others have discovered and proven thru their own research & mods long ago. Hopefully more knowledgeable posters will review this & confirm or correct it.

1. Some (possibly all) of the controlling ship data for all 27 ships in the game is hardcoded together in Pirates!.exe. The ship data is listed in the order shown in bridger's post about modifying the cargo capacity of a sloop. Namely, it starts with the war canoe & ends with the treasure galleon.

2. This ship data section appears to start in the .exe around location 325B08 with the war canoe and ends around location 326233, where the treasure galleon's data is completed.

3. The data for each ship appears to consist of 68 pairs of hex digits.

4. There is a string of hex digits that is common to each ship. I'm not sure what control variable it represents in game but I believe we can assume it marks the end point of any given ship's hardcoded data in the exe. It is

00 00 64 00 00 00 64 00 00 00 64 00 00 00 64 00 00 00

5. Bridger's original post ("Changing the size of ships cargo hold") is enormously helpful because it gives the exact address of each ship's cargo value in the .exe. It's his only post so it's easily found via search.

6. The only other ship control parameters that are readily apparent in the .exe (at least to me) are maximum crew and maximum cannons. For each ship, these appear just before the cargo parameter value. But there are at least a few other values that appear to be shared between the members of the 9 general ship classes. I'm hoping these represent things like the speed & turning radius of the class.

The main upshot from all this is, if you are doing a copy of one ship's data to another, I think it is safe to copy every thing between the delimiting string shown in #4 for the source ship, into the corresponding area of the target ship within Pirates!.exe. I'm going to attempt this and see if it completes my "Spanish frigate" mod. I will report what I find.
Back to top
View user's profile Send private message
parksbanyon
Gunner
Posts: 564



13127 Gold -

PostPosted: Sun Sep 01, 2013 6:56 pm    Post subject: another tip Reply with quote

read "Editing the EXE" it gives the single mo0st detailed version of what the ship data block does. Also I forgot to mention "Prices" about 1/2 in ship varibles are discussed.
Back to top
View user's profile Send private message
jlangsdo
Cutthroat
Posts: 398



11012 Gold -

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

Go to the thread "Executable Patch System" and use my script, smp_patch.pl. There is an example patch file for changing the amount a sloop can hold. If you do with a patch that way (rather than hacking the executable by hand) then your results will be easily shared with others. The patch files do not refer to the location in the file, because the executable files are different between Mac / Windows - the patches if built properly are portable.

For each ship, the info looks like this:


## Ship info
##mincrew/cost TurnRad NameClass MaxCrew Cannon Cargo
03 00 00 00 02 00 00 00 00 00 00 00 32 00 00 00 08 00 00 00 14 00 00 00 80 00 00 00 90 00 00 00 80 02 00 00 6f 02 00 00 00 00 00 00 08 00 00 00 0e 01 00 00 64 00 00 00 64 00 00 00 64 00 00 00 64 00 00 00

04 00 00 00 04 00 00 00 02 00 00 00 4b 00 00 00 0c 00 00 00 28 00 00 00 80 00 00 00 e6 00 00 00 ee 02 00 00 29 03 00 00 00 00 00 00 2b 00 00 00 40 01 00 00 64 00 00 00 64 00 00 00 64 00 00 00 64 00 00 00

I've shown lines for war canoe and sloop. Note that numbers are 4 bytes long, with the least significant byte first - so you can read the war canoe line as 3,2,0,50,8,20,..... corresponding to the ship size/min crew/cost number, turning radius (smaller is faster), naming class (0 is merchant), max crew of 50, 8 cannon, 20 tons capacity. The other numbers probably concern handling in the wind, but no one has ever worked them out.
Back to top
View user's profile Send private message
lurtz
Powder Monkey
Posts: 26


1360 Gold -

PostPosted: Tue Sep 03, 2013 8:22 pm    Post subject: Reply with quote

First, apologies for making such long posts about things that were so well known already. And thanks for the informative replies.

I figured out how to make block copy/pastes with my hex editor, so in the .exe I replaced the information for the 3 fighting galleons with that of the 3 frigates. Everything is working great so far and I'm enjoying the heck out of this mod. In my current game (rogue, start year 1680) my character is 33 years old and I've captured 6 SOTLs, 15 large frigates, and 12 standard frigates from the spanish so far. From what I can tell the spanish frigates fight & sail like their non-spanish counterparts. They definitely have the same crew, cargo, and gun capacity. In the past I would maybe see one large french frigate escorting a merchant in an entire game, so this is a big improvement to me. Also captured a spanish invasion force which was a large frigate with 26 guns & 250 crew. A little tougher nut to crack than a war galleon with 200 crew and 12 guns! So I'm pleased with the way it's working overall.

I've only identified 3 issues so far and they are fairly minor.
1) on the fleet status screen, the galleon image still shows up for the spanish frigates. The new ship names (SOTL, large frigate, frigate) do show up correctly on that screen & throughout the game though.
2) when visiting the shipwright, the spanish frigates show up slightly smaller than the true frigates on the ship detail screen. Still plainly recognizable as frigates, but smaller just the same.
3) in the pirate-o-pedia, the frigate models show up on the flag, fast, and war galleon entries. Since these galleons are no longer playable and don't show up in the game any longer, it isn't much of an issue.

I'm almost positive #1 and #2 are due to a .nif or a .dds I haven't found that needs to copied/renamed. I will have to dig some more to try to find the missing piece(s). #3 is really to be expected and since the 3 fighting galleons don't exist in game any longer the real fix would be to delete their entries from the pirate-o-pedia. No way I'm going to attempt that!

If any one is interested in playing this mod I will try to batch everything together into an .rar file and also create a .patch file to be used with the executable patch system.

Thanks again for all the help from everybody!
PS - changed thread title to Spanish frigates mod
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
Goto page 1, 2, 3  Next
Page 1 of 3

 
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