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

Cannons powder consumption/caliber fix

Hrv123

Landlubber
This fix Il post will connect your guns gunpowder consumption to their caliber size.
Once old data is replaced with new one saved games will work with no problem. Tested for couple h on 12 and 36 caliber guns, rely should not be any problem.

1. GO to ...Program\SEA_AI\ and open there AICannon.c

2. Almost at top you find :
...More text up
bool Cannon_LoadBall()
{
aref aCharacter = GetEventData();

int iBallType = sti(aCharacter.Ship.Cannons.Charge.Type);
int iNumBalls = GetCargoGoods(aCharacter, iBallType);
// boal -->
int iNumPowder = GetCargoGoods(aCharacter, GOOD_POWDER);
if (iNumBalls > 0 && iNumPowder > 0)
{
AddCharacterGoodsCannon(aCharacter, iBallType, -1);
AddCharacterGoodsCannon(aCharacter, GOOD_POWDER, -1);
// boal <--
return true;
}
return false;
}

void Cannon_UnloadBall()
{
aref aCharacter = GetEventData();

AddCharacterGoodsCannon(aCharacter, sti(aCharacter.Ship.Cannons.Charge.Type), 1);
// boal -->
AddCharacterGoodsCannon(aCharacter, GOOD_POWDER, 1);
// boal <--
}
More text down...


Now replace that section with next one (Changed/added text is coloured red):
...More text up
float Cannon_LoadBall()
{
aref aCharacter = GetEventData();
ref rCannon = GetCannonByType(sti(aCharacter.Ship.Cannons.Type));
float fPU = (stf(rCannon.caliber)/4);
int iBallType = sti(aCharacter.Ship.Cannons.Charge.Type);
int iNumBalls = GetCargoGoods(aCharacter, iBallType);
// boal -->
int iNumPowder = GetCargoGoods(aCharacter, GOOD_POWDER);
if (iNumBalls > 0 && iNumPowder > 0)
{
AddCharacterGoodsCannon(aCharacter, iBallType, -1);
AddCharacterGoodsCannon(aCharacter, GOOD_POWDER, -fPU);
// boal <--
return true;
}
return false;
}

float Cannon_UnloadBall()
{
aref aCharacter = GetEventData();
ref rCannon = GetCannonByType(sti(aCharacter.Ship.Cannons.Type));
float fPU = (stf(rCannon.caliber)/4);


AddCharacterGoodsCannon(aCharacter, sti(aCharacter.Ship.Cannons.Charge.Type), 1);
// boal -->
AddCharacterGoodsCannon(aCharacter, GOOD_POWDER, fPU);
// boal <--
}
More text down...

3. Save that to file and load your game to fix start to work.

Part that control things dont go out of the window is "/4". I found that number fine value for me when having small caliber and 36 caliber guns, logical for me at last :p. For further tweaking powder consumption regard to caliber you only need to change that number.
Thats it :)

p.s.
Powder consumption goes up considerably when you have all maxed caliber guns on 100 guns ship(s) so possible additional game balancing will be needed on it as GOODs and on it quantities on AI ships and in ports (dont know how much shorter time with this AI Tier 1 ships with 24/36 calibers have for gunfire exchange before they go out of powder!).

EDIT: Actually maybe better number should be /12 instead of /4, damn powder going all out in smoke in speed of light...
 
Nice you fixed the powder consumption for each gun type, i never understood why in this type of game when the bigger the gun the more powder would be used this feature wasn't included but then the same can be said for other things like in POTC how the weather changes every hour. Anyway thanks for this it will work very well with peoples mods and i will include this in the real time battle light mod i'm working on, thanks for your hard work to get this to work. :onya
 
Nice work HRV123! :onya This is right in line with a comment I made about powder consumption in an earlier thread concerning my desire for higher fidelity cannon simulation. Luke, Nixarass, et al, we should bundle this in with the other stuff you guys have been working on. A few more good tweaks like this and we will have our comprehensive high fidelity cannon play.

So now we have rate of fire, accurate powder consumption, so now my three greatest desires for remaining for guns, are for bronze guns back into the game, accurate historical gun vending/availability by nationality/port, and cannon availability by year/era. :will

V/R NK
 
You guys help me figure out why bl.... sun is having life of its own on daily sky and ill help on bronze ammo/canons/powder consumption :wp
:sail
 
You guys help me figure out why bl.... sun is having life of its own on daily sky and ill help on bronze ammo/canons/powder consumption :wp
:sail

Are you bribing us. :rolleyes:

Well i'm looking but i'm new to this modding so i might over look some lines of code and think other lines that stick out are easily missed. xD:
 
You guys help me figure out why bl.... sun is having life of its own on daily sky and ill help on bronze ammo/canons/powder consumption :wp
:sail

Are you bribing us. :rolleyes:

funny-pictures-pirate-cat.jpg


http://www.youtube.com/watch?v=RisL9l8HzmM

:cheeky
 
Back
Top