• 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 Johan Elting put in Sea

salonikasurf

Freebooter
Storm Modder
The reload after the discussion with Armand in the Pirate Tavern on Nevis puts Yohan Elting into the sea not next to Armand in the port to finish dialogue???
Game save attached just before talking to the Barkeep.
 

Attachments

  • Nevis.7z
    829.9 KB · Views: 162
That's odd. If you're playing Johan Elting then presumably you're playing the "Assassin" storyline? That does have an altered version of the "Hard Labours of an Assassin" sidequest but does not have its own version of "Help the Lady", so Armand should be part of the regular sidequest. If you teleport to sea then it usually means the teleport is trying to put you on a locator which does not exist. But as far as I can see, the section of code which does the teleport is this:
Code:
     case "Story_SitAndDrinkWithDelacroix_4":
       LAi_SetActorType(characterFromID("Armand Delacroix"));
       ChangeCharacterAddress(characterFromID("Armand Delacroix"), "QC_port", "goto19");
       DoQuestReloadToLocation("QC_port", "goto", "goto18", "Story_DelacroixGiddy");
     break
And that hasn't changed for ages. Including the ";" missing from the 'break' line. :D
 
I've had a look at this and now my question is, how did it ever work? It certainly did because I've played this sidequest before. Nevertheless, both with the savegame attached in post #1 and with a savegame of my own from "Tales of a Sea Hawk" (just in case something from "Assassin" was conflicting with the sidequest), the same problem shows up - you teleport to Pirate Settlement port and are in the sea.

Armand Delacroix starts off in the tavern. Your initial dialog with him exits to quest case "Story_SitAndDrinkWithDelacroix", which does this:
Code:
LAi_Fade("Story_SitAndDrinkWithDelacroix_2", "Story_DelacroixStartTalkingInTavern");
The first of those puts you in your seat, the second resumes dialog which subsequently ends with dialog case "Exit_Giddy":
Code:
     case "Exit_Giddy":
       Diag.CurrentNode = Diag.TempNode;
       DialogExit();
       LAi_QuestDelay("stand_up", 0.001);
       AddDialogExitQuest("Story_SitAndDrinkWithDelacroix3");
     break;
Quest case "stand_up", located in "quests_common.c", does this:
Code:
    case "stand_up":
       LAi_Fade("stand_up1", "stand_up2");
       LAi_SetPlayerType(Pchar);
     break;
"stand_up1" tries to teleport you to goto/goto20, while "stand_up2" is just another 'LAi_SetPlayerType(Pchar)'. Meanwhile quest case "Story_SitAndDrinkWithDelacroix3" does this:
Code:
     case "Story_SitAndDrinkWithDelacroix3":
       LAi_Fade("Story_SitAndDrinkWithDelacroix_4", "Story_DelacroixGiddy");
     break;
I'm not quite sure what "stand_up" is supposed to do. It seems to want to teleport you to location goto/goto20, which isn't going to work because as far as I can tell from enabling visible locators and looking around, there is no goto20 in the tavern. Not that this matters because the 'LAi_Fade' from "stand_up" seems to be interrupted by the 'LAi_Fade' from "Story_SitAndDrinkWithDelacroix3", causing a message in "compile.log" about a 'LAi_Fade' not having completed. The latter 'LAi_fade' seems to kick in first, "Story_SitAndDrinkWithDelacroix_4" teleports you to the port and then "Story_DelacroixGiddy" is Armand's dialog with you in the port. And now is when I think that teleport from "stand_up1" activates, but as there's no goto/goto20 in the port either, that's when you're dumped into the sea.

So I tried editing case "Exit_Giddy", replacing the 'LAi_QuestDelay("stand_up", 0.001)' with a simple 'LAi_SetPlayerType(Pchar)', ran the same savegames again, and it appears to work.

All of which means, @salonikasurf, download this and put it into "PROGRAM\DIALOGS", then try your savegame again.
 

Attachments

  • Armand Delacroix_dialog.c
    6.8 KB · Views: 169
@Grey Roger

