• 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 Random Sailors Sit Tavern Dialog: Various Errors

I started a new game yesterday with the Dec 22 version and all the latest zips including the one from this morning.

I sailed to Havana on a merchant run and was chased into port by a Portagee fleet and after the battle dropped anchor. I am flying my personal flag and France and Spain are friendly.

When I went into the tavern for the night I was confronted by a soldier who turned out to be easy to kill. When I left my room the next morning another soldier turned hostile and was killed. From there I went into town and the soldiers there were fine with me. This is new to me so it is reported. The log files showed nothing unusual that I could see.
POTC4 2015-12-28 10-57-27-75.jpg POTC4 2015-12-28 10-57-43-49.jpg POTC4 2015-12-28 10-58-03-23.jpg POTC4 2015-12-28 10-58-53-43.jpg
 
This is turning into a big deal. Now every tavern I go into with soldiers in it ends in a fight. No dialog, just draw your sword and start hacking. It started in a Spanish tavern but it also happened in a Pirate tavern and a French tavern.
 
Extract attached to PROGRAM\DIALOGS . In these files, I blindly included the suggestions I posted on the previous page.
This is NOT a fully correct fix -that still needs to be done by @morgan terror-, but with a bit of luck it will behave at least a bit more reasonable with it.
 

Attachments

  • Random_dialogs.zip
    6 KB · Views: 137
Martinique, Saint Pierre. Bartolomeu storyline. I entered the tavern and while I was passing by a French soldier, he spoke to me, but the dialog box was empty. I pressed enter and I was out of the dialog. Also, when I speak to that soldier, same dialog box appears. Not sure if it's an important bug. Still, thought I should share it with you...

Note: I'm using 22 December version.

Compile and savegame included.
 

Attachments

  • Compile and savegame.rar
    553.9 KB · Views: 125
I thought it was fixed, but this fix will do it.
 

Attachments

  • random_guards_group_dialog.c
    6.2 KB · Views: 145
This definitely still needs work.
There is some dialog that doesn't show normally.

I did make a change so that Tavern brawls get triggered after the dialog closes and not during it.
 
This definitely still needs work.
There is some dialog that doesn't show normally.

I did make a change so that Tavern brawls get triggered after the dialog closes and not during it.

I'm back from by brief holiday. From what i've seen in the various topics regarding problems with this dialogue, you've been making quite a lot of adjustments. I saw mention of some fixes being included in the beta 4 zip, but also of more changes you added afterwards. If you want me to continue this, could i have the files with the most recent changes?
 
Ahoy there, @morgan terror! Good to see you around again. :cheers

See attached for my very latest versions. Includes the following changes that you can see using WinMerge.

For the guards:
- Syntax fix for your "famous pirate" check so the dialog doesn't crash
- Start of tavern brawls and soldier ambushes moved to after the dialogs close
- Guaranteed to get a soldier fight if you fly a hostile flag (player gets accused of being an enemy)
- Possibly get a soldier fight if you're hostile, but are flying a false flag (player gets accused of being a spy)
- "personal spy/enemy" replaced with just "spy/enemy"

For the sailors:
- Start of tavern brawls and soldier ambushes moved to after the dialogs close
- False Flag code modified so you won't be caught if you aren't hostile

For the pirates:
- False Flag code modified so you won't be caught if you aren't hostile

I think the Guards one may be functionally OK now, but those other two probably aren't yet.
If I recall, they don't include a case yet for when you are KNOWN to be hostile based on your current flag.
That should probably be added.

I also saw this line of dialog in the game when I first talked to a sailor:
"Alright, let's try this again... 'Would you, sir, happen to be someone willing to take me on as crew aboard your merchant and/or other vessel?'"
'Again' suggests I talked to him before, but I didn't, so I was wondering how that is meant to be used. :confused:
 

Attachments

  • Random Dialogs.zip
    6.3 KB · Views: 118
I think the Guards one may be functionally OK now, but those other two probably aren't yet.
If I recall, they don't include a case yet for when you are KNOWN to be hostile based on your current flag.
That should probably be added.

In regard to the pirates, that would probably be because that condition was originally hidden behind a fame check. This fame check has now been changed into a pure false flag check, meaning it no longer works as i originally intended. I'll add a fame check into the else condition to fix that:

