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

Fixed Dutchman Submerged function

and I ment to say direct sail :p
 
well directsail doesnt call these functions at all on open sea. Or did I do something wrong?

Code:
//    nextenemy = FindClosestShipofRel(GetMainCharacterIndex(), &enemydist, RELATION_ENEMY);
TraceAndLog("directsailfunction");
Find_nearest_inf_ship(pchar);
 
hmmm...then I need to do some research myself ...
you can always try to find out what is called like this too, I wont be doing so much different.

you could try a search trough all files in the program folder for
nextenemy
and see which are ship related....
 
Is it just me or is this getting real complicated real quick?
Are there any simple solutions that we can think of?
 
Its not that complicated, i just need to find which function is used at open sea
 
I still don't get why warships still see me.. There must be something else in the screwface_functions.c which overrides the visibility?
 
Put this in PROGRAM\SEA_AI
as far as I can see this fixes it for forts and ships.
As soon as you sugmerge they might fire 1 or 2 shots on you but theire AI is set to go away so they will act as if you are out of range.
It seems the range of the cannons is determined else so thats why they do shoot at you 1 or 2 times (ships do, forts dont).
But I didn't find it that bothering honestly cause if I where to captain a ship and I saw it dissapair under the waves I would fire 1 or 2 more shots also just to know for sure it wont emerge there again.

I haven't had time to check the worldmap encounters yet but maybe someone could take a quick look at that cause just removing the dutchman line from the encounters function didn't do the trick that much, it seems somewhere also a chance is set or something like that. I only encountered 1 warring ship while going over the worldmap submerged.

But please also test this file to see if my observations are the same as others :).

@Pillat hope you can test it too for me :).
I have to go now but will be back in 3 or 4 hours probally.
 

Attachments

  • AIShip.c
    215.2 KB · Views: 167
This should do a small bugfix also, it just prevent some errors ;), just a very small bug.
 

Attachments

  • NK.c
    114.3 KB · Views: 162
I suspect this:
Code:
if(CheckAttribute(rCharacter1, "ship.SubmergeDutchman") || CheckAttribute(rCharacter1, "ship.SubmergeDutchman"))
Should be this:
Code:
if(CheckAttribute(rCharacter1, "ship.SubmergeDutchman") || CheckAttribute(rCharacter2, "ship.SubmergeDutchman"))

In PROGRAM\WorldMap\worldmap_encgen.c, comment out this line:
Code:
void wdmShipEncounter(float dltTime, float playerShipX, float playerShipZ, float playerShipAY)
{
   int numShips = wdmGetNumberShipEncounters();
   if(numShips < 5)
   {
     rand(1001);
     //Âåðîÿòíîñòè ïîÿâëåíèÿ
     wdmTimeOfLastMerchant = wdmTimeOfLastMerchant + dltTime*WDM_MERCHANTS_RATE*1000.0;
     wdmTimeOfLastWarring = wdmTimeOfLastWarring + dltTime*WDM_WARRING_RATE*1000.0;
     wdmTimeOfLastFollow = wdmTimeOfLastFollow + dltTime*WDM_FOLLOW_RATE*1000.0;
     //Âåðîÿòíîñòü îò êîëè÷åñòâà ñîçäàííûõ
     float nump = 1.0 - numShips*0.15;
     //Èäåíòèôèêàòîðû ýíêîóíòåðîâ
     int i1 = -1;
     int i2 = -1;
     //Âûáèðàåì
     ref mc = GetMainCharacter();
     bool encoff = false;
     if(GetAttribute(mc,"worldmapencountersoff") == 1)   return;
     //if(CheckAttribute(mc,"ship.SubmergeDutchman"))     return;   // PB: No encounters or storms while you are submerged
That restores all worldmap ships with a submerged Dutchman, but the storms remain disabled.
Then the only extra thing we would need for ships to never chase you if you are submerged.
 
Uhm oops, yeah thats true :p.

I changed that line but still didn't get much encounters tough ...
 
should be this:
Code:
bool wdmCreateFollowShip(int type, float dltSpeedInPMPercents)
{
ref mc = GetMainCharacter();
if(CheckAttribute(mc,"ship.SubmergeDutchman")) return false;

cause its a boolean function.

@Pieter Boelen you got all files now right? This will be included in the new update I presume so I put this on fixed for now.
 
should be this:
Code:
bool wdmCreateFollowShip(int type, float dltSpeedInPMPercents)
{
ref mc = GetMainCharacter();
if(CheckAttribute(mc,"ship.SubmergeDutchman")) return false;

cause its a boolean function.
Good catch again! Only saw this after the latest WIP finished uploading, so this has to be corrected manually until I make another installer.
Other than that, I think I have everything. But by all means, please do a WinMerge on the latest version to check.
 
Forgot about testing capture colonies.. If I'm still up2date, it only has to be testet if new towns work right?

And about the dutchman thing.. Levis said it works for him but for me, they are still shooting.. so dunno.. but we have definitly an improvement on worldmap since ships appear again and don't chase you ;)
 
@Pillat as far as I found they only shoot 2 shots or so and then they dont fire anymore. forts wont fire anymore too. at least thats what I experienced
 
I tested several times.. at open sea and at and island.. they fire the whole time at me.. but at least I think only the gunners see me :D Because the ship doesnt manouver like they usually do when they are in battle
 
Hmm ok...will look into it more, might be they just stopped for me cause the manouvering...
 
Back
Top