The Quest case "stand_up", located in "quests_common.c", - has nothing to do with the Help the Lady Quest :no - it is part of the section of that file labelled - Boarding & Mutiny - ( this label has been added sometime after Beta 2.5)
cases Stand_up1 and Stand _up2 in "quests_common.c" appear to be part of the Edward Atttwood Quest. - the 2 names in stand_up1 are the 2 soldiers the player talks to in Port Royal Tavern about Attwood



I think the stand_up in

Code:
case "Exit_Giddy":
Diag.CurrentNode = Diag.TempNode;
DialogExit();
LAi_QuestDelay("stand_up", 0.001);
AddDialogExitQuest("Story_SitAndDrinkWithDelacroix3");
break;

Just makes the player "stand up" after sitting at the table with Armand ( not certain about this ).

So I am not sure why it is activating cases in Quests_common.c :modding

:read
 
The only thing I can easily see is in Armand Delacroix_dialog.c

this difference between Beta 2-5 and Beta 4-1

Beta 2-5

Code:
     case "risks_3":
       d.Text = DLG_TEXT[56];
       Link.l1 = DLG_TEXT[57];
       Link.l1.go = "exit_giddy";
       AddDialogExitQuest("Exit_Giddy");
     break;

Beta 4-1

Code:
case "risks_3":
       d.Text = DLG_TEXT[56];
       Link.l1 = DLG_TEXT[57];
       Link.l1.go = "exit_giddy";
     break;

I don't know why the line was removed - nothing in the file to say why :shrug
 
I don't know for sure, but it might be something I rewrote a bit because I do remember there being a bug before in that spot.
 
I think the stand_up in

Code:
case "Exit_Giddy":
Diag.CurrentNode = Diag.TempNode;
DialogExit();
LAi_QuestDelay("stand_up", 0.001);
AddDialogExitQuest("Story_SitAndDrinkWithDelacroix3");
break;

Just makes the player "stand up" after sitting at the table with Armand ( not certain about this ).

So I am not sure why it is activating cases in Quests_common.c :modding
It has to find a quest case "stand_up" somewhere, and presumably the only one available is the one in "Quests_common.c". Its function in the "Help the Lady" sidequest is indeed to make the player stand up and revert to "player" type, and is unnecessary - a simple 'LAi_SetPlayerType(Pchar)' appears to achieve all that.

But as I said, the real weirdness is that I've played this sidequest before without any problems, and it wasn't in Beta 2.5 because I never had Beta 2.5. The earliest version of Build 14 I ever had was Beta 3, and I've played the sidequest in later versions than that.
 
Perhaps the bug has appeared because Beta 4 is the first version to have all the side quests available in all the stories. ( Beta 3-4 only had some of them available in some free play stories)

So the creation of the new file Quests_side.c with all the side quest code in the Program > Quests folder has brought the bug to light. :shrug


:read
 
Could indeed be that there is some interference between sidequests/mainquests, etc.
Wouldn't be the first example where that was the case.
 
That is why, as well as trying the "Assassin" savegame provided, I also tried the same sidequest in my own "Tales of a Sea Hawk" campaign. The bug appeared there as well. Last time I played "Help the Lady", without seeing the bug, was probably also during "Tales of a Sea Hawk".
 
Update: Here's the evidence that the problem was caused rather more recently than the change from Beta 3 to Beta 4. Very recently, in fact...

I have both a fully updated install with the latest ZIP from 7th October, and an install with the 28th July installer but no ZIP updates. After speed-running through "Help the Boatswain" and "Help the Lady" in both, the results were pretty conclusive. Look at the bottom of these two "compile.log" files, renamed to indicate which install produced them. In the 28th July version, case "stand_up1" happens before the move to "QC_Port". In the 7th October version, case "stand_up1" happens after the move to "QC_Port". And that's the quest case which tries to teleport you to location "goto20". It doesn't do much while you're in the tavern and anyway doesn't matter because a split-second later you shift to the port. But if it happens while you're at the port, it dumps you into the sea because "goto20" doesn't exist.

And that's why the bug occurs in the 7th October version but not the 28th July version.
 

