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

Confirmed Bug Stuck At Sea When Assaulted During Mooring

KillPhil

Corsair
Storm Modder
There is still a bug when you moor somewhere and between mooring and the acutal loading progress some enemy ships are approaching you, the game won't load and you get stuck. So you see your ship drifting but cant control anymore (I think even F1 main menu doesnt work) which leads to killing PotC as only solution to this^^
 
I can indeed imagine that happening. This should be a rare instance though, right? I doubt it would be a very easy fix. :(
 
It isn't as rare as you think.. I just know it now and try to avoid such situations but since e.g. at Nevis are usually many pirates it can happen quite often there.. a solution would be to reduce the time between mooring and loading.. since if you let your ship drift to 0.3-0.2 knots it loads instantly when you moor
 
I think this is related to the AnchorDrop function in PROGRAM\SEA_AI\sea.c and especially this section in PROGRAM\BATTLE_INTERFACE\BattleInterface.c:
Code:
  if (CheckAttribute(PChar, "Anchoring") == true && sti(PChar.Anchoring) == true) {
     if (!CheckAttribute(PChar, "Anchoring.Duration")) PChar.Anchoring.Duration = sea_time;
     if (stf(PChar.Ship.Speed.z) < 0.3 || GetSeaTime() - sti(PChar.Anchoring.Duration) > 5) {
       bool bImmediate = CheckAttribute(PChar, "Anchoring.Immediate") == true && sti(PChar.Anchoring.Immediate) == true;
       DeleteAttribute(PChar, "Anchoring");
       if (VISIT_DECK == 1 && bImmediate == false)
         GoToDeck();
       else
         AnchorDrop();
     }
     return;
   }
But I don't see why this should fail if enemies are near, though.
 
Perhaps I found the point at which it goes wrong. Extract attached to your PROGRAM folder, then try to trigger this problem.
When it happens, post your compile.log . Hopefully that will tell us how far it gets and therefore clue us in on where we should look to fixing this.
Would indeed be nice to tackle this properly for Beta 3.3, since getting irrevocably stuck is.... uhm... a little bit bad. :facepalm
 

Attachments

  • reload.zip
    6.1 KB · Views: 172
I'll try ;) But I can imagine the problem: The game thinks that you are in a battle now and therefore shouldnt be able to move to another location. I can tell this by the music changing to the seabattles
 
Indeed the reason seems quite clear. I just need to know how far the "anchoring" code gets with its execution before being broken off.
If we can find the spot where it stops, then hopefully we can find a method of overriding that for anchoring so that you do reach the shore properly.
 
can't we just increase the speed at which it loads instantly and/or decrease the time between anchoring and loading? As far as I can read it from the code, both should be possible ;)
 
That would reduce the chance but not prevent it altogether.
If I can get the logs and possibly a save of getting stuck, hopefully we can find a better solution.
 
I have a suspicion on why this problem occurs. I have made some code adjustments for inclusion in the next update to address this.
If I am right, you will no longer get stuck. But you WILL get an on-screen log message and compile.log entry when this happened.
Here's to hoping....! :wp
 
Probably, yes. And I didn't even get started on the blacksmiths yet, which it what I had intended to do today. :facepalm
 
No worries, if you don't want to completely re-do all dialogs, then you might be happy to hear that I'm rewritting them atm so they are at least not insulting or confusing anymore ;)
 
If you press F3 at an anchorage while in 3D sailing mode, I end up stuck as the reload does not actually finish.
The spinning coin is gone, but I don't get into the deck scene.
 
Last edited:
I think this is due to the changes pieter made. But when I'm in port and I go to the sea intantly and I then choose to more (without moving) the loading screen will stay on....
 
Yup, I caused this problem myself. Have to think this through a bit further. :facepalm
 
Reason is because I moved a line from BattleInterface.c to reload.c instead:
Code:
  if (CheckAttribute(PChar, "Anchoring") == true && sti(PChar.Anchoring) == true) {
     if (!CheckAttribute(PChar, "Anchoring.Duration")) PChar.Anchoring.Duration = sea_time;
     if (stf(PChar.Ship.Speed.z) < 0.3 || GetSeaTime() - sti(PChar.Anchoring.Duration) > 5) {
       bool bImmediate = CheckAttribute(PChar, "Anchoring.Immediate") == true && sti(PChar.Anchoring.Immediate) == true;
       DeleteAttribute(PChar, "Anchoring"); // <----------------- That line
       if (VISIT_DECK == 1 && bImmediate == false)
         GoToDeck();
       else
         AnchorDrop();
     }
     return;
   }
 
These changes should set things right again.
PROGRAM\BATTLE_INTERFACE\BattleInterface.c:
Code:
  if (CheckAttribute(PChar, "Anchoring") == true && sti(PChar.Anchoring) == true) {
     if (!CheckAttribute(PChar, "Anchoring.Duration")) PChar.Anchoring.Duration = sea_time;
     if (stf(PChar.Ship.Speed.z) < 0.3 || GetSeaTime() - sti(PChar.Anchoring.Duration) > 5) {
       bool bImmediate = CheckAttribute(PChar, "Anchoring.Immediate") == true && sti(PChar.Anchoring.Immediate) == true;
       DeleteAttribute(PChar, "Anchoring");
       PChar.ForceReload = true; // PB: To fix potentially getting stuck
       if (VISIT_DECK == 1 && bImmediate == false)
         GoToDeck();
       else
         AnchorDrop();
     }
     return;
   }
PROGRAM\reload.c:
Code:
int Reload(aref reload_group, string locator_name, string current_location)
{
   ref PChar = GetMainCharacter();
   if(dialogRun || dialogSelf)//MAXIMUS -->
   {
     DialogExit();
   }
   PChar.condition = "reload";//MAXIMUS <--
   if(sti(GetStorylineVar(FindCurrentStoryline(), "DISABLE_TIPS")) < 1) SetReloadNextTipsImage(); // JRH

// changed by MAXIMUS -->
   dialogDisable = !ownDeckStarted(); // KK
// changed by MAXIMUS <--

   reload_xaddress.active = "false";
   //Check locked locator
   trace("Reload: Process started for locator_name = " + locator_name + " and lockedReloadLocator = " + lockedReloadLocator); // PB
   if(locator_name == lockedReloadLocator)
   {
     if(CheckAttribute(PChar, "ForceReload")) // PB: To fix potentially getting stuck
     {
       TraceAndLog("Reload: Continue despite locked locator. Please report this at piratesahoy.net!"); // PB: For testing
     }
     else
     {
       lockedReloadLocator = "";
   //     PlaySound("knock");//MAXIMUS
       return -1;
     }
   }
   DeleteAttribute(PChar, "ForceReload"); // PB
Basically this adds an extra temporary attribute that isn't "Anchoring" for the purpose of (hopefully) fixing this particular bug.
This has restored all game functionality back to normal and should also retain the effect of this attempted fix.
 
Back
Top