Code:
        if(GetRMRelation(PChar, sti(Npchar.nation)) <= REL_WAR) //MT: At war with pirates
         {
           // MT: Chance to be recognised, not neccesarily when using a false flag
           if (GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY && GetFlagRMRelation(sti(Npchar.nation)) != RELATION_ENEMY && frnd() < GetChanceDetectFalseFlag())
           {
             if ((GetCurrentLocationNation() == PIRATE)) // MT: If you were masquerading as a pirate to sneak into their town:
             {
               Dialog.Text = DLG_TEXT[3];
               Link.l1 = DLG_TEXT[4];
             }
             else //MT: You are a rich and famous individual, hostile towards pirates
             {
               Dialog.Text = DLG_TEXT[20] + GetMySimpleName(PChar) + DLG_TEXT[21];
               Link.l1 = DLG_TEXT[22];
             }
             Link.l1.go = "exit";
             LAi_group_SetRelation("random_pirates_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
           }
           else
           {
             if (frnd()<makefloat(GetRankFromPoints(GetScore(PChar)))/12.0) //MT: detection chance
             {
               Dialog.Text = DLG_TEXT[20] + GetMySimpleName(PChar) + DLG_TEXT[21];
               Link.l1 = DLG_TEXT[22];
             }
             else //MT: The pirates don't want to bother attacking you despite being hostile:
             {
               Dialog.Text = DLG_TEXT[10];
               Link.l1 = DLG_TEXT[11];
             }
             Link.l1.go = "exit";
           }
         }

I also saw this line of dialog in the game when I first talked to a sailor:
"Alright, let's try this again... 'Would you, sir, happen to be someone willing to take me on as crew aboard your merchant and/or other vessel?'"
'Again' suggests I talked to him before, but I didn't, so I was wondering how that is meant to be used. :confused:

I'd imagined that the sailor had been talking to various people already, excluding you. The player just happens to be the xth person he tried to get a job with, hence the phrasing in the rest of that line.
 
I'd imagined that the sailor had been talking to various people already, excluding you. The player just happens to be the xth person he tried to get a job with, hence the phrasing in the rest of that line.
Ah, right; I failed to catch that. :facepalm
 
Allright, i've worked out the pirates. Also simplified the false flag check a bit, since the code was checking for player vs. NPC hostility twice, which was unecessary. Still need to add in the check for when you're known to be hostile based on your current flag though, although i suspect it won't be needed for the pirates, since they're not allied with any nation but themselves. You're either personally hostile, or not.

I also noticed you added a line 32 into the random tavern guards. I don't need to see it, but i thought i'd mention it just in case you forgot to include it in the next patch.
 

Attachments

  • random_pirates_group_dialog.c
    3.2 KB · Views: 143
  • random_pirates_group_dialog.h
    2.4 KB · Views: 135
Last edited:
Allright, i've worked out the pirates. Also simplified the false flag check a bit, since the code was checking for player vs. NPC hostility twice, which was unecessary. Still need to add in the check for when you're known to be hostile based on your current flag though, although i suspect it won't be needed for the pirates, since they're not allied with any nation but themselves. You're either personally hostile, or not.
Cool!

By the way, if you find it simpler to understand, you can replace this:
Code:
if(GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY)
With this:
Code:
if(GetNationRelation2MainCharacter(sti(NPChar.nation)) == RELATION_ENEMY)
Also, be sure to NOT use that 'chr' variable, but 'NPChar' instead!

Good catch on that superfluous check; that was definitely quite useless. :onya

You may be missing the case where you are flying a flag that is hostile to the pirates.
It looks like at the moment, if you are hostile to them and don't hide that fact, they will leave you alone.
This is something I had to add to the sitting guard dialog as well, because that wasn't covered there either.... :oops:
 
You may be missing the case where you are flying a flag that is hostile to the pirates.
It looks like at the moment, if you are hostile to them and don't hide that fact, they will leave you alone.
This is something I had to add to the sitting guard dialog as well, because that wasn't covered there either.... :oops:

I think i've got that covered now. I moved the flag hostility check outside of the brackets, which had some minor consequences for the rest of dialogue. It's a bit difficult to wrap your head around this one, but i think the comments i made in the file should help people understand.
 

Attachments

  • random_pirates_group_dialog.h
    2.5 KB · Views: 132
  • random_pirates_group_dialog.c
    3.8 KB · Views: 138
I think i've got that covered now. I moved the flag hostility check outside of the brackets, which had some minor consequences for the rest of dialogue. It's a bit difficult to wrap your head around this one, but i think the comments i made in the file should help people understand.
Thanks a lot! :cheers
 
Back
Top