• 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 Jack Sparrow Storyline: Storyteller Sitting on Occupied Seat

Mirsaneli

Privateer
Storm Modder
Jack Sparrow storyline. After entering the Tortuga tavern, this is what happens.

Untitled.jpg
 
Quest character in fixed position PLUS a random character being put there too.

Please again provide a compile.log and possibly a savegame to help us find the relevant code as quickly as possible and test it.

@pedrwyth: Do you know when random characters do and don't show up on certain locators?
As in: How do we prevent them from sitting on quest characters' laps?
Would it be enough to make sure the quest character is in place prior to the location being loaded?
 
I fixed this before so it must have been changed again.
You need to load quest chars first indeed, and all random functions need to check if a locator is used already.
I think in this case a random function might be used which doesn't check if a locator is used already.
 
Quest character in fixed position PLUS a random character being put there too.

Please again provide a compile.log and possibly a savegame to help us find the relevant code as quickly as possible and test it.

@pedrwyth: Do you know when random characters do and don't show up on certain locators?
As in: How do we prevent them from sitting on quest characters' laps?
Would it be enough to make sure the quest character is in place prior to the location being loaded?

Unfortunately, I only have a savegame before entering tavern. But now, when I reload that savegame and enter tavern, this bug does not occur. I tried reloading several times. So I guess it's not a bug?
 
Unfortunately, I only have a savegame before entering tavern. But now, when I reload that savegame and enter tavern, this bug does not occur. I tried reloading several times. So I guess it's not a bug?
Placing of random characters is... well... random. So this may or may not happen.
Still, if you have a compile.log showing the relevant quest case, at least we can double-check if Mr. Gibbs IS being put in place PRIOR to the reload or not.

I fixed this before so it must have been changed again.
You need to load quest chars first indeed, and all random functions need to check if a locator is used already.
I think in this case a random function might be used which doesn't check if a locator is used already.
Either that or the quest is coded to put Mr. Gibbs in place only AFTER the reload.
 
@pedrwyth: Do you know when random characters do and don't show up on certain locators?
No I asked the same question when I started looking at double placings with hard coded pchar positions. As you know I solved it by making those cases non sit locators so random placement couldn't occur rather than hunt through all possible placement scenarios.
As in: How do we prevent them from sitting on quest characters' laps? Would it be enough to make sure the quest character is in place prior to the location being loaded?
As @Levis says
You need to load quest chars first , and all random functions need to check if a locator is used already. I think in this case a random function might be used which doesn't check if a locator is used already.

Since I have never seen two random characters sitting on each other I would guess there is already a check of occupancy before they are generated (but it could be just a rare chance not yet encountered), certainly the quest placement doesn't usually check - these are hard coded to a particular locator (and usually pchar similarly constrained for the ensuing scene).

