• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

The joys of serving as an Officer of the Navy

Kara Korsan

Sailor
Hello,

Been meaning to try out the Navy Officer for some time now. Played through the Hornblower storyline - very nice, by the way! Loved how Sharpe and co. guest starred throughout the campaign. Now that the story is over, goody-two-shoes Horatio is running around the Caribbean, helping the poor townsfolk and the nobles alike, sinking French warships and racking up promotions along the way.

Now, while a navy officer will of course display a radically different behavior compared to a dread pirate hell-bent on bringing the seven seas under the heel, it'd be foolish to expect every single detail to be accounted for by the modders in order to make a navy officer truly feel like a navy officer. Still, touching a few issues here and there, if it isn't too much trouble, would likely enhance the experience quite a bit.

I expect there are, or at least have been, hot discussions about the unique features of a navy officer playthrough, but the search function will never accept me as a friend, and I've made my peace with it. Hope I'm not reiterating what's already been brought up a few threads below.

Examples off the top of my head:

- Captured captains. Well, when you're an independent captain, pirate or otherwise, ransoming the captured captains makes a lot of sense. Perhaps not so much when you're a navy captain. Instead, bringing them to the nearest available town hall/naval headquarters or at least turning them over to the local guards might be more appropriate. Even if the script itself would be too much trouble, just renaming the "Ransom Prisoner" button/switching the cargo hold ransom dialogue with "I'm turning you over to the authorities, blah blah" would be adequate. The mechanics don't even need to be altered; the Navy would pay you a bounty, anyway.

- Prize money. Now, this also involves the point right above. We know the navy officers don't have to bother with the articles and envious crew. But it's also a fact that the prize money is supposed to be distributed in a way not unlike dividing the plunder. Would it be possible to divide the money automatically whenever a prize ship is sold or a prisoner is turned over? That'd be nice compromise where balance is of concern, too.

- Handling the contraband. We know about these guys who show up at the tavern and offer to helpfully take any contraband you might have off your hands, but I'd think that a naval offficer would prefer to deliver the captured contraband to actual government officials instead of some shady figure sitting at the corner table, hoping to fish some gullible captain in the hopes that he'll make a tidy profit. This, of course, would also count as prize money and be distributed accordingly.

- Pickpockets. Dude, I'm the freaking Vice Admiral of the Royal Navy, and this bum is still telling me to "piss of, sucker!" There must be something else I can do other than trying to get my purse back with a knife. I mean, guards won't bat an eyelash when you're a civilian, but a navy officer? Not saying we should be able to whip up our dueling pistol and liberally blast in the poor guy's general direction without any repercussion, but can't we at least try to report them, or apprehend them ourselves through dialogue? He may come peacefully or he may resist arrest, at which point it's time to whip up our dueling pistol and liberally blast in the poor guy's general direction. Maybe he'll even reconsider if he gets hit once? Unless that's too much coding?

I understand if it's too much work; I literally have no idea how difficult and time-consuming modding is. Can't even imagine. Just spitballing here. Peace.
 
Ransoming prisoners was a perfectly acceptable way of raising money, at least in earlier periods - perhaps not in Hornblower's time. Robbing the prisoner, on the other hand, is not allowed, which is why you might have noticed that as a naval officer, you do not have the choice to demand money from the prisoner when he first surrenders. You do still have the option to execute him, mainly because some quest captains can't be released or hired, leaving you with no other choice. But if you make a habit of it, there will be consequences!

Dividing the prize money when you sell a prize ship would mean moving it to the shipyard interface, which would be difficult and would probably affect game reliability, never mind balance! In any case, however it's divided, it should probably be the same for naval officers, privateers and pirates. Certainly naval officers and privateers would be the same, and pirates wouldn't go into a bank except to rob it! The current system might not be realistic but at least it works. What you could do, if you like, is write some alternative dialog lines specifically for naval officers. All loansharks use the file "PROGRAM\DIALOGS\ENGLISH\Usurer_dialog.h", which is plain text and easily edited using Notepad, Wordpad or whatever other editor you like. Look for all lines relating to dividing plunder, then add naval versions to the end of the file - don't put them in the middle near the original lines, as that will mess up the dialogs. Then change this line at the top of the file:
Code:
string DLG_TEXT[155] = {
However many new lines you added, add that number to the 155. If you make a new version of this file, I'll then show you how to edit "PROGRAM\DIALOGS\Usurer_dialog.c", the code file which controls dialog, to make it use your new lines. (Or I'll show you how to do it yourself.) Editing dialog text is the easiest form of modding there is, and it's how I got started in modding - in the "Hornblower" storyline, too!

