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

ADD Ships and Cannons to AoP 2

I got a few runtime errors while trying to get my ship in, and after learning basic modding from S.T.A.L.K.E.R i guessed that it was something in front of the keyboard that caused the problem (aka me). Sure enough with this i'd go through and find i'd done a typo, or forgot a line, /commented something, etc.

So if you come across a runtime error then you might want to check what you added in, cause those error mean from my POV that the game knows you've changed something but it doesn't make sense, ala you are confusing it.
 
Hey, yep, i'm sure i did something, not sure what, i simply undid everything (i had backups) and followed the other guide... before that i corrected by hand the ship lines, deleted the cannon lines and the error was different... but i'm not up for struggles with code this days... (1 day off work every 15 so i'm all messed up)
 
Could anyone here please show me how to unlock those 92lbs cannons properly? I followed Philippe's instruction, but I could not get it to work. Thank you so much! <img src="style_emoticons/<#EMO_DIR#>/bow.gif" style="vertical-align:middle" emoid=":bow" border="0" alt="bow.gif" />
 
Hi, I sent you a mail, but forgot ask you which sort of ship you choose, so I can try to do the work and see what's wrong...
 
<!--quoteo(post=323524:date=May 29 2009, 05:22 PM:name=GHOSTMD)--><div class='quotetop'>QUOTE (GHOSTMD @ May 29 2009, 05:22 PM) <a href="index.php?act=findpost&pid=323524"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><img src="http://forum.piratesahoy.net//public/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />

What i want is: has anyone a clue HOW to Add new ships and cannons to AoP 2???

THX<!--QuoteEnd--></div><!--QuoteEEnd-->


Hello, I have. My ship is from Arabella, called "Vette" in new files:

In ship_init:

makeref(refShip,ShipsTypes[SHIP_VETTE]);
refShip.Name = "Vette";
refship.Soundtype = "manowar";
refShip.Class = 7;
refShip.Cannon = CANNON_TYPE_CANNON_LBS92;
refShip.MaxCaliber = 92;
refShip.Weight = Tonnes2CWT(600);
refShip.Capacity = 8250;
refShip.CannonsQuantity = 62;//= 52;
refShip.rcannon = 25;//= 22;
refShip.lcannon = 25;//= 22;
refShip.fcannon = 6;//= 4;
refShip.bcannon = 6;//= 4;
refShip.MaxCrew = 800;
refShip.MinCrew = 120;
refShip.BoardingCrew = 440;
refShip.GunnerCrew = 100;
refShip.CannonerCrew = 128;
refShip.SailorCrew = 800;
refShip.SpeedRate = 45.1;//= 30.2;
refShip.TurnRate = 55.0;
refShip.Price = 80000;
refShip.HP = 3450;
refShip.SP = 100;
//refShip.AbordageLocation = "Boarding Deck_01";
refship.Type.Merchant = false;
refship.Type.War = true;
refShip.fWindAgainstSpeed = 2.2;
refShip.sea_enchantment = 1.5;
refShip.lowpolycrew = 16;
refShip.buildtime = 80;

refship.Rocking.y = 0.8;
refship.Rocking.az = 0.025;

refship.WaterLine = -0.4;
refship.SpeedDependWeight = 0.3;
refship.SubSeaDependWeight = 0.7;
refship.TurnDependWeight = 0.35;
refship.WindAgainstSpeed = 4.8;//boal
refship.CabinType = "Cabin_Medium"; // boal 28.03.05

refship.InertiaAccelerationX = 8.0; refship.InertiaBrakingX = 8.0;
refship.InertiaAccelerationY = 6; refship.InertiaBrakingY = 6;
refship.InertiaAccelerationZ = 6.0; refship.InertiaBrakingZ = 6.0;

refShip.GeraldSails.rey_b2 = 1;
refShip.GeraldSails.rey_b3 = 1;
refShip.GeraldSails.rey_b2.vscale = 0.7;
refShip.GeraldSails.rey_b3.vscale = 0.7;

refship.Track.Enable = true;
refship.Track1.ZStart = 0.17;
refship.Track1.LifeTime = 12.5;
refship.Track1.Width = "4.0, 5.0";
refship.Track1.Speed = "6.0, 8.0";

refship.Track2.ZStart = -0.15;
refship.Track2.LifeTime = 6.5;
refship.Track2.Width = "5.0, 7.0";
refship.Track2.Speed = "0.15, 0.25";

In ship.h

#define SHIP_TYPES_QUANTITY 29//28<=Philippe

#define SHIP_TYPES_QUANTITY_WITH_FORT 31//30 // must be (SHIP_TYPES_QUANTITY + 1)

#define SHIP_FLYINGDUTCHMAN 26
#define SHIP_VETTE 27
//
#define SHIP_BOAT 28//27
#define SHIP_FORT 29//28


In Battleinterface.c

case "Vette"://Philippe
BI_intNRetValue[0] = 4+3*8; <== must be same values as model ship you choose
BI_intNRetValue[1] = 4+3*8 + 1;
BI_intNRetValue[2] = BI_ICONS_TEXTURE_SHIP1;
break;

And then in RESOURCE\MODELS\Ships créate "Vette1" folder, rename *.gm Vette1,
and in RESOURCE\Textures\Ships créate "Vette1" folder and put your texture.tga in.


//////// For cannons (I unlocked Lbs92 for my ship):

In cannons.c add these lines:

case 92://Philippe
return CANNON_TYPE_CANNON_LBS92;
break;

In cannons.h

#define CANNON_TYPES_QUANTITY 11//10<=Philippe

#define CANNON_TYPE_CANNON_LBS92 10

case CANNON_TYPE_CANNON_LBS92:
return 92;
break;

In cannons_init

makeref(rCannon,Cannon[CANNON_TYPE_CANNON_LBS92]);
rCannon.type = CANNON_NAME_CANNON;
rCannon.caliber = 92;
rCannon.name = "caliber92";
rCannon.picture = "cannons8";
rCannon.Sound = "fort_cannon_fire";
rCannon.ReloadTime = 20;
rCannon.Cost = 2000;
rCannon.Weight = 50;
rCannon.FireAngMax = 0.80;
rCannon.FireAngMin = -0.35;
rCannon.DamageMultiply = 40.0;
rCannon.TimeSpeedMultiply = 0.8;
rCannon.BigBall = 0;
rCannon.SizeMultiply = 5.0;
rCannon.HeightMultiply = 1.0;
rCannon.TradeOff = true;
rCannon.hp = 80.0;
InitBaseCannons_CalcSpeedV0(&rCannon,1650.0);

In initgoods.c (you can buy them)

Goods[GOOD_CANNON_92].Name = "Cannon_92";//Philippe
Goods[GOOD_CANNON_92].CannonIdx = CANNON_TYPE_CANNON_LBS92;
Goods[GOOD_CANNON_92].Cost = Cannon[CANNON_TYPE_CANNON_LBS92].Cost;
Goods[GOOD_CANNON_92].Weight = Cannon[CANNON_TYPE_CANNON_LBS92].Weight;
Goods[GOOD_CANNON_92].Units = 1;
Goods[GOOD_CANNON_92].AfraidWater = 0;
Goods[GOOD_CANNON_92].type = TRADE_TYPE_CANNONS;
Goods[GOOD_CANNON_92].canbecontraband = 0;
Goods[GOOD_CANNON_92].FireRange = Cannon[CANNON_TYPE_CANNON_LBS92].FireRange;
Goods[GOOD_CANNON_92].DamageMultiply=Cannon[CANNON_TYPE_CANNON_LBS92].DamageMult
iply;
Goods[GOOD_CANNON_92].ReloadTime=sti(GetCannonReloadTime(Cannon[CANNON_TYPE_CANN
ON_LBS92]));


In ispyglass

case CANNON_TYPE_CANNON_LBS92:
CannonTypeName = " " + xiDStr("CannonTypeName_92");
break;

In ShipsUtilite.c (after (case 42:
iCaliber = 4;
break;)) add/modify

case 92:
iCaliber = 5;
break;
}
iCaliber = iCaliber + rand(2) - 1;
if (iCaliber < 0) iCaliber = 0;
if (rRealShip.BaseName == "Manowar")
{
if (iCaliber > 5) iCaliber = 5;
}
else
{
if (iCaliber > 3) iCaliber = 3;
}
//Philippe=>
if (rRealShip.BaseName == "Vette")
{
if (iCaliber > 5) iCaliber = 5;
}
//<=
switch(iCaliber)
{
case 0:
iCaliber = 12;
break;
case 1:
iCaliber = 16;
break;
case 2:
iCaliber = 24;
break;
case 3:
iCaliber = 32;
break;
case 4:
iCaliber = 42;
break;
case 5:
iCaliber = 92;
break;

I hope I didn't forget some lines.... <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />



__________________________________

Interesting indeed but very cryptic. post a copy of your modify files so that people can examine the actual changes. Now to my post..... I would like to know if anyone knows which specific files (and their locations) are required to ad your own custom cannons.. just so I am clear, I want all the standard cannons to appear as shipped with the vanilla game but above that I want to add say 20lbs cannons or 10lbs.... Which files are required, I know all cannon files, common.ini in text sub folder (although not sure what does).... what else am i missing, I was able to get the game to understand that my custom 20's exist (no crashing at all) however, they dont show in the player menu (f2/ships menu) nor do they show in the "remove all/fix all screen for cannons" and of course they dont show in storez either.... I clearly need some help and I just dont have the time to learn another language to mod a game (i learned rudamentary german in order to mod Drakensang, learing russian to read forms is a little extreme... even for me, at least with drakensang the back end was german but the structure of files was easy to make sense of... this game is like a choose your own adventure when it comes to modding, 17 places to mod for 1 thing, oh which one did i forget or not know about???) sorry for the drama but A., I'm really not new to modding I (I've modded many engines from Aurora down) and B., Because of a "A" I seem to have no patience left trying to get the result I want. Any help is appreciated and soon (hopefully b4 I spontaniously combust)
 
<!--quoteo(post=323524:date=May 29 2009, 05:22 PM:name=GHOSTMD)--><div class='quotetop'>QUOTE (GHOSTMD @ May 29 2009, 05:22 PM) <a href="index.php?act=findpost&pid=323524"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><img src="http://forum.piratesahoy.net//public/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />

What i want is: has anyone a clue HOW to Add new ships and cannons to AoP 2???

THX<!--QuoteEnd--></div><!--QuoteEEnd-->


Hello, I have. My ship is from Arabella, called "Vette" in new files:

In ship_init:

makeref(refShip,ShipsTypes[SHIP_VETTE]);
refShip.Name = "Vette";
refship.Soundtype = "manowar";
refShip.Class = 7;
refShip.Cannon = CANNON_TYPE_CANNON_LBS92;
refShip.MaxCaliber = 92;
refShip.Weight = Tonnes2CWT(600);
refShip.Capacity = 8250;
refShip.CannonsQuantity = 62;//= 52;
refShip.rcannon = 25;//= 22;
refShip.lcannon = 25;//= 22;
refShip.fcannon = 6;//= 4;
refShip.bcannon = 6;//= 4;
refShip.MaxCrew = 800;
refShip.MinCrew = 120;
refShip.BoardingCrew = 440;
refShip.GunnerCrew = 100;
refShip.CannonerCrew = 128;
refShip.SailorCrew = 800;
refShip.SpeedRate = 45.1;//= 30.2;
refShip.TurnRate = 55.0;
refShip.Price = 80000;
refShip.HP = 3450;
refShip.SP = 100;
//refShip.AbordageLocation = "Boarding Deck_01";
refship.Type.Merchant = false;
refship.Type.War = true;
refShip.fWindAgainstSpeed = 2.2;
refShip.sea_enchantment = 1.5;
refShip.lowpolycrew = 16;
refShip.buildtime = 80;

refship.Rocking.y = 0.8;
refship.Rocking.az = 0.025;

refship.WaterLine = -0.4;
refship.SpeedDependWeight = 0.3;
refship.SubSeaDependWeight = 0.7;
refship.TurnDependWeight = 0.35;
refship.WindAgainstSpeed = 4.8;//boal
refship.CabinType = "Cabin_Medium"; // boal 28.03.05

refship.InertiaAccelerationX = 8.0; refship.InertiaBrakingX = 8.0;
refship.InertiaAccelerationY = 6; refship.InertiaBrakingY = 6;
refship.InertiaAccelerationZ = 6.0; refship.InertiaBrakingZ = 6.0;

refShip.GeraldSails.rey_b2 = 1;
refShip.GeraldSails.rey_b3 = 1;
refShip.GeraldSails.rey_b2.vscale = 0.7;
refShip.GeraldSails.rey_b3.vscale = 0.7;

refship.Track.Enable = true;
refship.Track1.ZStart = 0.17;
refship.Track1.LifeTime = 12.5;
refship.Track1.Width = "4.0, 5.0";
refship.Track1.Speed = "6.0, 8.0";

refship.Track2.ZStart = -0.15;
refship.Track2.LifeTime = 6.5;
refship.Track2.Width = "5.0, 7.0";
refship.Track2.Speed = "0.15, 0.25";

In ship.h

#define SHIP_TYPES_QUANTITY 29//28<=Philippe

#define SHIP_TYPES_QUANTITY_WITH_FORT 31//30 // must be (SHIP_TYPES_QUANTITY + 1)

#define SHIP_FLYINGDUTCHMAN 26
#define SHIP_VETTE 27
//
#define SHIP_BOAT 28//27
#define SHIP_FORT 29//28


In Battleinterface.c

case "Vette"://Philippe
BI_intNRetValue[0] = 4+3*8; <== must be same values as model ship you choose
BI_intNRetValue[1] = 4+3*8 + 1;
BI_intNRetValue[2] = BI_ICONS_TEXTURE_SHIP1;
break;

And then in RESOURCE\MODELS\Ships créate "Vette1" folder, rename *.gm Vette1,
and in RESOURCE\Textures\Ships créate "Vette1" folder and put your texture.tga in.


//////// For cannons (I unlocked Lbs92 for my ship):

In cannons.c add these lines:

case 92://Philippe
return CANNON_TYPE_CANNON_LBS92;
break;

In cannons.h

#define CANNON_TYPES_QUANTITY 11//10<=Philippe

#define CANNON_TYPE_CANNON_LBS92 10

case CANNON_TYPE_CANNON_LBS92:
return 92;
break;

In cannons_init

makeref(rCannon,Cannon[CANNON_TYPE_CANNON_LBS92]);
rCannon.type = CANNON_NAME_CANNON;
rCannon.caliber = 92;
rCannon.name = "caliber92";
rCannon.picture = "cannons8";
rCannon.Sound = "fort_cannon_fire";
rCannon.ReloadTime = 20;
rCannon.Cost = 2000;
rCannon.Weight = 50;
rCannon.FireAngMax = 0.80;
rCannon.FireAngMin = -0.35;
rCannon.DamageMultiply = 40.0;
rCannon.TimeSpeedMultiply = 0.8;
rCannon.BigBall = 0;
rCannon.SizeMultiply = 5.0;
rCannon.HeightMultiply = 1.0;
rCannon.TradeOff = true;
rCannon.hp = 80.0;
InitBaseCannons_CalcSpeedV0(&rCannon,1650.0);

In initgoods.c (you can buy them)

Goods[GOOD_CANNON_92].Name = "Cannon_92";//Philippe
Goods[GOOD_CANNON_92].CannonIdx = CANNON_TYPE_CANNON_LBS92;
Goods[GOOD_CANNON_92].Cost = Cannon[CANNON_TYPE_CANNON_LBS92].Cost;
Goods[GOOD_CANNON_92].Weight = Cannon[CANNON_TYPE_CANNON_LBS92].Weight;
Goods[GOOD_CANNON_92].Units = 1;
Goods[GOOD_CANNON_92].AfraidWater = 0;
Goods[GOOD_CANNON_92].type = TRADE_TYPE_CANNONS;
Goods[GOOD_CANNON_92].canbecontraband = 0;
Goods[GOOD_CANNON_92].FireRange = Cannon[CANNON_TYPE_CANNON_LBS92].FireRange;
Goods[GOOD_CANNON_92].DamageMultiply=Cannon[CANNON_TYPE_CANNON_LBS92].DamageMult
iply;
Goods[GOOD_CANNON_92].ReloadTime=sti(GetCannonReloadTime(Cannon[CANNON_TYPE_CANN
ON_LBS92]));


In ispyglass

case CANNON_TYPE_CANNON_LBS92:
CannonTypeName = " " + xiDStr("CannonTypeName_92");
break;

In ShipsUtilite.c (after (case 42:
iCaliber = 4;
break;)) add/modify

case 92:
iCaliber = 5;
break;
}
iCaliber = iCaliber + rand(2) - 1;
if (iCaliber < 0) iCaliber = 0;
if (rRealShip.BaseName == "Manowar")
{
if (iCaliber > 5) iCaliber = 5;
}
else
{
if (iCaliber > 3) iCaliber = 3;
}
//Philippe=>
if (rRealShip.BaseName == "Vette")
{
if (iCaliber > 5) iCaliber = 5;
}
//<=
switch(iCaliber)
{
case 0:
iCaliber = 12;
break;
case 1:
iCaliber = 16;
break;
case 2:
iCaliber = 24;
break;
case 3:
iCaliber = 32;
break;
case 4:
iCaliber = 42;
break;
case 5:
iCaliber = 92;
break;

I hope I didn't forget some lines.... <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />



__________________________________

Interesting indeed but very cryptic. post a copy of your modify files so that people can examine the actual changes. Now to my post..... I would like to know if anyone knows which specific files (and their locations) are required to ad your own custom cannons.. just so I am clear, I want all the standard cannons to appear as shipped with the vanilla game but above that I want to add say 20lbs cannons or 10lbs.... Which files are required, I know all cannon files, common.ini in text sub folder (although not sure what does).... what else am i missing, I was able to get the game to understand that my custom 20's exist (no crashing at all) however, they dont show in the player menu (f2/ships menu) nor do they show in the "remove all/fix all screen for cannons" and of course they dont show in storez either.... I clearly need some help and I just dont have the time to learn another language to mod a game (i learned rudamentary german in order to mod Drakensang, learing russian to read forms is a little extreme... even for me, at least with drakensang the back end was german but the structure of files was easy to make sense of... this game is like a choose your own adventure when it comes to modding, 17 places to mod for 1 thing, oh which one did i forget or not know about???) sorry for the drama but A., I'm really not new to modding I (I've modded many engines from Aurora down) and B., Because of a "A" I seem to have no patience left trying to get the result I want. Any help is appreciated and soon (hopefully b4 I spontaniously combust)

The above code for adding 92 pounder cannons to the game doesn't work something has been missed, i kept getting run time errors when loading the game. I removed the code for the spy glass.

Code:
In ispyglass

case CANNON_TYPE_CANNON_LBS92:
CannonTypeName = " " + xiDStr("CannonTypeName_92");
break;

And the game started loading fine however there is now a new problem, when you visit either the store or the shipyard and try to buy cannons you will see the following.




Anyone got any idea's why this is happening and how to fix it? Ie which files need to be edited etc?
 
Back
Top