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

Unique Ship Cannons not Firing AND Vanderdecken Buyable Steamships

Very interesting!
All cannons DO fire once I use the console you provided (both manually and automatically)
I've also checked the ships_init file- all the 'CannonsQuantity' lines are correct... (didn't check the GM files... but I guess I no longer need to)

So... it must be a gameplay issue... yet even the AI captain on the Pearl you encounter in the standard storyline can't fire properly...
 
Very interesting indeed! That means that the model and code both are completely fine.
So then I think the only remaining reasons could be:
- Lack of a full crew compliment
- Lack of gunpowder and/or cannonballs
- Lack of cannon/accuracy skill of the captain and/or officers
- Cannons have been damaged in a fight (can't happen if you just got the ship)

Indeed there's no need to check the GM files anymore. :no
 
I'm still concerned, however, about the AI captain of the Pearl in the standard storyline- especially if it still occurs at Cozumel.
I'm not even sure about the Pearl/ Dutchman in the Jack Sparrow storyline yet... they may cause some issues if they won't fire...

And I wonder why only the Pearl/Dutchman require so much just to fire all the cannons? :shrug
 
I really haven't the foggiest; They always worked normally for me. :shrug
 
Just wondering about the Pearl in the standard quest... would it make a difference if I changed the captain's (i.e Barbossa's?) appropriate skill levels to 10?
Maybe then he would fire all the cannons...

OR could you point me in the direction of any files which dictate the skills required to fully operate a ship/ specific ships? :mm
Anything relevant might help- you never know!

Not a lot else I can think of... except that I must be cursed :cheeky

PS: Sorry for being so persistent on the subject, but it's really bugging me!
 
Setting Barbossa to 10 at everything certainly can't hurt.
Though it might require you to start a new game to check if he actually does fire all his cannons then.
 
I am experiencing a similar problem with the Dutchman and all but one variant of the Pearl. Pieter's console file is, usefully, the model that works for me...but, even replacing the Pearl there with the Dutchman results in the solo cannon fire.

The files I can view seem in order, but I have no idea how to look at the GM files...so I imagine that's where the problem lies...

Ps: Are you sure there's a skill-number of cannons firing correlation? I have captains with 1 or 2 skill in cannons and accuracy who manage to get all the guns to fire from a 3rd rate man-o'-war (with autoskills off), and that's without a gunner (seems to be the hardest officer for me to get my hands on...).
 
Hooray, I'm not alone!

Erm, anyway, slight change of what we originally thought: It's NOT a gameplay issue.
It appears that the model 'BlackPearl' is the ONLY variation which actually works- I've just tried the 'CursedDutchman' via the console- WITH all the skills and officers etc, yet it WON'T fire all the guns! :modding

Of course, the variant encountered in the standard storyline is the cursed one, so that's why it won't work correctly- I should have spotted this earlier. :facepalm
I assume that the Cursed and Uncursed Pearls use the 'BlackPearl' model, just with different sails... which makes it bizarre that they don't fire properly.

Looks like we WILL need to look at the GM files after all- is there a downloadable viewer somewhere?

In answer to Derkylos' note, I now assume there is no correlation between skills and firing cannons...which makes sense for all the other ships!
 
I just checked the "CursedDutchman" myself and CAN confirm the problem.
Strange though; we had that problem before, but we got it fixed. Seems it has somehow returned! :whipa
 
Problem confirmed for: "FlyingDutchman", "CursedDutchman" and SHIP_CURSED (=Cursed Black Pearl OR Cursed Crimson Blood).
What the *** is going on here??? Bizarrely enough, all incarnations of the Black Pearl use the same 3D model files,
but the SHIP_CURSED one doesn't work, while the other two and also the Wicked Wench do.
Additionally, the cursed Crimson Blood ALSO doesn't work, while THOSE are stock game files!!! :shock
 
Even more bizarre, it was perfectly fine in Build 14 Beta 1 Full. So it's something that the Patch does. Somehow. :modding
 
Ps: Are you sure there's a skill-number of cannons firing correlation? I have captains with 1 or 2 skill in cannons and accuracy who manage to get all the guns to fire from a 3rd rate man-o'-war (with autoskills off), and that's without a gunner (seems to be the hardest officer for me to get my hands on...).
Actually, I think you're right and there ISN'T a correlation between cannon skill and number of cannons that fire.
I just tested a level 1 character in B14 B1 Full and all cannons on the Cursed Dutchman fired properly, though not all at once.
I've been confused with the number of crew you've got onboard, which does have an impact on the number of cannons that fire if you have REALLY few.