Attachments

  • compile_7_Oct.log
    3.7 KB · Views: 159
  • compile_28_July.log
    45 KB · Views: 173
Edit: nvm let me look into it
 
jul 28
Code:
Quest name Story_SitAndDrinkWithDelacroix FOUND in SideQuestComplete
Quest name Story_SitAndDrinkWithDelacroix_2 FOUND in SideQuestComplete
Quest name Story_DelacroixStartTalkingInTavern FOUND in SideQuestComplete
LAi_type_actor_EndDialog -> LAi_type_actor_Reset
Quest name stand_up FOUND in CommonQuestComplete
LAi_Fade -> previous fade operation not ended!
Quest name Story_SitAndDrinkWithDelacroix3 FOUND in SideQuestComplete
Actor error: character <Blaze> now is not actor, his have type <player>
Quest name stand_up1 FOUND in CommonQuestComplete
Reload: Process started for locator_name = fakeReload and lockedReloadLocator = 
reload_cur_island_index = -1
reload_cur_location_index = 152
reload_island_index = -1
reload_location_index = 145
Start reload
Quest name Story_SitAndDrinkWithDelacroix_4 FOUND in SideQuestComplete
PauseAllSounds
ReloadStartFade
ItemLogic: On unload location
ReloadEndFade
** Whr: CreateWeatherEnvironment - iCurWeatherhour = 14, theHour = 23
 !gWeatherInit Whr_Generator() - Initialized 
ItemLogic: On load location QC_port
ItemLogic: found 0 buttons
ItemLogic: Loaded model items\\pursem
Quest name Story_DelacroixGiddy FOUND in SideQuestComplete
SETTING MUSIC: music_pir_town
SETTING MUSIC: music_pir_town
Quest name stand_up2 FOUND in CommonQuestComplete
Quest name Story_DelacroixGiddy FOUND in SideQuestComplete
okt 7:
Code:
Quest name Story_SitAndDrinkWithDelacroix FOUND in SideQuestComplete
Quest name Story_SitAndDrinkWithDelacroix_2 FOUND in SideQuestComplete
Quest name Story_DelacroixStartTalkingInTavern FOUND in SideQuestComplete
Quest name Story_SitAndDrinkWithDelacroix3 FOUND in SideQuestComplete
LAi_Fade -> previous fade operation not ended!
Quest name stand_up FOUND in CommonQuestComplete
Reload: Process started for locator_name = fakeReload and lockedReloadLocator = reload1
reload_cur_island_index = -1
reload_cur_location_index = 152
reload_island_index = -1
reload_location_index = 145
Start reload
Quest name Story_SitAndDrinkWithDelacroix_4 FOUND in SideQuestComplete
PauseAllSounds
ReloadStartFade
ItemLogic: On unload location
ReloadEndFade
** Whr: CreateWeatherEnvironment - iCurWeatherhour = 16, theHour = 23
 !gWeatherInit Whr_Generator() - Initialized 
ItemLogic: On load location QC_port
ItemLogic: found 0 buttons
ItemLogic: Loaded model items\\purse
Quest name Story_DelacroixGiddy FOUND in SideQuestComplete
Actor error: character <Blaze> now is not actor, his have type <player>
Quest name stand_up1 FOUND in CommonQuestComplete
Quest name Story_DelacroixGiddy FOUND in SideQuestComplete

these are the pieces which you should look at from the compile.log files.

Looking at thd code I'd say it works as it should in okt7 and it goes wrong in the july version because:
Code:
case "Exit_Giddy":
Diag.CurrentNode = Diag.TempNode;
DialogExit();
LAi_QuestDelay("stand_up", 0.001);
AddDialogExitQuest("Story_SitAndDrinkWithDelacroix3");
break;
This says it should execute Story_SitAndDrinkWithDelacroix3 after the dialog has ended while it should wait 0.001 ms before it executes "stand_up".
I think the reason this did work in the past was because the checking for such things happened every frame and therefore it was actually able to execute the stand_up before the dialog end function could trigger.
After the performance update I did to bring the check function in place and have it run at set times instead of being depended on the framerate, it now only checks every 5 ms or so, this gives the game enough time to first handle the dialog exit quest and then do the stand_up.

