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

Limit selling navy ships

I solved this problem now, I think. I made it work quite differently now, but I think it is fine this way as well.

My original idea:
You must be friendly with pirates and at war with all other nations to be able to buy a pirate ship

Current code:
Your nation must be PIRATE and you must have the required minimum fame to be able to join the pirates.

This way, if you start the game as a pirate, you must get the required minimum fame first. If you don't start the game as a pirate, you must first join the pirate, for which you also need that required minimum fame.
 
<img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" /> there, Pieter,

Just about to download your latest update. Is your new Pirate code included?

Cheers <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Yes, it is. I added everything in, including code that does not yet work as intended. I played for a bit and I don't think it really breaks the game. But it should be fixed. But all my latest code will not be in Build 13 at all anyway.
 
<!--quoteo(post=161110:date=Sep 11 2006, 12:29 PM:name=0wl)--><div class='quotetop'>QUOTE(0wl @ Sep 11 2006, 12:29 PM) [snapback]161110[/snapback]</div><div class='quotemain'><!--quotec-->
Oh man this becomes better by every day that passes mates...
<!--QuoteEnd--></div><!--QuoteEEnd-->
Hehe. One can only hope. <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" />
 
<img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" /> there, Pieter,

Naval limiting seems to be working fine. Haven't checked the pirate side of things yet.

Cheers <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
It does work? Great! Have you also checked what happens if you get promotions? Do higher ranking navy ships become available?
 
I'm lieutenant at the moment. Just starting to get Class 3s available for sale and also getting the unavailable naval ship message, too. More to test. <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

Cheers <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
As soon as you become a commander, please check if the Class 3 navy ships have become available. I have been unable to test that myself, because it takes a while to become a commander.
 
There seems to be a bug with this. Certain level ships you can't buy, even though you should. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
 
So there was some absolutely MORONIC errors with my code for this.
Apparently it has NEVER been working.
I fixed this now and it's FINALLY doing what it was supposed to! :shock
 
Not in any released version yet. But you can add the fix yourself.
In PROGRAM\INTERFACE\shipyard.c, find the RANK_FOR_FIRST_RATE code and make it look like this:
Code:
	// PB: Realistic Ship Purchase -->
GameInterface.scrollitems.(attributeName).navyship = false;
GameInterface.scrollitems.(attributeName).pirateship = false;
if(REALISTIC_SHIP_PURCHASE == 1 && LAi_IsCapturedLocation == false)
{
if(GetCurrentLocationNation() == PIRATE)
{	
if(GetLocalShipAttrib(arCurShip, ShipsTypes[st],"Nation") == PIRATE) GameInterface.scrollitems.(attributeName).pirateship = true;
if(PChar.nation == PIRATE && GetFame(PChar, PIRATE) > PIRATE_REQFAME) GameInterface.scrollitems.(attributeName).pirateship = false;
}
else
{
if(GetLocalShipAttrib(arCurShip, ShipsTypes[st],"Type.War") == true && GetLocalShipAttrib(arCurShip, ShipsTypes[st],"Type.Trade") == false && GetCurrentLocationNation() != PIRATE)
{
switch(sti(GetLocalShipAttrib(arCurShip, ShipsTypes[st],"Class")))
{
case 1:
if(RANK_FOR_FIRST_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_FIRST_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_FIRST_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;
case 2:
if(RANK_FOR_SECOND_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_SECOND_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_SECOND_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;					
case 3:
if(RANK_FOR_THIRD_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_THIRD_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_THIRD_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;					
case 4:
if(RANK_FOR_FOURTH_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_FOURTH_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_FOURTH_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;
case 5:
if(RANK_FOR_FIFTH_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_FIFTH_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_FIFTH_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;
case 6:
if(RANK_FOR_SIXTH_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_SIXTH_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_SIXTH_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;
case 7:
if(RANK_FOR_SEVENTH_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_SEVENTH_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_SEVENTH_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;
case 8:
if(RANK_FOR_EIGHTH_RATE == 0 && !HaveLetterOfMarque(GetCurrentLocationNation()))
{GameInterface.scrollitems.(attributeName).navyship = true;}

if(RANK_FOR_EIGHTH_RATE > 0 && GetRank(GetMainCharacter(), GetCurrentLocationNation()) <= RANK_FOR_EIGHTH_RATE)
{GameInterface.scrollitems.(attributeName).navyship = true;}
break;
}
}
}
}
if(GameInterface.scrollitems.(attributeName).navyship)
{
GameInterface.scrollitems.(attributeName).spec2 = true;
GameInterface.scrollitems.(attributeName).skipsell = true;
}
if(GameInterface.scrollitems.(attributeName).pirateship)
{
GameInterface.scrollitems.(attributeName).spec2 = true;
GameInterface.scrollitems.(attributeName).skipsell = true;
}
// PB: Realistic Ship Purchase <--
Originally it used GetMainCharacterIndex while it should've been GetMainCharacter.
And it was always <= RANK_FOR_FIRST_RATE instead of the class-dependent rate. :facepalm
 
i was wondering why when i had the realistic ship purchase mod on i couldn't buy a navy ship even at 1e rank.thanks for clearing that up :dance
 
Back
Top