BTW: If you can't find a gunner, you can always change another officer's role to that.
 
That's very interesting- perhaps a specific mod is affecting these models' ability to fire?

Hard to believe a stock game model doesn't work correctly... and I assume it wasn't tampered with too much?

How was the problem resolved last time?
 
The troublesome file was found! It's PROGRAM\Ships\ships.c .
If you return to the Build 14 Beta 1 Full version of the file, it all works again.
See attached. This had nothing to do with what caused the previous time we had not-firing cannons.

However, this is bad news in and of itself, because the only modification to that file was actually intended as a fix for another problem.
That problem was related to upgrading "unique" ships, which seem to also be the ones that are affected by this problem.
So the fix isn't quite a good fix yet.

Build 14 Beta 1 Patch 1 Code:
Code:
//KB Tuning ships, changed parameters - removed aref chrship and changed by int _idx //// NK PRS3 -->
void SetRandomStatsToShip(int _idx, int idx, int nat)
{
//KB - Tuning ships - changed calling parameters
if (_idx < 0) return;
aref chrship;
ref character;
if (_idx == GetMainCharacterIndex())
character = GetMainCharacter();
else
character = GetCharacter(_idx);
makearef(chrship, character.ship);
ref refShip = GetShipByType(idx); //this is our base

//if ship is not unique, modify stats
if (!GetAttribute(refShip, "unique")) arSetRandomStatsToShip(chrship, idx, nat);

//KB - Tuning ships
//KB Tuning ships <--
//KB - Tuning Ships - Adding random tuned chars to ships
InitTun(_idx);
int cost=0;
int time=0;
if (rand(99) <= sti(CPDISP) ) {ApplyTun(_idx,"cplates",cost,time) ;}
if (rand(99) <= sti(BCDISP) ) {ApplyTun(_idx,"bcannons",cost,time);}
if (rand(99) <= sti(GCDISP) ) { ApplyTun(_idx,"gchasers",cost,time);}
if (rand(99) <= sti(NSDISP) ) { ApplyTun(_idx,"nsails",cost,time);}
if (rand(99) <= sti(TMDISP) ) { ApplyTun(_idx,"ltopmasts",cost,time);}
if (rand(99) <= sti(SSDISP) ) {ApplyTun(_idx,"stays",cost,time);}
if (rand(99) <= sti(RHDISP) ) { ApplyTun(_idx,"rhull",cost,time);}
if (nat == PIRATE || character.nation == PIRATE ) { 
if (rand(99) <= sti(FLUSHEDPROB_IFPIRATE)) { ApplyTun(_idx,"flushed",cost,time); }
}
else {	
if (rand(99) <= sti(FLUSHEDPROB) )  ApplyTun(_idx,"flushed",cost,time); 
}
}
Build 14 Beta 1 Full code:
Code:
//KB Tuning ships, changed parameters - removed aref chrship and changed by int _idx 
//// NK PRS3 -->
void SetRandomStatsToShip(int _idx, int idx, int nat)
{
//KB - Tuning ships - changed calling parameters
if (_idx < 0) return;
aref chrship;
ref character;
if (_idx == GetMainCharacterIndex())
character = GetMainCharacter();
else
character = GetCharacter(_idx);
makearef(chrship, character.ship);
ref refShip = GetShipByType(idx); //this is our base

if (CheckAttribute(refShip, "unique")) {
if (sti(refShip.unique)) return; //if ship is unique, do not modify stats
}
if (CheckAttribute(chrship, "nomodstats")) {
if (sti(chrship.nomodstats)) return; //if flag set, do not mod stats
}

arSetRandomStatsToShip(chrship, idx, nat);

if (CheckAttribute(chrship, "standard")) {
if (sti(chrship.standard)) return; //if ship is "standard", do not tune her
}

//KB - Tuning ships
//KB Tuning ships <--
//KB - Tuning Ships - Adding random tuned chars to ships
InitTun(_idx);
int cost=0;
int time=0;
if (rand(99) <= sti(CPDISP) ) {ApplyTun(_idx,"cplates",cost,time) ;}
if (rand(99) <= sti(BCDISP) ) {ApplyTun(_idx,"bcannons",cost,time);}
if (rand(99) <= sti(GCDISP) ) { ApplyTun(_idx,"gchasers",cost,time);}
if (rand(99) <= sti(NSDISP) ) { ApplyTun(_idx,"nsails",cost,time);}
if (rand(99) <= sti(TMDISP) ) { ApplyTun(_idx,"ltopmasts",cost,time);}
if (rand(99) <= sti(SSDISP) ) {ApplyTun(_idx,"stays",cost,time);}
if (rand(99) <= sti(RHDISP) ) { ApplyTun(_idx,"rhull",cost,time);}
if (nat == PIRATE || character.nation == PIRATE ) { 
if (rand(99) <= sti(FLUSHEDPROB_IFPIRATE)) { ApplyTun(_idx,"flushed",cost,time); }
}
else {	
if (rand(99) <= sti(FLUSHEDPROB) )  ApplyTun(_idx,"flushed",cost,time); 
}
}
 