First of all I think this is programmed VERY bad to try to use the LAi_Questdelay to bypass the exitquest.
So I'd say just reverse the two questcalls as stand_up should be called first. and give the otherone a delay of just 1. That should fix it and make it better.
So Like this:
Code:
case "Exit_Giddy":
Diag.CurrentNode = Diag.TempNode;
DialogExit();
LAi_QuestDelay("Story_SitAndDrinkWithDelacroix3", 1);
AddDialogExitQuest("stand_up");
break;
 
After the performance update I did to bring the check function in place and have it run at set times instead of being depended on the framerate, it now only checks every 5 ms or so, this gives the game enough time to first handle the dialog exit quest and then do the stand_up.

First of all I think this is programmed VERY bad to try to use the LAi_Questdelay to bypass the exitquest.
So I'd say just reverse the two questcalls as stand_up should be called first. and give the otherone a delay of just 1. That should fix it and make it better.
So Like this:
Code:
case "Exit_Giddy":
Diag.CurrentNode = Diag.TempNode;
DialogExit();
LAi_QuestDelay("Story_SitAndDrinkWithDelacroix3", 1);
AddDialogExitQuest("stand_up");
break;


There is also the problem that the case "stand-up" in Quests_common.c is nothing to do with the Help the Lady quest - it is for the Edgar Attwood Quest :yes.

I think someone was just trying to use the code again without thinking things through completely.

The best solution to this specific quest's ( Help the Lady) problem, I think, is the one by @Grey Roger in Post#3. :yes


:drunk
 
There is also the problem that the case "stand-up" in Quests_common.c is nothing to do with the Help the Lady quest - it is for the Edgar Attwood Quest :yes.

I think someone was just trying to use the code again without thinking things through completely.

The best solution to this specific quest's ( Help the Lady) problem, I think, is the one by @Grey Roger in Post#3. :yes


:drunk
I didn't look at the questcases themself, but now looking at them I agree with @Grey Roger just adding the setplayertype should do the trick too :).
 
I didn't look at the questcases themself, but now looking at them I agree with @Grey Roger just adding the setplayertype should do the trick too :).
It does. I tried it. ;)

The net effect of the call on "stand_up" is a combination of 'LAi_SetPlayerType(Pchar)' and a teleport to a location which does not exist. We don't want the teleport, which just leaves the 'LAi_SetPlayerType(Pchar)'. So "stand_up" is both unnecessary and wrong, being for a different quest - which then just leaves the question, why is it in "quests_common.c"? Shouldn't "stand_up" be somewhere near other "Attwood" code in "quests_side.c" instead? The game doesn't care where it is, but placing it somewhere near where it's used may prevent future modders from mistakenly believing that something called "stand_up" in the common quest code file is a general piece of code to make a character stand up - which is probably what happened here.
 
It does. I tried it. ;)

The net effect of the call on "stand_up" is a combination of 'LAi_SetPlayerType(Pchar)' and a teleport to a location which does not exist. We don't want the teleport, which just leaves the 'LAi_SetPlayerType(Pchar)'. So "stand_up" is both unnecessary and wrong, being for a different quest - which then just leaves the question, why is it in "quests_common.c"? Shouldn't "stand_up" be somewhere near other "Attwood" code in "quests_side.c" instead? The game doesn't care where it is, but placing it somewhere near where it's used may prevent future modders from mistakenly believing that something called "stand_up" in the common quest code file is a general piece of code to make a character stand up - which is probably what happened here.
the stand_up questcase is also used in soldier2.c which also seems to be linked to attwood, so I'm find with moving it. maybe even renaming it to prevent confusion.
 
@Levis' explanation for why it suddenly became an issue when it wasn't before certainly sounds very plausible to me! :onya

And if I understand correctly, @Grey Roger's solution works perfectly fine and is far more correct code than what used to be the case.

Most importantly, this sounds like a single example and I doubt there will be more instances of the same issue.
Based on that, I think you might be safe to call this one "Fixed". :doff
 
Back
Top