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

Black Pearl stealth

ReZKaTT

Landlubber
How about when sailing with the Pearl at night when other ships are around that they cant see you until you come into range or when you open fire? Is this possible? Same with ports, when you attack a port at night with the pearl they can't see you until you open fire on them.
 
There is some code in place to make other ships "see" you at differing distances based on whether it's night or foggy. Might be possible to add some extra code for the Pearl there.

PROGRAM\Screwface_functions.c:
Code:
int Find_nearest_inf_ship(ref chr)
{
ref rGroup;
ref pchar = GetMainCharacter();
string groupname;
float visibility_range = 3000.0; // maximal visibility range

int i;
ref achr;
int achridx;
int place = -1;
float enemydist;
enemydist = 0.0;
float memoire=0.0;

if(CheckAttribute(chr,"runaway")){DeleteAttribute(chr,"runaway");}

//logit("FOG Weathers.Fog.SeaDensity : " + Weathers.Fog.SeaDensity + " !");

//	visibility_range = (2.6/stf(Weathers.Fog.SeaDensity));
visibility_range = visibility_range - (stf(Weathers.Fog.SeaDensity) * 130 * visibility_range);

// more a character have leadership and sailing skills and more he can see far

// TODO: Aconcagua: suppose we should use the effective value -> use GetCharacterSkill
// perhaps even GetSummonSkillFromName???
// compare BattleInterface.c
//visibility_range = visibility_range + (stf(chr.skill.Leadership) * stf(chr.skill.sailing)*5);
visibility_range = visibility_range + (GetCharacterSkill(chr, SKILL_LEADERSHIP) * GetCharacterSkill(chr, SKILL_SAILING) * 5);

if(Whr_IsNight()){visibility_range = visibility_range / 2;}
//logit("Visibility range : " + visibility_range + " !");
 
I agree. I've always thought the Pearl should have some kind of stealth ability like it does in the first two films. The makers of the film have even said that was the whole point of everything being black. We should experiment with this. You know me, I'm always happy to help with stuff. :onya
 
Something like
Code:
if(chr.ship.type == "BlackPearl"){visibility_range = visibility_range / 2;}
That'd need to be expanded a bit, but it would give the Black Pearl the same visibility at day as the other ships get at night.
Then at nighttime, it would be half that again. You reckon that'd have the desired effect?
 
Just occurred to me: Wouldn't you say that the Black Pearl should NOT have any stealth bonus during daytime? A black ship sort-of stands out at sea.
 
I got into a fight with the Black Pearl yesterday. One ship not quite sunk, another very heavily damaged, my ship beat up and the only way we got away was because I managed to dismast the Pearl. Still,all of that fog made it very easy to see the Pearl even at extreme distance.
 
LOL! I'd imagine so, yes! I wonder what to do with that gameplay-wise. Maybe she shouldn't generate fog all the time? But then... when? Or have an on/off button for it on the keyboard?
But then what about sea battles with the Black Pearl, like the one at the end of the Standard storyline? How does that work with the fog?
 
All I remember about the Cozumel battle is that all ship flags are gone. It happened on a stormy night and visibility was poor anyway.
 
In the first movie, the cursed Pearl was shrouded in fog 24/7 day and night. I think the fog should just be left alone.
 
Leave as-is, eh? I like it. Easy does the trick! :cheeky

For Black Pearl stealth, here's some more fancy code that might work out:
Code:
    if(Whr_IsNight())
    {
        visibility_range = visibility_range / 2;
        if(sti(GetAttribute(chr, "ship.type")) == SHIP_CURSED)        visibility_range = visibility_range / 2;
        if(    GetAttribute(chr, "ship.type")  == "BlackPearl")        visibility_range = visibility_range / 2;
        if(    GetAttribute(chr, "ship.type")  == "CursedPearl")    visibility_range = visibility_range / 2;
        if(    GetAttribute(chr, "ship.type")  == "UncursedPearl")    visibility_range = visibility_range / 2;
    }
Visibility is decreased to 25% of usual at night instead of 50% as for the other ships. It's set up to apply to all four versions of the Pearl. Untested.
 
This got me wondering. Would there be anyway to make the Dutchman's visibility 0% when she's submerged?
 
PROGRAM\Screwface_functions.c , see attached. It didn't crash my game when I started, so that's a good start.
 

Attachments

  • Screwface_functions.zip
    4.3 KB · Views: 67
I tested it out. I almost wonder if we shouldn't go to perhaps 15%. A fort started firing on me before I could get within gun range.
 
I'm not sure if this modification applies to forts; I recall they use different code that isn't distance-related. Or something.
How about enemy ships? Does that seem about right?
 
Yeah the ships seem about right. The only annoying part is they spot me JUST before I get into firing range. But then again, I'm using cannonades and not long guns. I usually equip the Peal with the 32 pound cannonades because you can't equip it with the 32 pound long gun. You can get pretty damn close before you're spotted.

Dang. We need to do something about the forts too.
 
Spot you just BEFORE getting into firing range, eh? Well, that sounds about fair enough to me.
If they'd spot you later, I think they might just ignore even as you're pounding away at them.

For the forts, it seems that the code is not in the same file and not easily found. If it exists at all. They're handled very differently in any case.
Can't you just claim that forts have a better range of spotting because they're higher and they maintain a much better watch than ships at sea?
 
I suppose. But it sure didn't help those poor saps in Port Royale that one night when the Pearl attacked, did it? lol:wp Maybe one day, you'll be able to find that bit of code.

Ugh. I've been here for over a year and I still haven't learned much about how the code works. I've only ever been able to manipulate the music codes by myself. I wish I knew more.
 
Back
Top