• 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 Sitting at Wrong Table in Tavern

Mirsaneli

Privateer
Storm Modder
Can someone have a look at this savegame. I was in tavern in Guadeloupe and I spoke to a guy who wanted to connect me with smugglers. Than I was supposed to speak to a guard to get the patrol schedule. Since there was no french soldier in the tavern in that moment, I took a room and when I got downstairs, there was one sitting and drinking. I approached him and he asked me to join and drink with him. But when I press the "Sure, why not option", I'm redirected to a different table in the same room, and in front of me, there is a different character, so I cannot speak to him about patrols etc.
 

Attachments

  • savegame.rar
    636.6 KB · Views: 81
@pedrwyth: This is related to code you have rewritten a while back, I think?

Related to yes - part of no.

Guadeloupe (Pointe a pitre tavern) is not in the small, medium or large class I was dealing with however I did see it was one of two hard-coded (together with Tortuga) in habitué_dialog.c to sit at the location being used by PChar in this example - because there is always an interactive drinker/gambler opposite there. This case shows that others can be placed in the tavern too - so the hard coding should be pulled (from Habitue_dialog.c in dialogues). I need to do some experimenting with removing the pre-set habitue attribute and see where the player sits (using the default code at the end of case "alc2" in quests_common.c) which I never bothered with before having had no previous complaints.