Contraband: the guy in the tavern is supposed to be working for the governor, which is why selling him the contraband at reduced price can improve your status. Maybe he really is a government agent. Or maybe he's the governor's agent - the governor is corrupt, takes half the money for selling the contraband, gives you the other half, and his minion in the tavern gets a cut as well. Otherwise get the "Trustworthy" ability and sell it yourself in the store - you're now trusted by the government and are selling the stuff to the government via the store.

Pickpockets: the thief has no respect for the law or for vice admirals, otherwise he wouldn't have his hand in your pocket. So of course he's going to tell you to get lost! Meanwhile, as a naval officer, you have to obey the law, which means you can't just shoot him in cold blood. What you can do, if you like, is again to add some navy-specific lines for when you challenge the pickpocket. This time the file is "PROGRAM\DIALOGS\ENGLISH\Enc_Walker.h". What happens next will still be the same, but as a naval officer you might say something different.
 
About the pickpocket thing, is there a reputation/status check in play or does the thief's reaction entirely depend on random chance? If not, it could be an interesting addition. When you challenge the thief, if you have a particularly nasty reputation, you could threaten them with something horrible and they'd be more likely to give the money back. And if you have a particularly high status within the nation, you could bring up the old "Don't you know who I am?" and threaten them with your connections and the full weight of the law. No matter how little respect the pickpocket has for the law, if they know that you are really that nasty/important as to really make good on your threats, they'd be more likely to back down.
 
No, there does not seem to be any reputation check. If you want to add it, have a look at "PROGRAM\DIALOGS\Enc_Walker.c" and "PROGRAM\DIALOGS\ENGLISH\Enc_Walker.h", particularly case "stolen" and anything which follows from it. Be sure to get the 2nd September update because this includes my changes for what happens to your reputation if you get your money back by robbing the robber. Previously, you lost reputation by using a thief's knife or by stunning and mugging him, but lost no reputation for stunning and killing him. Now you don't lose reputation for using a thief's knife or by stunning and mugging, and you do lose reputation for stunning and killing him. (Which is why "stunned victim" needed to be translated in "interface_strings.txt". ;))
 
