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

Solved Merchant flags and Ship collision damage

Nethaeru

Powder Monkey
Storm Modder
Is it possible to fly a merchant flag in another way than choosing it as a personal flag? Like still getting the relations from that faction without flying the navy flag?

Also, is it possible to reduce/disable damage from collisions with land or other ships? The AI seems to love to smash into the rocks or the enemy ships.

Thank you in advance :onya
 
You could try sailing a merchant ship. Those default to the merchant flags and some of them are pretty powerful, like the pinnace of war with 54-24 pounders and 500 crew.

Yes the AI are kinda dumb. There is not much we can do about that except carry sail cloth and planks for repairs. You don't have too many choices for orders but it is usually possible to get out of harbor with them undamaged.

Battles? They are all over the place.
 
Also, is it possible to reduce/disable damage from collisions with land or other ships? The AI seems to love to smash into the rocks or the enemy ships.

Thank you in advance :onya


If you have cheat mode enabled - see bottom of InternalSettings.h file in the PROGRAM folder for this.

Ensure the On-Screen log messages are set to Verbose ( press the L key to cycle through settings ) - this will enable you to see which Officer & Companion Captain you are dealing with.

Then you can use the Numberpad numbers 1 & 3 to scroll through your 3 officers and your companion ships.

Find the companion Captain by name and Press Numberpad 0