whatever the sequence of quest / random or random / quest placement if a clear locator call was made/used just before placing the quest character (I couldn't work out how to do that) and it is ensured all random ones do indeed check for occupancy that should cover all bases
 
Last edited:
So @Mirsaneli, please provide a savegame just prior to this point. Or a compile.log dealing with this on.
Or ideally both. :cheeky
 
So @Mirsaneli, please provide a savegame just prior to this point. Or a compile.log dealing with this on.
Or ideally both. :cheeky
I believe a good test case if starting HTC storyline and going to the tavern.
Gibbs there is a questchar.
 
I believe a good test case if starting HTC storyline and going to the tavern.
Gibbs there is a questchar.
Except that is a different quest scene and I suspect it may be due to the way that specific scene is coded.

Not sure if the compile.log is proper though. Savegame is also in the .rar.
Thanks; it's probably one of these cases then:
Code:
Quest name Tortuga_jack FOUND in BothQuestComplete
Quest name Pintel_stay_where_you_are_loop3 FOUND in QuestComplete
Quest name Tortuga_Get_ready_for_Film FOUND in QuestComplete
 
I think this is the relevant code:
Code:
// Meet Bootstrap on Tortuga Feb 08
     case "Tortuga_Get_ready_for_Film":
[...]
         pchar.quest.Tortuga_Get_ready_for_Film2.win_condition.l1 = "location";
         pchar.quest.Tortuga_Get_ready_for_Film2.win_condition.l1.location = "Tortuga_tavern";
         pchar.quest.Tortuga_Get_ready_for_Film2.win_condition = "Gibbs_in_Tavern2_1.5";
[...]
    case "Gibbs_in_Tavern2_1.5":
       LAi_fade("Gibbs_in_Tavern2_2", "Gibbs_in_Tavern2_3");
     break;

     case "Gibbs_in_Tavern2_2":
       LAi_SetSitType(pchar);
       LAi_SetActorType(characterFromID("Storyteller"));
       LAi_ActorSetSitMode(characterFromID("Storyteller"));

       SetModelfromArray(PChar, GetModelIndex(pchar.originalmodel));

       ChangeCharacterAddressGroup(characterFromID("Storyteller"), "Tortuga_Tavern", "sit", "sit5");
       ChangeCharacterAddressGroup(pchar, "Tortuga_Tavern", "sit", "sit4");
     break;
Note that here the ChangeCharacterAddressGroup for the "Storyteller" character (=Mr. Gibbs) indeed must occur AFTER the reload.
 
@Pieter Boelen Rather than a general fix I can easily do the specific avoidance (ie turn sit 4 & 5 into candles group locators and tweak the quest code placing Gibbs and Pchar to compensate through the storyline - a quick search for "tortuga tavern" doesn't show other quest cases using these locators, I would do a more detailed trawl if proceeding) - this would keep our characters out of random laps (in this case).

Do you want that or are we (or is that you?) you still seeking a wider game generalised fix?
 
Do you want that or are we (or is that you?) you still seeking a wider game generalised fix?
As far as I understood from you and @Levis, in general random characters already will not sit on seats that are occupied by quest characters.
So the only fix I was planning is to make sure Mr. Gibbs is there BEFORE you reload to the tavern, rather than him being placed afterwards.

Just a fix for this very specific instance then.
Am I misunderstanding something or should that indeed be enough?
 
No I don't think there is any misunderstanding there, moving the placing of Gibbs prior to the reloads (there are 3 of them I think) should cure his problem (if we are right that random placings always avoid occupied locators).

- it still leaves a potential for pchar instances, in this quests_reaction 5 reloads to sit4.
 
No I don't think there is any misunderstanding there, moving the placing of Gibbs prior to the reloads (there are 3 of them I think) should cure his problem (if we are right that random placings always avoid occupied locators).

- it still leaves a potential for pchar instances, in this quests_reaction 5 reloads to sit4.
In that case.... You seem to know what is needed better that I do. Would you mind having a quick look into this one?
 
Just to let you know that I have finished the Jack Sparrow storyline. Except the bugs that I have reported, I didn't have any other issues. I will proceed now with the sidequests and will report if I encounter any bug. After that, I'm planning to play other storylines aswell.
 
:ahoyHere is an amended locator file for Tortuga Tavern and quest_reaction.c and characters/init/story.c from the Jack Sparrow storyline. I didn't find any other obvious uses of these locators - there are a few characters initialised to a sit5 at undefined location so there may be a few to appear (well not appear :pirate07:) to be fixed [Tai Huang, Gheraed Drabbe, Jack Greenfield] if any of them are placed subsequently in Tortuga tavern - the chances are slim that that's where they go.

Whilst looking for other uses of the locators I did come across a whole apparently redundant function "Alchogol" in dialog_func.c which at some stage was intended to do similar in tavern placements to those which are now in quest_common.c "Alc_2_prepare" - as far as I could see it isn't called anywhere now - and a good job too because I have previously 'regrouped' many of the sit locators it would be trying to reload to. :facepalm
 

Attachments

  • tortuga tavern.7z
    44.8 KB · Views: 63
Very awesome, @pedrwyth!
So now there is no need anymore to ensure Mr. Gibbs is in the tavern before the reload, is there?
"Fixed" it is then. :onya
 
Back
Top