What I meant is that the prize money could be distributed automatically as soon as you sell the ship, without visiting the loanshark (which has always confused me, anyway - why am I doing this with a loanshark and not with my own quartermaster?). Like, you go to the shipyard, talk to the shipwright, sell the ship, and instead of the money being added to the general funds, ten percent of it goes straight into your personal purse and the rest is "distributed among the crew fairly" (by which I mean it effectively disappears and the crew's morale rises depending on how much they made, which is pretty much what happens when an independent captain divides the plunder manually). Maybe an on-screen message by one of those LogIt lines of yours, I don't know. "The prize money was distributed; 12000 gold added to your personal funds."

Dividing the bounty manually means it's your responsibility and you can try to keep it all and get away with it, like any other captain can do, and it's even easier to do for a naval officer since there's no envy problem to worry about. A naval officer wouldn't have that luxury - the Navy handles the actual process of distribution, and you can't escape it.
 
About the pickpocket thing, is there a reputation/status check in play or does the thief's reaction entirely depend on random chance? If not, it could be an interesting addition. When you challenge the thief, if you have a particularly nasty reputation, you could threaten them with something horrible and they'd be more likely to give the money back. And if you have a particularly high status within the nation, you could bring up the old "Don't you know who I am?" and threaten them with your connections and the full weight of the law. No matter how little respect the pickpocket has for the law, if they know that you are really that nasty/important as to really make good on your threats, they'd be more likely to back down.
As far as I recall, Negative Reputation is a bit on the underdeveloped side anyway.
If you want to add some features where being a nightmare character actually scares others into doing what you want, please do! :cheers

which has always confused me, anyway - why am I doing this with a loanshark and not with my own quartermaster?
Uhm...
Because...
Because otherwise you would never have much of an excuse to visit a loanshark at all?
Perhaps...?
 
What I meant is that the prize money could be distributed automatically as soon as you sell the ship...
... and at that point you're in the shipyard interface.

which has always confused me, anyway - why am I doing this with a loanshark and not with my own quartermaster?
Mainly because it works. I've sometimes had the same thought - sharing of prize money ought to be done on the quarterdeck with your boatswain or quartermaster, and that goes for privateers and pirates too. One of these days... Or maybe someone else might like the idea and decide to do something with it. Maybe you. ;)

Like, you go to the shipyard, talk to the shipwright, sell the ship, and instead of the money being added to the general funds, ten percent of it goes straight into your personal purse and the rest is "distributed among the crew fairly" (by which I mean it effectively disappears and the crew's morale rises depending on how much they made, which is pretty much what happens when an independent captain divides the plunder manually).
Meanwhile there's another thread in which someone wants to be able to buy ships when you're high enough rank in the navy, which won't happen if you lose almost all your prize money as soon as you get it. Or you might want to upgrade your ship - probably not when you're low rank and will be losing the ship in exchange for something bigger at your next promotion, but at rank Commodore or higher you can keep what you capture and rearrange your fleet as you see fit. The easiest "fix" would be to reduce the percentage of prize money which naval officers receive. At the moment you get 50% of the value, as the crown takes the other 50%. Perhaps reduce your share to reflect the crew getting some of the money as well.
 
Because otherwise you would never have much of an excuse to visit a loanshark at all?

Most people are probably already swimming in too much gold to notice this, but actually the interest rate the loansharks offer is nothing to sneeze at. But more importantly, they can offer you quests, perhaps? Ask you to go talk to this guy who's way behind his payment, for example. Kind of like what Arnaud did with Baldewyn (not sure if I'm spelling the names correctly here). After fending off so many enforcers yourself, the tables are turned! Lots of reputation penalties, of course.

... and at that point you're in the shipyard interface.

Which file is that? Not like I'm gonna be of any use, but I'm curious.

Or maybe someone else might like the idea and decide to do something with it. Maybe you.

Seriously, I wish. But without getting a hold of all those commands, functions, variables... I'm already getting a headache.
 
Last edited:
PROGRAM\INTERFACE\shipyard.c

Thanks!

This is the relevant part, I think.

Code:
void DoSellShip(string crewHandler, string cargoHandler)
{
    int navycut = 0;
    if(DEBUG_SHIPYARD_INTERFACE) trace("DoSellShip");
    int cn = GetCompanionIndex(GetMainCharacter(),nCurFourNum);
    if(cn<0) return;
    int transferred_crew_quantity = 0;
    int residual_crew_quantity = 0;
    int cc = 0;
    int cmpidx;
    ref refChar;
    ref chref = GetCharacter(cn);
    int sellPrice = GetSellPrice(nCurFourNum,cargoHandler);
    // PW: navy officers get some personal wealth -->
    if (ShipAcquiredState(arCurShip) == "taken" && ProfessionalNavyNation() != UNKNOWN_NATION)
    {
        navycut = makeint(sellPrice * SHIPYARD_NAVY_WEALTH_MULT);
        AddWealthToCharacter(GetMainCharacter(), navycut);
    }
    AddMoneyToCharacter(GetMainCharacter(),sellPrice-navycut);
    // PW: navy officers get some personal wealth <--
    makearef(arCurShip, Characters[cn].ship);
    ref        rShip = GetShipByID(arCurShip.Type);
    if(sellPrice != 0) sLogEntry += "Sold the '"+arCurShip.name+"', a "+XI_ConvertString(rShip.sname)+" for "+sellPrice+" pieces of gold. ";

Seems most of the work has already been done, anyway. Can't see the what navycut or SHIPYARD_NAVY_WEALTH_MULT is, as they're apparently defined elsewhere, but almost everything is already there. All that remains is adjusting the navycut if it's not historically accurate, and adding a line that would increase the crew morale proportionally under that AddWealthToCharacter line. Which I have zero clue how to. And perhaps an on-screen message saying "The <shipclass> <shipname> sold for <sellprice> gold; bounty distributed among the crew." Oh, and something like navycut = sellPrice afterwards, because we don't want to receive the rest of the money twice; the crew got it already.
 
See here point #3:
Tutorial - Modding Tips & Tricks

That should allow you to find in what other file those variables are mentioned.

Search also the usurer dialog for the part about dividing plunder and that same trick will allow you to trace where the code leads so you can copy the relevant bits.
 
OK the bit of code giving some personal wealth is mine (if not the idea). PW = pedrwyth

You will find the relevant multipliers as UPPER CASE globals in internal settings so anyone is free to alter their own balance. Currently I think a navy prize gets only a fifth of the "normal" (owned ship??) selling price (much less than a privateer). So a large chunk (some of which could be taken to be crew individual rewards) is taken away into space. The player gets an eighth of the remainder as wealth whilst the rest goes into the useful money for the running of the ship (labelled crew money) but they only notionally get any from there if you play with divide the plunder which as a navy officer you can't).
The main thread about prize money and the like is

Included in Build - Different Shipyard Sale Prices for Naval Officers/Privateers



What you seem to want is more transparency which is fine and a message should be fairly simple to include at that point - but I do wonder how often it will be read after the third or fourth time. Maybe a note in the ship's log (can't recall what, if anything, is put there relating to prize money). The concept of a bonus to crew morale too when receiving their (notional) prize money seems a good one.
 
Exactly! I don't even care much for transparency, actually. An on-screen message isn't essential; the changes in crew morale are usually displayed on their own anyway.

That last line of the code I posted above seems to be the only one putting in a log entry. Not sure how that works, but I'll try adding the line below and see what happens.

Code:
if (ShipAcquiredState(arCurShip) == "taken" && ProfessionalNavyNation() != UNKNOWN_NATION) sLogEntry += "Prize money was distributed among the crew in accordance with the Royal Proclamation. ";

As for the crew morale, that part is currently beyond my scope as coding is required to add up the number of crewmembers in all other remaining ships in the fleet, divide the total crew share by the total number of crewmembers, multiply it by a coefficient to determine the morale raise and apply said morale raise to each remaining ship in the fleet. Unless someone who knows what they're doing picks that up, I guess I'll have to move on.
 
Exactly! I don't even care much for transparency, actually. An on-screen message isn't essential; the changes in crew morale are usually displayed on their own anyway.

That last line of the code I posted above seems to be the only one putting in a log entry. Not sure how that works, but I'll try adding the line below and see what happens.

Code:
if (ShipAcquiredState(arCurShip) == "taken" && ProfessionalNavyNation() != UNKNOWN_NATION) sLogEntry += "Prize money was distributed among the crew in accordance with the Royal Proclamation. ";

We might have to deal with the "Royal" bit in some settings.
As for the crew morale, that part is currently beyond my scope as coding is required to add up the number of crewmembers in all other remaining ships in the fleet, divide the total crew share by the total number of crewmembers, multiply it by a coefficient to determine the morale raise and apply said morale raise to each remaining ship in the fleet. Unless someone who knows what they're doing picks that up, I guess I'll have to move on.

Not at all you have already shown a firm grasp of getting what code you need and it's all learning by doing here! Well that and constructive stealing from those who came before. You know you can raise morale in the crew interface screen of ship so look for morale in PROGRAM/INTERFACE/ship.c you will see a function GetRaiseMoraleCost(chref) look that up (modding tips and tricks use windows search) and you see GetCrewQuantity(chref) involved. You will already have seen the code for checking the main character and companions in all sorts of situations so put together that's most of your requirements.

You could add an attribute to each player and companion ship for the money paid and then check at each prize auction if there's enough to raise morale and put any remainder back in the attribute for next time.
 
We might have to deal with the "Royal" bit in some settings.

Prize Act, perhaps? Most navies had such an act or statute under one name or another, US Navy included. Prize Act sounds generic enough, I think.

Not at all you have already shown a firm grasp of getting what code you need and it's all learning by doing here! Well that and constructive stealing from those who came before. You know you can raise morale in the crew interface screen of ship so look for morale in PROGRAM/INTERFACE/ship.c you will see a function GetRaiseMoraleCost(chref) look that up (modding tips and tricks use windows search) and you see GetCrewQuantity(chref) involved. You will already have seen the code for checking the main character and companions in all sorts of situations so put together that's most of your requirements.

You could add an attribute to each player and companion ship for the money paid and then check at each prize auction if there's enough to raise morale and put any remainder back in the attribute for next time.

Thanks, that's encouraging, but it requires a lot of dissecting to do, and maybe I'll have some time to spare on my off day. Need to figure out what does what, first.
 
Back
Top