All the other unique ships fire all cannons, so... why are only the models mentioned the ones which are affected by the fix in patch 1?
And what was this upgrade issue with unique ships (so I know what to avoid doing now ;)) ?
 
What do you mean with "all the other unique ships"?
The ships you can't encounter and can't buy but can only get from Vanderdecken?
Those are not the ships that I mean with "unique" in this case.
I mean the ships that have the line refShip.unique = true; in ships_init.c .
There's only very few of these, mainly the Black Pearl, Flying Dutchman, Mefisto, Santiago and the two steamships you can buy from Vanderdecken.

Question to Captain Maggee: Why are those two set to "unique", but the regular two not?
This line does NOT trigger the appearance in Vanderdecken shipyard.
The "unique" attribute prevents the "random national modifiers" from being applied to these ships.

The "unique" problem that I understood from other people in the past is when you apply an "upgrade" to your ship,
weird things happen, ranging from the upgrade working fine to the ship being dead in the water and no longer going anywhere! :shock
 
Doing further research, it seems that allowing the arSetRandomStatsToShip() function to be run for "unique" ships causes their cannons to stop working.
Also, the Build 14 Beta 1 Patch 1 code did NOT prevent this code from being run, despite the code being written with the intention of doing just that.
The GetAttribute() function doesn't work as expected when preceded with the "!" (is "not") sign

Additionally, NOT running the following code for "unique" ships apparently causes issues when upgrading:
Code:
//KB - Tuning ships
//KB Tuning ships <--
//KB - Tuning Ships - Adding random tuned chars to ships
InitTun(_idx);
int cost=0;
int time=0;
if (rand(99) <= sti(CPDISP) ) {ApplyTun(_idx,"cplates",cost,time) ;}
if (rand(99) <= sti(BCDISP) ) {ApplyTun(_idx,"bcannons",cost,time);}
if (rand(99) <= sti(GCDISP) ) { ApplyTun(_idx,"gchasers",cost,time);}
if (rand(99) <= sti(NSDISP) ) { ApplyTun(_idx,"nsails",cost,time);}
if (rand(99) <= sti(TMDISP) ) { ApplyTun(_idx,"ltopmasts",cost,time);}
if (rand(99) <= sti(SSDISP) ) {ApplyTun(_idx,"stays",cost,time);}
if (rand(99) <= sti(RHDISP) ) { ApplyTun(_idx,"rhull",cost,time);}
if (nat == PIRATE || character.nation == PIRATE ) { 
if (rand(99) <= sti(FLUSHEDPROB_IFPIRATE)) { ApplyTun(_idx,"flushed",cost,time); }
}
else {	
if (rand(99) <= sti(FLUSHEDPROB) )  ApplyTun(_idx,"flushed",cost,time); 
}
However, if I DO allow that code to run, my CursedDutchman instantly SINKS when setting sail!!! :shock
 
mainly the Black Pearl, Flying Dutchman, Mefisto, Santiago and the two steamships you can buy from Vanderdecken.
Yes these ships (sorry, I should have been more specific).
I meant that I have used the Mefisto and 'unique' steamships countless times without this cannons issue, whereas the Pearl and Dutchman DID have the problem.
Therefore the removal of the 'unique' ships upgrade fix remedying the cannons issue seems weird... unless it is somehow linked to the cannon-related upgrades...? :shrug

PS: I guess I'd better not upgrade any of the above ships for now, just in case.

EDIT:
Sorry, slightly late reply!

