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

Need some help with games

From what I understand of the CoAS code, it is quite inconvenient. On PotC, you just make whatever changes in ships_init.c and that is enough.
Perhaps @Luke159 would have some good suggestions for this one.
 
Ok thanks I will reinstall the game and install the 2.0 GOF.But I want to know how the shipyards works in this game more in depth(in code).I want to allow them(or just single of them)to sell me the movie ships.How it is defined?Every island has its own list of ships which can sell me?Can I add the movie ships to it?It is hard to do it?I´m an amateur programmer but I understand the code a little.

Sadly you can't set specific shipyards to sell specific ships, the movie ships are already set in the mods but large ships like the HMS Surprise will never be sold in a shipyard if more realistic ship purchase is turned on. If you go to "Age of Pirates 2\Program\scripts == ShipsUtilites.c" you will see the following section which is for each level aka your characters level is at for what ships will be generated. You will see both the normal default and more realistic ship purchase coding here.

Code:
void SetShipyardStore(ref NPChar)
{
  int  iTest_ship, i;
 string attrName;
 
 if (CheckAttribute(NPChar, "shipyard")) return; // åùå åñòü êîðàáëè ñ òîãî ðàçà
 
 SaveCurrentNpcQuestDateParam(npchar, "shipyardDate"); // äàòà çàïîëíåíèÿ âåðôè
  
  if (bBettaTestMode)
  {
  for (i = 1; i <=SHIP_TYPES_QUANTITY; i++)
  {
  attrName = "ship" + i;
  FillShipParamShipyard(NPChar, GenerateStoreShip(i-1), attrName);
  }
  
  return;
  }
 
  FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_TARTANE), "ship1");
  
 iTest_ship = rand(5);
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship3");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship3");

 iTest_ship = rand(6);
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship3");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship3");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship3");
 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(12);
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship4");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship4");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship4");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_KETCH), "ship4");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship4");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship4");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_EMPRESS), "ship4");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(6);
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship4");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship4");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship4");
 } 
 if (sti(PChar.rank) > 1)
 {
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(28); //50% chance to get a ship here
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship5");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship5");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship5");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_KETCH), "ship5");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship5");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship5");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARQUE), "ship5");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARKENTINE), "ship5");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_EMPRESS), "ship5");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(10); //50%
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship5");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship5");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_KETCH), "ship5");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship5");
 } 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(46); //50%
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_EMPRESS), "ship6");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship6");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARQUE), "ship6");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARKENTINE), "ship6");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIGANTINE), "ship6");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG), "ship6");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FLEUT), "ship6");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CARAVELR), "ship6");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(10); //50%
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship6");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship6");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_KETCH), "ship6");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship6");
 }
 }
 if (sti(PChar.rank) > 3)
 { 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 { 
 iTest_ship = rand(60); //33% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG), "ship8");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FLEUT), "ship8");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER_H), "ship8");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEOTH_H), "ship8");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_YACHT), "ship8");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SPEEDY), "ship8");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PINNACE), "ship8");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CARAVELR), "ship8");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(12); //33% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HANNAH), "ship8");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_KETCH), "ship8");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship8");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship8");
 }
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(48); //33% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SPEEDY), "ship9");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PINNACE), "ship9");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SOPHIE), "ship9");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CASTELF), "ship9");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_INTERCEPTOR), "ship9");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_DERFFLINGER), "ship9");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER), "ship9");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(12); //33% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_KETCH), "ship9");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship9"); 
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship9");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARQUE), "ship9");
 }
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(48); //33% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_INTERCEPTOR), "ship10");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_DERFFLINGER), "ship10");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER), "ship10");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEON_L), "ship10");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_DUTCHPINNACE), "ship10");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PINNACEBERLIN), "ship10");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(12); //33% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUNTY), "ship10");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship10");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARQUE), "ship10");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARKENTINE), "ship10");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIGANTINE), "ship10");
 }
 }
 if (sti(PChar.rank) > 5)
 { 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(88); //20% chance of a ship here
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEON_L), "ship11");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_DUTCHPINNACE), "ship11");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PINNACEBERLIN), "ship11");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNUS ), "ship11");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GREYHOUND), "ship11");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_28GUNFRIGATE), "ship11");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PDN), "ship11");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PACKET_BRIG), "ship11");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ENTERPRISE), "ship11");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG_20_GUN1_18), "ship11");
 if (iTest_ship == 11) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER_L), "ship11");
 if (iTest_ship == 12) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SHNYAVA), "ship11");
 if (iTest_ship == 13) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HOOKER1), "ship11");
 if (iTest_ship == 14) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG3), "ship11");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(20); //20% 
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOP), "ship11");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARQUE), "ship11");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARKENTINE), "ship11");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIGANTINE), "ship11");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG), "ship11");
 }
 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP purchase is NOT enabled
 {
 iTest_ship = rand(100);  //20% 
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNUS ), "ship12");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GREYHOUND), "ship12");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_28GUNFRIGATE), "ship12");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PDN), "ship12");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PACKET_BRIG), "ship12");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ENTERPRISE), "ship12");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOPOFWAR), "ship12");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG_20_GUN1_18), "ship12");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER_L), "ship12");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SHNYAVA), "ship12");
 if (iTest_ship == 11) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HOOKER1), "ship12");
 if (iTest_ship == 12) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG3), "ship12");
 if (iTest_ship == 13) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CARAVEL), "ship12");
 if (iTest_ship == 14) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEON_H), "ship12");
 if (iTest_ship == 15) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CORVETTE), "ship12");
 if (iTest_ship == 16) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FELIPE), "ship12");
 if (iTest_ship == 17) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SURPRISE), "ship12");
 if (iTest_ship == 18) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CORVFRIG2_50), "ship12");
 if (iTest_ship == 19) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_RaaFrigate), "ship12");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(20); //20% 
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARQUE), "ship12");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BARKENTINE), "ship12");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIGANTINE), "ship12");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG), "ship12");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER_H), "ship12");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEOTH_H), "ship12");
 }
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(95); //20% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BLACKPEARL), "ship13");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NIGHTMARE), "ship13");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_UNICORN), "ship13");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEON_H), "ship13");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CORVETTE), "ship13");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FELIPE), "ship13");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SURPRISE), "ship13");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CORVFRIG2_50), "ship13");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_RaaFrigate), "ship13");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEON1), "ship13");
 if (iTest_ship == 11) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PO_FLEUT50), "ship13");
 if (iTest_ship == 12) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_THEBLACKPEARL), "ship13");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(20); //20% 
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIGANTINE), "ship13");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG), "ship13");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER_H), "ship13");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEOTH_H), "ship13");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_YACHT), "ship13");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SPEEDY), "ship13");
 }
 }
 if (sti(PChar.rank) > 8)
 { 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(525); //4% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CORVETTE), "ship14");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FELIPE), "ship14");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SURPRISE), "ship14");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CORVFRIG2_50), "ship14");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_RaaFrigate), "ship14");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEON_H), "ship14");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_QueenAnnesRevenge), "ship14");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FRIGATE), "ship14");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LINESHIP), "ship14");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ARABELLA), "ship14");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(100); //4% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GALEOTH_H), "ship14");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_YACHT), "ship14");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SPEEDY), "ship14");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SOPHIE), "ship14");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_INTERCEPTOR), "ship14");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER), "ship14");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNUS), "ship14");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG_20_GUN1_18), "ship14");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER_L), "ship14");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SHNYAVA), "ship14");
 if (iTest_ship == 11) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HOOKER1), "ship14");
 if (iTest_ship == 12) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG3), "ship14");
 }
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(700); // 2.8% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_QueenAnnesRevenge), "ship14");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FRIGATE), "ship15");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LINESHIP), "ship15");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ARABELLA), "ship15");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_QueenAnnesRevenge), "ship15");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_Revenge), "ship15");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BOUSSOLE), "ship15");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SALAMANDER), "ship15");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LINEFRIGATE), "ship15");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_TWODECKER1_47), "ship15");
 if (iTest_ship == 11) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_USS_CONSTITUTION), "ship15");
 if (iTest_ship == 12) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LA_LICORNE), "ship15");
 if (iTest_ship == 13) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BATTLEFRIGATE), "ship15");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(140); //2.8% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SPEEDY), "ship15");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SOPHIE), "ship15");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_INTERCEPTOR), "ship15");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER), "ship15");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNUS), "ship15");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG_20_GUN1_18), "ship15");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER_L), "ship15");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SHNYAVA), "ship15");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HOOKER1), "ship15");
 if (iTest_ship == 10) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG3), "ship15");
 }
 }
 if (sti(PChar.rank) > 12)
 {
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(425); //4% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LINEFRIGATE), "ship141");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_TWODECKER1_47), "ship141");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_USS_CONSTITUTION), "ship141");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LA_LICORNE), "ship141");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CURSEDDUTCHMAN), "ship141");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_RN_BATTLEFRIGATE), "ship141");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FASTGALLEON1), "ship141");
 if (iTest_ship == 9) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_WARSHIP), "ship141");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(175); //4% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_INTERCEPTOR), "ship141");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SCHOONER), "ship141");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNUS), "ship141");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SHNYAVA), "ship141");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HOOKER1), "ship141");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BRIG3), "ship141");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GREYHOUND), "ship141");
 if (iTest_ship == 8) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PDN), "ship141");
 }
 
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(595); //2.8% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_CURSEDDUTCHMAN), "ship151");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_RN_BATTLEFRIGATE), "ship151");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FASTGALLEON1), "ship151");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_WARSHIP), "ship151");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BATTLESHIP), "ship151");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BELLONA), "ship151");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_POSEIDON), "ship151");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(280); //2.8% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNUS), "ship151");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GREYHOUND), "ship151");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PDN), "ship151");
 }
 }
 if (sti(PChar.rank) > 18)
 {
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(480); //2.5% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BELLONA), "ship16");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_POSEIDON), "ship16");
   if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_COURONNE), "ship16");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNE), "ship16");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FR_SUPERIORWARSHIP1), "ship16");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(280); //2.5% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_GREYHOUND), "ship16");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PDN), "ship16");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PACKET_BRIG), "ship16");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ENTERPRISE), "ship16");
 }
 if(!REALISTIC_SHIP_PURCHASE) // = If Realistic SHIP PURCHASE is NOT enabled
 {
 iTest_ship = rand(400); //2.5% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_NEPTUNE), "ship17");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_FR_SUPERIORWARSHIP1), "ship17");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SUPERBE), "ship17");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LINK), "ship17");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_MANOWAR), "ship17");
 if (iTest_ship == 6) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_HMS_VICTORY), "ship17");
 if (iTest_ship == 7) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BATTLEMANOWAR), "ship17");
 }
 else // = If Realistic SHIP PURCHASE IS enabled
 {
 iTest_ship = rand(280); //2.5% chance
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PDN), "ship17");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_PACKET_BRIG), "ship17");
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ENTERPRISE), "ship17");
 if (iTest_ship == 4) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_SLOOPOFWAR), "ship17");
 if (iTest_ship == 5) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_28GUNFRIGATE), "ship17");
 }
 }
}
void FreeShipFromShipyard(ref NPChar)