However this was not a soldier with the smuggling schedule. The interaction code is still working and is assuming that you're sitting opposite the player you're drinking with (that's whose portrait and name is shown) although you're clearly sat with the standard gambler/drinker. This soldier only has the standard habitué dialogue (for whatever reason) and could not provide schedules for smuggling. Reloading sees him disappear (of course) but another soldier is then elsewhere in the tavern with requisite dialogue - and you don't get to sit with him (even though he is seated) anyway. I don't know if @Levis would want to block random soldiers without the schedule dialogue appearing to confuse players once smuggling has been triggered. Actually a soldier having this dialogue can be a little weird anyway if you end up down the dialogue tree of him being insulted by a soldier (which I did while testing).

I'll make the change to the locator and see how the random picking nearest vacant seat which will result works out in practice. I'll leave decisions about what soldiers with what dialogues should be possible under these conditions to others.
 
I'll leave decisions about what soldiers with what dialogues should be possible under these conditions to others.
@Levis: I would propose the following change in PROGRAM\LandEncounters\LEnc_monsters.c:
Code:
//Levis Extra Atmosphere-->
void Random_guard_sit_tavern(int bmax, int nation)     
{
   if(bmax==0) return;

   ref chr;
   float hasgun;
   string ani, group, locator;
   hasgun = 0.5;
   ani = "man";
   group = "sit";
   for(int i = 0; i < bmax; i++)
   {
     float x,y,z;
     GetCharacterPos(GetMainCharacter(), &x, &y, &z);
     if(i>0)
     {
       GetCharacterPos(chr, &x, &y, &z);
     }
     //locator = Lai_FindNearestFreeLocator(group, x, y, z);
     locator = LAi_FindRandomLocator(group);
     if (locator!="")
     {
       chr=LAi_CreateFantomCharacterEx(false, 0, true, true, hasgun, GetRandomModelForTypeExSubCheck(1, "Soldiers", ani, nation), ani, group, locator);   
       if(rand(10)>5 || CheckAttribute(GetMainCharacter(), "quest.Contraband.scout")) // PB: Always the guard dialog while preparing a Smuggler Quest
       {
         chr.Dialog.filename="random_guards_group_dialog.c";
       }
       else
       {
         chr.Dialog.filename="Habitue_dialog.c";
       }
Does that sound reasonable to you?

This, of course, would NOT affect soldiers that were already generated before you talked to the Smuggler Agent.
 
To make things more easy lets just remove habitu all together for them...
 
As far as where pchar sits is concerned the simplest is to lose the two hard coded habitue.locators from habitue_dialogue.c

Having done this (and placed a "wipe out" of the attribute at the end of the case "alc_2_prepare" in quests_common.c - the existing one in the next case only works if you are not in the same location (and is partly cutoff by /* - */ coding)) the Guadeloupe example then behaves. :beer:

However in Tortuga the nearest sit locator was at the next table. I say was because I have tweaked the three locator positions concerned so that sit7 IS now the nearest to sit3 so finding the nearest locator works without any fancy coding. :popcorn:

This means (as far as I can see) that the habitue.locators code isn't currently used and won't be needed but I have left it in case any other examples come to light where it would be useful.

Interestingly the waitress and barman seem to have semi-stuffed up walk files in the Guadeloupe bar - he is on a treadmill in the corner of the bar and won't talk to you, she likes standing in corners trying to walk through the wall - one position of which blocks the sit locator required for the soldier but using the nearest free locator actually works here to place him on the next seat unless she has (eventually) got fed up and wandered away.
 

Attachments

  • habitue tavern.7z
    37.5 KB · Views: 70
@Levis: Changed to this then:
Code:
      chr=LAi_CreateFantomCharacterEx(false, 0, true, true, hasgun, GetRandomModelForTypeExSubCheck(1, "Soldiers", ani, nation), ani, group, locator);   
     /*   if(rand(10)>5 || CheckAttribute(GetMainCharacter(), "quest.Contraband.scout")) // PB: Always the guard dialog while preparing a Smuggler Quest
       {
         chr.Dialog.filename="random_guards_group_dialog.c";
       }
       else
       {*/
         chr.Dialog.filename="Habitue_dialog.c";
     //   }
:doff

Interestingly the waitress and barman seem to have semi-stuffed up walk files in the Guadeloupe bar - he is on a treadmill in the corner of the bar and won't talk to you, she likes standing in corners trying to walk through the wall - one position of which blocks the sit locator required for the soldier but using the nearest free locator actually works here to place him on the next seat unless she has (eventually) got fed up and wandered away.
Uh, wha? I just loaded that savegame from the opening post and both the barman and waitress walk around just fine.
And even when the barman is in the back, I can still talk to him. So not sure what's going on there.... :shock
 
Uh, wha? I just loaded that savegame from the opening post and both the barman and waitress walk around just fine.
And even when the barman is in the back, I can still talk to him. So not sure what's going on there.... :shock

Nor me - :no he's still getting lots of exercise walking mutely on the spot each time I load it (a different spot with this latest load) and she rushed off to her favourite corner.
There is a compile error
Code:
Template <goto> -> failure for chr.id = Pointe_a_pitre_officiant
but the waitress code often used to fail (usually with some form of not found message when looking for the wrong locator type I think) but they still usually walk about OK.

I'm happy to leave it as a curiosity the only problem would be I can't talk to the barman. :unsure However leaving the tavern and returning settles him down (with dialogue) so no big deal. :onya

err - doesn't that code change mean they will always get habitue_dialog ??
 
Last edited:
Nor me - :no he's still getting lots of exercise walking mutely on the spot each time I load it (a different spot with this latest load) and she rushed off to her favourite corner.
But... I didn't get that behaviour at all. :confused:

err - doesn't that code change mean they will always get habitue_dialog ??
Uhm... Yes it does. Better do this:
Code:
      chr=LAi_CreateFantomCharacterEx(false, 0, true, true, hasgun, GetRandomModelForTypeExSubCheck(1, "Soldiers", ani, nation), ani, group, locator);   
     /*   if(rand(10)>5 || CheckAttribute(GetMainCharacter(), "quest.Contraband.scout")) // PB: Always the guard dialog while preparing a Smuggler Quest
       {*/
         chr.Dialog.filename="random_guards_group_dialog.c";
     /*   }
       else
       {
         chr.Dialog.filename="Habitue_dialog.c";
       }*/
I think I don't have a brain for modding today. :facepalm
 
Back
Top