EDIT2:
But the Dutchman is supposed to sail underwater... :cheeky
 
The following code DOES do what it's supposed to:
Code:
//KB Tuning ships, changed parameters - removed aref chrship and changed by int _idx 
//// NK PRS3 -->
void SetRandomStatsToShip(int _idx, int idx, int nat)
{
//KB - Tuning ships - changed calling parameters
if (_idx < 0) return;
aref chrship;
ref character;
if (_idx == GetMainCharacterIndex())
character = GetMainCharacter();
else
character = GetCharacter(_idx);
makearef(chrship, character.ship);
ref refShip = GetShipByType(idx); //this is our base

InitTun(_idx); //KB - Tuning ships

if (CheckAttribute(refShip, "unique")) {
if (sti(refShip.unique)) return; //if ship is unique, do not modify stats
}

arSetRandomStatsToShip(chrship, idx, nat);

//KB - Tuning ships
//KB Tuning ships <--
//KB - Tuning Ships - Adding random tuned chars to ships
int cost=0;
int time=0;
if (rand(99) <= sti(CPDISP) ) {ApplyTun(_idx,"cplates",cost,time) ;}
if (rand(99) <= sti(BCDISP) ) {ApplyTun(_idx,"bcannons",cost,time);}
if (rand(99) <= sti(GCDISP) ) { ApplyTun(_idx,"gchasers",cost,time);}
if (rand(99) <= sti(NSDISP) ) { ApplyTun(_idx,"nsails",cost,time);}
if (rand(99) <= sti(TMDISP) ) { ApplyTun(_idx,"ltopmasts",cost,time);}
if (rand(99) <= sti(SSDISP) ) {ApplyTun(_idx,"stays",cost,time);}
if (rand(99) <= sti(RHDISP) ) { ApplyTun(_idx,"rhull",cost,time);}
if (nat == PIRATE || character.nation == PIRATE ) { 
if (rand(99) <= sti(FLUSHEDPROB_IFPIRATE)) { ApplyTun(_idx,"flushed",cost,time); }
}
else {	
if (rand(99) <= sti(FLUSHEDPROB) )  ApplyTun(_idx,"flushed",cost,time); 
}
}
However, this does re-introduce the problems when doing upgrades on "unique" ships.
It seems the only reason why my Patch 1 "fix" worked for this at all was because the code DID end up running
arSetRandomStatsToShip() for unique ships, even though the code was intended to do the opposite. :modding

If you apply all upgrades to your ship, she won't sail forward anymore at all and the HP bar becomes black.
These are the accompanying errors from error.log:
Code:
RUNTIME ERROR - file: KB_routines.c; line: 396
missed attribute: speedrate
RUNTIME ERROR - file: KB_routines.c; line: 396
no rAP data
RUNTIME ERROR - file: KB_routines.c; line: 416
missed attribute: turnrate
RUNTIME ERROR - file: KB_routines.c; line: 416
no rAP data
RUNTIME ERROR - file: KB_routines.c; line: 436
missed attribute: hp
RUNTIME ERROR - file: KB_routines.c; line: 436
no rAP data
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 4235
Divide by zero
It seems that somehow characters with "unique" ships manage to not have certain "[char].ship.stats" attributes that the others DO get.
But WHY???
 
I meant that I have used the Mefisto and 'unique' steamships countless times without this cannons issue, whereas the Pearl and Dutchman DID have the problem.
Therefore the removal of the 'unique' ships upgrade fix remedying the cannons issue seems weird... unless it is somehow linked to the cannon-related upgrades...? :shrug
I don't totally understand either, but this is what my tests have led me to believe.
Weird that some of those ships I mentioned WOULD work, really.

PS: I guess I'd better not upgrade any of the above ships for now, just in case.
Indeed. Get the file I attached to one of my previous posts,
then don't upgrade any of the ship types I mentioned and you should be good.
All we need to figure out now is how to make those ships upgradable WITHOUT going wonky! :whipa

But the Dutchman is supposed to sail underwater... :cheeky
That's just what the MOVIES led you to believe! You know? Those movies featuring the SUBMERGING SCOTTSMAN??? :shock
Seriously, whoever thought that the Flying Dutchman should be captained by an apparently Scottish character and should not fly,
but dive instead, should have his brain checked. There's nothing in the ship's name to suggest anything even remotely resembling that!
 
Back
Top