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

New modder question.

Chemicalvamp

Landlubber
Hi everyone. At first i thought i knew what i was doing but now my game crashes when i try out my new ships <img src="style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />

All that i know i learned from dissecting supermods ship that was added. (searched all files to see what contained "british brig" and "Brig_rn")

Personally i like the corvette, its speed makes it a great boarding vessel, but after so long you need a better one.

so I made a new ship:
copied corvette_walk.c renamed it to clipper_walk.c
copied the Corvette1 models directory and renamed it to Clipper1 (also the files within i.e. Clipper1.gm)
copied the corvette interface thumbnail and renamed it to Clipper.tga.tx
copied the Corvette1 texture directory and renamed it to Clipper1 (also the files within hull 1 2 and 3 i.e. bortoutClipper1.tga.tx)

here are the changes i made to the game files:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
<b>Pictures.ini</b>
[SHIPS_clipper]
sTextureName = ships\clipper.tga
wTextureWidth = 128
wTextureHeight = 128
picture = ship,0,0,128,128
<b>common.ini</b>
String = Clipper, "Clipper"
String = Clipper_descr,"Description test clipper."
<b>ships.h</b>
#define SHIP_CLIPPER 14
<b>ships_init.c</b>
///////////////////////////////////////////////////////////////////////////
/// Clipper
///////////////////////////////////////////////////////////////////////////
makeref(refShip,ShipsTypes[SHIP_CLIPPER]);
refShip.Name = "Clipper";
refship.Soundtype = "corvette";
refShip.Class = 2;
refShip.Cannon = CANNON_TYPE_CANNON_LBS24;
refShip.MaxCaliber = 24;
refShip.Weight = Tonnes2CWT(700);
refShip.Capacity = 3100;
refShip.CannonsQuantity = 46;
refShip.rcannon = 19;
refShip.lcannon = 19;
refShip.fcannon = 4;
refShip.bcannon = 4;
refShip.MaxCrew = 320;
refShip.MinCrew = 32;
refShip.BoardingCrew = 160;
refShip.GunnerCrew = 40;
refShip.CannonerCrew = 92;
refShip.SailorCrew = 300;
refShip.SpeedRate = 18.5;
refShip.TurnRate = 52.0;
refShip.Price = 168000;
refShip.HP = 3200;
refShip.SP = 100;
refShip.AbordageLocation = "Boarding Deck_02";
refship.Type.Merchant = false;
refship.Type.War = true;
refShip.fWindAgainstSpeed = 2.8;
refShip.sea_enchantment = 2.1;
refShip.lowpolycrew = 12;
refShip.buildtime = 100;

</div>

And i got:
runtime error

I want to add about 8 ships, a few to every class.. mostly class 2, since theres only one. and make it include the ship that came with supermod, rar it and share..
I'm still messing around with it, i made two folders one has a copy of the supermod originals, and the second has my modified versions. ide upload it but its about 30 mb too big. please let me know if you need any more info!
 
If things work similar to PotC, you'd only need to make a copy of the ships_init entry and not any others.
Since there's no ID though, I'm a bit confused on what you'd need to change there. Probably "Name".
But you already did that and got an error. <img src="style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" />
 
in ships.H u need to increase #define SHIP_TYPES_QUANTITY by one

#define SHIP_TYPES_QUANTITY 20
 
Oooh! That is ONE thing we nicely DON'T have to do in PotC! <img src="style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" />
 
I just have this hunch its not ships.h

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>#define SAILS_COLOR_QUANTITY 8
#define SHIP_TYPES_QUANTITY 28
#define SHIP_TYPES_QUANTITY_WITH_FORT 29 // must be (SHIP_TYPES_QUANTITY + 1)


//6
#define SHIP_LUGGER 0
#define SHIP_SLOOP 1
#define SHIP_RUCKNER 2

//5
#define SHIP_SCHOONER 3
#define SHIP_BARQUE 4
#define SHIP_CARAVEL 5
#define SHIP_CENTANCE 6

//4
#define SHIP_FLEUT 7
#define SHIP_BRIG 8
#define SHIP_GALEON_L 9
#define SHIP_DORIANO 10
#define SHIP_BRIG_RN 11


//3
#define SHIP_CORVETTE 12
#define SHIP_GALEON_H 13
#define SHIP_PINNACE 14
#define SHIP_MINOC 15

//2
#define SHIP_MUSTANG 16
#define SHIP_CLIPPER 17
#define SHIP_RHINOC 18
#define SHIP_GATTEN 19

//1
#define SHIP_FRIGATE 20
#define SHIP_LINESHIP 21
#define SHIP_WARSHIP 22
#define SHIP_BATTLESHIP 23
#define SHIP_MANOWAR 24


//
#define SHIP_TARTANE 46
#define SHIP_WAR_TARTANE 47
#define SHIP_BOAT 48
#define SHIP_FORT 49

#define SHIP_NOTUSED 1000
#define SHIP_NOTUSED_TYPE_NAME "Not Used"
#define SHIP_NAME_NOTUSED "Noname"

object ShipsTypes[SHIP_TYPES_QUANTITY_WITH_FORT];
object SailsColors[SAILS_COLOR_QUANTITY];


ref GetShipByType(int iType) { return &ShipsTypes[iType]; }</div>

My hunch is that it is \program\scripts\utils.c
bacause its the only file i saw brig_rn that i didnt modify just cause i have no idea what im looking at
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
if(CheckAttribute(chr, "shipyard"))
{
return;
}

int iTest_ship;
int iBeginPoint, iEndPoint;
int iStep;
int iNation
string sStep;

DeleteAttribute(chr, "shipyard");

iTest_ship = rand(1);
chr.shipyard.ship1 = SHIP_TARTANE;

iStep = 2;
iNation = chr.nation;

string sLocation = pchar.location;
sLocation = Locations[FindLocation(sLocation)].fastreload;

int iShipYardLevel = sti(colonies[FindColony(sLocation)].shipyard);

if (iShipYardLevel == 1)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 2)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 3)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 4)
{
iEndPoint = SHIP_Brig_rn;
}

//trace("isl"+ iEndPoint);

int m = 2;
for (int i = SHIP_TARTANE; i <= SHIP_Brig_rn; i++)
{
iTest_ship = GenerateShip(i, 1);
sStep = "ship" + m;
chr.shipyard.(sStep) = iTest_ship;
if(i > iEndPoint)
{
chr.shipyard.(sStep).notforsale = 1;
}
m = m + 1;
}
</div>
 
have you change the texture path with a hexeditor??



if (iShipYardLevel == 1)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 2)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 3)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 4)
{
iEndPoint = SHIP_Brig_rn;
}

//trace("isl"+ iEndPoint);

CHANGE THE ENDPOINTS TO THE LAST SHIP OF THE CLASS. he last endpoint should be the MANOWAR.
 
That fixed it!

I admit i know absolutly no c++

I wanted to create variety for new players and myself but when you board a ship and take it over with supermod the ships stats arent shown. whats happened there?

I still don't know how to change the order of ships displayed in the shipyard. i dont like how it looks to go from class 6 to 1 and then any ships i add, What ide like to do is keep them in order add as many ships as it takes to have 5 or 6 in each class with varying features, and raise prices make the game a little harder. variety is good right.. i still cant believe the game was released with ONE class 2 ship (and that i was able to board and take over a man-o-war with a corvette 0.o at level 12)
 
Someone should make a "How To" post in the tutorials section...
 
Back
Top