If you want to add a ship then its simple, first note want level you want your character be able to see this ship to show up in the shipyard and then copy one of the lines of coding from that level see bellow, we will use the earliest level for this example.

Code:
 iTest_ship = rand(5);
 if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_LUGGER), "ship3");
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship3");


Now to copy a line of code for the new ship.
Code:
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BERMSLOOP), "ship3");

Change the part "SHIP_BERMSLOOP" to the name of the ship you wish to show up at that level (for this you will need to open "\Program\Ships == Ships_init" now look for the ship you want to add, we will go with a fantasy ship seeing as that was your question and we will use the Blackpeal seeing as its the most famous of them all. See bellow (not there are two blackpearls but I will explain how to tell them apart bellow.

First off the none blackpearl or the uncursed version
Code:
 ///////////////////////////////////////////////////////////////////////////
 /// TheBlackPearl - Wicked Wench 
 ///////////////////////////////////////////////////////////////////////////
 makeref(refShip,ShipsTypes[SHIP_THEBLACKPEARL]);
 refShip.Name   = "TheBlackPearl";
 refship.Soundtype = "frigate";
 refShip.Class = 4;
 refShip.Cannon   = CANNON_TYPE_CANNON_LBS4;
 refShip.MaxCaliber   = 16;
 refShip.Weight = Tonnes2CWT(1000);
 refShip.Capacity   = 5800;
 refShip.CannonsQuantity = 36;
 refShip.rcannon  = 16;
 refShip.lcannon  = 16;
 refShip.fcannon  = 2;
 refShip.bcannon  = 2;
 refShip.MaxCrew   = 190;
 refShip.MinCrew   = 20;
 refShip.BoardingCrew = 26;
 refShip.GunnerCrew = 36;
 refShip.CannonerCrew = 72;
 refShip.SailorCrew = 60;
 refShip.SpeedRate   = 8.6;
 refShip.TurnRate   = 6.0;
 refShip.Price   = 70000;
 refShip.HP   = 3900;
 refShip.SP   = 250;
 refship.EmblemedSails.normalTex = "ships\sail_BlackPearl.tga";
 refShip.AbordageLocation = "Boarding Deck_01";
 refship.CanEncounter = false;
 refship.Type.Merchant = true;
 refship.Type.War = true;
 refShip.fWindAgainstSpeed = 4.0;
 refShip.sea_enchantment = 1.2;
 refShip.lowpolycrew  = 20;
 refShip.buildtime  = 100;
 
 refship.Rocking.y = 0.45;
 refship.Rocking.az = 0.35;
 
 refship.WaterLine = -0.7;
 refship.SpeedDependWeight = 0.3;
 refship.SubSeaDependWeight = 1.0;
 refship.TurnDependWeight = 0.3;
 refship.WindAgainstSpeed   = 3.6;//boal
 refship.CabinType   = "Cabin"; // boal 28.03.05
 refship.DeckType   = "Big";
 
 refship.InertiaAccelerationX = 5.0; refship.InertiaBrakingX = 5.0;
 refship.InertiaAccelerationY = 4; refship.InertiaBrakingY = 4;
 refship.InertiaAccelerationZ = 5.0; refship.InertiaBrakingZ = 5.0;
 
 refShip.Height.Bombs.Y = 1.0; refShip.Height.Bombs.DY = 0.5;
 refShip.Height.Grapes.Y = 2.0; refShip.Height.Grapes.DY = 1.0;
 refShip.Height.Knippels.Y = 10.0; refShip.Height.Knippels.DY = 8.0;
 refShip.Height.Balls.Y = 1.0; refShip.Height.Balls.DY = 0.5;
 
 refShip.GeraldSails.rey_b1 = 1;
 refShip.GeraldSails.rey_b2 = 1;
 refShip.GeraldSails.rey_b3 = 1;
 refShip.GeraldSails.rey_b1.vscale = 0.9;
 refShip.GeraldSails.rey_b2.vscale = 0.7;
 refShip.GeraldSails.rey_b3.vscale = 0.7;
 refship.Track.Enable = true;
 refship.Track1.ZStart = 0.20;
 refship.Track1.LifeTime  = 14.5;
 refship.Track1.Width = "3.7, 3.9";
 refship.Track1.Speed = "7.0, 8.0";
 refship.Track2.ZStart = -0.15;
 refship.Track2.LifeTime  = 8.5;
 refship.Track2.Width = "8.0, 9.0";
 refship.Track2.Speed = "0.15, 0.25";
 //Nation
  refShip.england = 1.0; //
  refShip.france = 0.0; //
  refShip.holland = 0.0; //
  refShip.pirate = 1.0; //
  refShip.spain = 0.0; //

Now the real Blackpearl and the one everyone knows and loves.

Code:
 ///////////////////////////////////////////////////////////////////////////
 /// BlackPearl 
 ///////////////////////////////////////////////////////////////////////////
 makeref(refShip,ShipsTypes[SHIP_BLACKPEARL]);
 refShip.Name   = "BlackPearl";
 refship.Soundtype = "frigate";
 refShip.Class = 4;
 refShip.Cannon   = CANNON_TYPE_CANNON_LBS4;
 refShip.MaxCaliber   = 16;
 refShip.Weight = Tonnes2CWT(1000);
 refShip.Capacity   = 4800;
 refShip.CannonsQuantity = 36;
 refShip.rcannon  = 16;
 refShip.lcannon  = 16;
 refShip.fcannon  = 2;
 refShip.bcannon  = 2;
 refShip.MaxCrew   = 190;
 refShip.MinCrew   = 20;
 refShip.BoardingCrew = 26;
 refShip.GunnerCrew = 36;
 refShip.CannonerCrew = 72;
 refShip.SailorCrew = 60;
 refShip.SpeedRate   = 13.5;
 refShip.TurnRate   = 8.0;
 refShip.Price   = 70000;
 refShip.HP   = 4800;
 refShip.SP   = 250;
 refship.EmblemedSails.normalTex = "ships\sail_BlackPearl.tga";
 refShip.AbordageLocation = "Boarding Deck_01";
 refship.CanEncounter = false;
 refship.Type.Merchant = true;
 refship.Type.War = true;
 refShip.fWindAgainstSpeed = 4.0;
 refShip.sea_enchantment = 1.2;
 refShip.lowpolycrew  = 20;
 refShip.buildtime  = 100;
 
 refship.Rocking.y = 0.45;
 refship.Rocking.az = 0.35;
 
 refship.WaterLine = -0.7;
 refship.SpeedDependWeight = 0.3;
 refship.SubSeaDependWeight = 1.0;
 refship.TurnDependWeight = 0.3;
 refship.WindAgainstSpeed   = 3.6;//boal
 refship.CabinType   = "Cabin"; // boal 28.03.05
 refship.DeckType   = "Big";
 
 refship.InertiaAccelerationX = 5.0; refship.InertiaBrakingX = 5.0;
 refship.InertiaAccelerationY = 4; refship.InertiaBrakingY = 4;
 refship.InertiaAccelerationZ = 5.0; refship.InertiaBrakingZ = 5.0;
 
 refShip.Height.Bombs.Y = 1.0; refShip.Height.Bombs.DY = 0.5;
 refShip.Height.Grapes.Y = 2.0; refShip.Height.Grapes.DY = 1.0;
 refShip.Height.Knippels.Y = 10.0; refShip.Height.Knippels.DY = 8.0;
 refShip.Height.Balls.Y = 1.0; refShip.Height.Balls.DY = 0.5;
 
 refShip.GeraldSails.rey_b1 = 1;
 refShip.GeraldSails.rey_b2 = 1;
 refShip.GeraldSails.rey_b3 = 1;
 refShip.GeraldSails.rey_b1.vscale = 0.9;
 refShip.GeraldSails.rey_b2.vscale = 0.7;
 refShip.GeraldSails.rey_b3.vscale = 0.7;
 refship.Track.Enable = true;
 refship.Track1.ZStart = 0.20;
 refship.Track1.LifeTime  = 14.5;
 refship.Track1.Width = "3.7, 3.9";
 refship.Track1.Speed = "7.0, 8.0";
 refship.Track2.ZStart = -0.15;
 refship.Track2.LifeTime  = 8.5;
 refship.Track2.Width = "8.0, 9.0";
 refship.Track2.Speed = "0.15, 0.25";
 //Nation
  refShip.england = 0.0; //
  refShip.france = 0.0; //
  refShip.holland = 0.0; //
  refShip.pirate = 1.0; //
  refShip.spain = 0.0; //

See this part

Code:
 ///////////////////////////////////////////////////////////////////////////
 /// TheBlackPearl - Wicked Wench
 ///////////////////////////////////////////////////////////////////////////

Its got Wicked Wench after its name (note this is not where you tell the game that this is the ships ingame name) anyway moving on to what you actually want to read. Bellow the name of the ship you have chosen (BlackPearl) you will see all the ship stats, the part in brackets is the part you need.

Code:
 makeref(refShip,ShipsTypes[SHIP_BLACKPEARL]);

"SHIP_BLACKPEARL" copy that and overwrite the previous ship name that was there. Now you have told the game that you want this ship to be considered when generating ships in the shipyard at that level, however there are just a few final things to do before you can move on to saving the file and testing your changes out ingame.

Code:
 if (iTest_ship == 2) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BLACKPEARL), "ship3");

Its this part at the start.

Code:
if (iTest_ship == 2

Change the 2 to what ever number should come next, 1, 2, 3, 4 etc in this case its 3. Save and exit, start your game and done.

Your changes should look as follow.

Code:
 if (iTest_ship == 3) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_BLACKPEARL), "ship3");
 
Hi again, thanks for all guys!I must ask - it is possible to make a ww2 ship playable in the game?I think that the only problem is rotation of turrets but they can be fixed and when the enemy ship will be in arc then they will aim on it.I think it is a good idea.Ultimate naval combat simulator.
 
WW2 ship in PotC? We do have steamships, so theoretically something like that could be faked.
Nobody is going to do it though. Doesn't fit it into the game at all. o_O
 
Back
Top