This will give the companion Captain God mode :yes ( it will stop damage to his ships hull - & crew I think, but won't affect the damage to sails and masts. )

I think this is the only current way to reduce the damage to companion ships:read

The Numberpad key assignments and the other default key assignments are listed in the text file Default Key Assignments - in the Documentation folder.


:cheers
 
You could try sailing a merchant ship. Those default to the merchant flags and some of them are pretty powerful, like the pinnace of war with 54-24 pounders and 500 crew.
I was under the impression that my European Barque was a merchant ship due to its large cargo space and high speed, guess that explains why it didn't fly a merchant flag. Now i kinda feel like an idiot :confused:

I'm hoping theres a setting for the collision damage that can be disabled, i'm gonna snoop around for that some more.

Thanks alot though!
 
God mode is definitely an option when sailing out of ports/around islands. but i'd rather have it disabled when in combat otherwise that would get kinda dull and easy :D
My main problem in combat is that they'd sail into the enemy ships at some point ruining the whole encounter for me. I'm sure ramming was a real strategy back in the day but still.... i'd rather have my ships remain intact. :p
 
I was under the impression that my European Barque was a merchant ship due to its large cargo space and high speed, guess that explains why it didn't fly a merchant flag. Now i kinda feel like an idiot :confused:

I'm hoping there's a setting for the collision damage that can be disabled, I'm gonna snoop around for that some more.

Thanks a lot though!


Eh???? The European Barque IS a merchant ship and should fly the merchant flag. I just checked in shipsinit.c and it is set up that way.

Now some of the other Barques like, the Jackass Barque, are also used as Pirate ships and are set up as both war and merchant ships. Those might not get the merchant flag.
 
Eh???? The European Barque IS a merchant ship and should fly the merchant flag. I just checked in shipsinit.c and it is set up that way.

Now some of the other Barques like, the Jackass Barque, are also used as Pirate ships and are set up as both war and merchant ships. Those might not get the merchant flag.
How peculiar, i tried it with a heavy lugger and it has the merchant flag, though i did notice the smaller flags (Pennant flags?) have the England flags on them, i might've confused it to it being the White Ensign flag since the European Bargue has no large flag to show if its Merchant or War. My mistake :oops:
 
For the player ship, the distinction between merchant and navy ensign does NOT depend on the ship type.
Rather, if you have no LoM then you'll always fly the merchant flag and if you DO have one, you get the navy ensign.
This applies to companion ships as well.
 
I think it would be an idea to disable the collision damage between AI ships and AI and land. and only count collision damage if you are included. But I don't know for sure if we can make that work in the code.
 
That looks to be handled with SHIP_SHIP2SHIP_COLLISION and SHIP_SHIP2ISLAND_COLLISION and some EventHandlers in AIShip.c .
Not sure if that can be prevented by us. That's game engine stuff.
 
I think we can.
after this piece of code
Code:
ref rOurCharacter = GetCharacter(iOurCharacterIndex);

you know who it is. Now I only have to look how this is returned exactly and I think if you just do a check there if this character is equal to the main character (the playable one). and if thats true you execute the rest of the code and else you return. I think that should do it for both ship2ship and ship2island.

I could look into it if people think that would be nice.
Changin the whole AI so they wont try to hit each otheras often would be a lot harder.
 
You're right; that might work. :yes

Perhaps have it difficulty-related? Or have a Realism Mode check? Seems a bit of a shame to reduce the realism due to AI incompetence. :facepalm
 
Ill leave the coding up to you guys but if you can stop the AI from killing themselves that would be great.

No collision damage would definitely be a dent in the realism sector but it's just so much of a nuisance when your awesome battle is ended because everyone decided to sail into each other.
I don't think many people will have a problem with it being gone though, The only time collision damage would be applicable is if you desperately needed to ram your enemy to deal some damage, but if that's the case i'd prefer to just disengage anyways.
Perhaps make it a toggleable option in InternalSettings.h so the players themselves can decide on what they prefer.:onya
 
I've managed to disable all collision damage to hull and masts by changing all collision damage to *0 at the end.
The ship is still damaged by cannon fire, ship fire, storms and all other forms of damage.

under float Ship_MastDamage:
fDamage = fDamage + MAST_ISLAND_SCL * 0;
fDamage = fDamage + MAST_SHIP_SCL * 0;


under void Ship_Ship2IslandCollision:
float fHP = (1.0 - fSlide) * fPower * 0;

under void Ship_Ship2ShipCollision:
float fHP = (1.0 - fSlide) * fPower * 0;
It's a somewhat crude way to fix it but it got the job done. :onya

I do hope Levis can make an exception with the player ship as that is far outside of my ability to do so.

It might be more balanced/realistic to keep fDamage = fDamage + MAST_SHIP_SCL * 0; as the original *collhp;
that way there's still some form of damage done when ships happen to collide. It won't destroy the ship but will destroy the front mast which will give it a speed penalty.
 
I think this is what Levis was suggesting:
Code:
void Ship_Ship2IslandCollision()
{
   float   fPower, fSlide, x, y, z;
   int     iOurCharacterIndex, iEnemyCharacterIndex, iTouchPoint;

   iOurCharacterIndex = GetEventData();
   iEnemyCharacterIndex = GetEventData();
   fPower = abs(GetEventData());
   fSlide = abs(GetEventData());
   iTouchPoint = GetEventData();
   x = GetEventData();
   y = GetEventData();
   z = GetEventData();

   ref rOurCharacter = GetCharacter(iOurCharacterIndex);
   if(!IsMainCharacter(rOurCharacter)) return; // PB: Collision damage for player ship only
Can be applied in the exact same way to Ship_Ship2ShipCollision .
This is completely untested though.
 
thats what I tought yes. I will see to it this week. Will see if I can just make it troggable in the menu. So you can choose to have no collision damage at all. Only when the player is involved or at all times.
 
That is easily done. Files to be edited:
PROGRAM\BuildSettings.h
PROGRAM\INTERFACE\option_sl.c
RESOURCE\INI\TEXTS\ENGLISH\SettingsDescribe.txt

I always prefer not to have too many options in the Game Preferences menu though. Have put in quite some effort to clean it up over the past several months.
Since it is a bit of a cheat, perhaps it could go together at the bottom of PROGRAM\InternalSettings.h?
 
Umm, not having GA appear automatically as soon as you approach an island is a cheat? I am so looking forward to the greatly reduced GA from this mod. :xmas
 
Back
Top