• 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!

Solved Naval Officer Tweak

HachiChin

Landlubber
Hello PirateAhoy community, I come for guidance of the guidelines.


You see, there is a thing that I would like to know how to change, but I am not sure how I should do so. I've been reading some many posts’ in the forum, regarding various aspects of the game, and came across the discussions about ship commission, for people that is friendly and high enough in the ranks with a nation, like a good merchant, high ranking officer or privateer.

Also came across the discussion of the naval base in Antigua, about the idea of there, especially, high ranking officer commission ships.

Considering that is not yet implemented, my question is, how do I lift the restriction on naval officer to buy ships? I think would be cool if you achieve rank 10, or maybe higher, just 12, therefore, been a prestigious and recognized member of the navy, would be able to order ships for your own fleet, on the service of the crown, obliviously.

I ask this here because I did not find anywhere talking about this, well, not the buying ships, but actually showing how to do so as a Naval officer.

I would appreciate any guidance. my thanks for the community.
 
Ahoy there!

Look in PROGRAM\INTERFACE\shipyard.c and find the 'ProfessionalNavyNation' code in there.

You should get a bit more freedom in what you do with your fleet once you reach the rank of Commodore (or equivalent).
 
Thanks for the reply.

I went to that folder and opened the shipyard.c file, there, I found five places where there is present 'ProfessionalNavyNation' in the code.

From those, the first four where related to selling ships, with the fifth under 'void ProcessBuyShip', so I imagine would be that one. It goes;

// KK -->
void ProcessBuyShip()
{
if(DEBUG_SHIPYARD_INTERFACE) trace("ProcessBuyShip");
ref mchr = GetMainCharacter();
if(ProfessionalNavyNation() != UNKNOWN_NATION)
{
return;
}
int st = GetScrollShipType(nCurSScrollNum);
if (st < 0) return;
//if (!LAi_IsCapturedLocation) {
int bPrice = GetBuyPrice(nCurSScrollNum);
int sPrice = GetSellPrice(nCurFourNum,"skipcargo");
int buyPrice = bPrice - sPrice;
if( IsEnableBuyShip() && IsMoneyForBuyEnable(bPrice, sPrice) == 0 && !LAi_IsCapturedLocation)
{
FreezeScreen(true);
nShowMode = ISHOW_MODE_BUY;
SetNodeUsing("CONFIRM_RECTANGLE", true);
SetNodeUsing("TEXTWINDOW", true);
SetNodeUsing("CONFIRM_YES_BUTTON", true);
SetNodeUsing("CONFIRM_NO_BUTTON", true);
SetNodeUsing("SHIPBUYSELL_PIC", true);
SetCurrentNode("CONFIRM_YES_BUTTON");
SendMessage(&GameInterface,"lls", MSG_INTERFACE_LOCK_NODE, 1, "CONFIRM_NO_BUTTON");
SendMessage(&GameInterface,"lls", MSG_INTERFACE_LOCK_NODE, 2, "CONFIRM_YES_BUTTON");
string text = "";
string acquired = "";
switch (ShipAcquiredState(arCurShip))
{
case "bought": acquired = "owned ship "; break;
case "taken": acquired = "auction prize "; break;
case "pirated": acquired = "pirated ship "; break;
}

if (EnableLimitedShipClass() && GetShipMinClassForCharacter(mchr) > sti(ShipsTypes[st].Class)) text = TranslateString("", "This officer has too low Leadership and Sailing skills to command this ship.") + GlobalStringConvert("newline");
text += TranslateString("", "Buy this ship for") + " " + MakeMoneyShow(buyPrice,MONEY_SIGN,MONEY_DELIVER) + "?";
if (sPrice>0) text += TranslateString("", " ") + GlobalStringConvert("newline") + acquired + "trade-in " + MakeMoneyShow(sPrice,MONEY_SIGN,MONEY_DELIVER) + " new ship price " + MakeMoneyShow(bPrice,MONEY_SIGN,MONEY_DELIVER);
SetFormatedText("TEXTWINDOW", text);
}
/*} else {
DoBuyShip();
UpdateFourImages();
UpdateShipScroll();
SetCurrentNode("SHIPSLIST");
nCurSScrollNum = -1;
nCurFourNum = -1;
}*/ //Why would we want this? We can just add a check to set the buyprice to 0 right?
}

void BuyShipCancel()
{
if(DEBUG_SHIPYARD_INTERFACE) trace("BuyShipCancel");
nShowMode = ISHOW_MODE_VIEW;
FreezeScreen(false);
SendMessage(&GameInterface,"ll", MSG_INTERFACE_LOCK_NODE, 0);
SetNodeUsing("CONFIRM_RECTANGLE", false);
SetNodeUsing("TEXTWINDOW", false);
SetNodeUsing("CONFIRM_YES_BUTTON", false);
SetNodeUsing("CONFIRM_NO_BUTTON", false);
SetNodeUsing("SHIPBUYSELL_PIC", false);
SetNodeUsing("SKILL_PIC", false);
SetCurrentNode("SCROLLITEMS");
}

So, I’ve looked it and am not that sure what exactly one would need to change to make naval officer be able to buy ships on rank 12 or so, must say I am not that familiar with this code, I edited some stuff in the past but am no expert, would someone be kind to point me how to proceed?
 
So, I’ve looked it and am not that sure what exactly one would need to change to make naval officer be able to buy ships on rank 12 or so
This is the function used in the "ship transfer" interface to allow you to start swapping ships at navy rank 7 (Commodore):
Code:
if(ProfessionalNavyNation() != UNKNOWN_NATION && GetRank(GetMainCharacter(), GetServedNation()) < 7)
 
Thanks for the reply mate, I replaced the line "if( NavyNation() != UNKNOWN_NATION)" to that one that you posted, and it worked, very much appreciated for the help, I will be changing from "need help" to "solved".

Have a nice day my friend.
 
Thanks for the reply mate, I replaced the line "if( NavyNation() != UNKNOWN_NATION)" to that one that you posted, and it worked, very much appreciated for the help, I will be changing from "need help" to "solved".
Glad to hear it worked! :cheers

Have a nice day my friend.
Same to you, matey. :doff

@Grey Roger, do you think it makes sense to add this change to the main mod as well?
Maybe only allow buying ships if rank >= Commodore AND you are in a shipyard of your own nation?
 
Back
Top