• 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

jsv

Freebooter
Storm Modder
OK, first there is a error on the line 47 of Random_sailors_sit_tavern_dialog.c, which line looks like this:

Code:
Link.l1 = RandSwear() + [29];

I guess it's supposed to be DLG_TEXT[29].

That error might be the reason for the situation I describe below, or it might be not. It's the only error I have in the log, though.

I'm on a Portuguese island (Los Barbados), flying personal flag since the start of the game. Portuguese are wary of me, just like everyone else.

All worked well until I've sailed off to sell that wine to smugglers. Now, when I'm back, random people in tavern accuse me of not being Portuguese (which I never pretended to be, not in this game), and a guard appears to arrest me for being a personal spy:

personal_jesus.jpg



I've fixed that dialog file and tried to reenter the tavern a couple of times and the problem seems to disappear... but I'm not yet sure.
 
OK, first there is a error on the line 47 of Random_sailors_sit_tavern_dialog.c, which line looks like this:

Code:
Link.l1 = RandSwear() + [29];

I guess it's supposed to be DLG_TEXT[29].

It is indeed. I missed that. This whole dialogue file was rebuilt from scratch, so i'm not surprised it's working a bit poorly. Thanks for spotting that.

That error might be the reason for the situation I describe below, or it might be not. It's the only error I have in the log, though.

I'm on a Portuguese island (Los Barbados), flying personal flag since the start of the game. Portuguese are wary of me, just like everyone else.

All worked well until I've sailed off to sell that wine to smugglers. Now, when I'm back, random people in tavern accuse me of not being Portuguese (which I never pretended to be, not in this game), and a guard appears to arrest me for being a personal spy:

View attachment 24822


I've fixed that dialog file and tried to reenter the tavern a couple of times and the problem seems to disappear... but I'm not yet sure.

The two problems you describe there mean that the false flag checks aren't working as intended. They're only supposed to trigger when you're at war, but you're not. See this code for people accusing you of being portugese:

Code:
        if (frnd() < GetChanceDetectFalseFlag()) //MT: Chance to be recognised when at war with the nation the sailor belongs to. Does not have to involve a false flag
         {
           switch(makeint(Npchar.nation))
           {
             case ENGLAND : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Eng_m_a_070.wav");}break;
             case FRANCE : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Fre_m_c_048.wav");}break;
             case SPAIN : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Spa_m_b_043.wav");}break;
             case PIRATE : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Por_m_a_044.wav");}break;
             case HOLLAND : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Dut_m_a_058.wav");}break;
             case PORTUGAL : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Por_m_a_053.wav");}break;
             case AMERICA : if(Npchar.sex=="man"){PlaySound("VOICE\" + LanguageGetLanguage() + "\Eng_m_a_070.wav");}break;
           }
           Dialog.Text = DLG_TEXT[12] + GetNationDescByType(sti(NPChar.nation)) + DLG_TEXT[13] + GetNationDescByType(sti(PChar.nation)) + DLG_TEXT[14];
           Link.l1 = DLG_TEXT[15] + GetNationDescByType(sti(NPChar.nation)) + DLG_TEXT[16];
           Link.l1.go = "exit";
           if (makeint(NPchar.nation)==PIRATE)
           {
             if(TAVERNBRAWL_FROMDIALOG) //MT: If the possibility of tavernbrawls is turned on in internalsettings:
             {
               if (TAVERNBRAWL_FISTSONLY) PChar.TAVERNBRAWL = true; //MT: deletes the group's weapons, if enabled in internalsettings
               {LAi_LocationFightDisable(&locations[FindLocation(Pchar.location)], false);
               Random_Raid("smugglers", 5, PIRATE,"enemy","friend",LanguageConvertString(tmpLangFileID,"TAVERNBRAWL") + "!!!!");}
               DeleteAttribute(PChar,"TAVERNBRAWL"); //MT: resets tavernbrawl attribute so enemies won't always spawn with fists afterwards.
             } 
           }
           else
           {
             if(TAVERNBRAWL_FROMDIALOG) //MT: If the possibility of tavernbrawls is turned on in internalsettings:
             {
               LAi_LocationFightDisable(&locations[FindLocation(Pchar.location)], false);
               Random_Raid("soldiers", 5, makeint(NPchar.nation),"enemy","friend","");
             } 
           }
           Diag.TempNode = "exit";
         }

And this bit for the guards arresting you as a spy:

Code:
        if(frnd() < GetChanceDetectFalseFlag()) //MT: If at war with the nation the guard belongs to, there is a chance to be detected (false flags can only occur when at war):
         {
           Dialog.Text = DLG_TEXT[7] + GetMySimpleName(PChar) + DLG_TEXT[8] + GetNationDescByType(sti(PChar.nation)) + DLG_TEXT[10];
           Link.l1 = DLG_TEXT[9];
           Link.l1.go = "exit";
           LAi_group_SetRelation("random_guards_group", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
         }

Both start with the false flag check (which doesn't necessarily involve flags, just sneaking around in hostile territory), and both involve the GetNationDescByType(sti(PChar.nation)) string, which is what inserts your nationality into the sentence. I'd made the assumption you couldn't fail the false flag check while running your personal flag, which is obviously not true. The reason why you're not encountering this bug all the time is because you're sometimes passing the check, while other times not. I'll have to think on this.

EDIT: I think i now understand why the original dialogue file had a check to see if you're at war AFTER the false flag check. You can fail false flag checks even when not hostile.
 
Last edited:
I'm posting the code that checks for the player's relation to a nation for the false flag check here so it's easier for me to find:

Code:
bool CheckForMainCharacterfalseflag(ref chr, float visibility_range, float ship_range)
{
   if (IsCompanion(chr))             return false; // Companions don't care
   if (CheckForPirateException(chr))       return false; // You are friendly to the pirates, flying a pirate flag and the town is tolerant of pirates
   if (GetAttribute(chr, "skipFalseFlag"))     return false; // Quest ship that will always believe your false flag

   ref PChar = GetMainCharacter();

   bool Recognized = false;
   float chance = 1 - (ship_range / visibility_range);
   float randVal = frnd();
   if (SeaAI_GetRelation(sti(chr.index), sti(PChar.index)) != RELATION_ENEMY && GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY)
   {
     if (ship_range < visibility_range)
     {
       chance = 0.5 + chance; // 0.5 will be decreased if you are too easily recognized
       chance = chance * GetChanceDetectFalseFlag();
     //   chance = 1.0;
       if(randVal <= chance)
       {
         Trace("FLAGS: The " + GetMyShipNameShow(chr) + " has recognized our false " + GetNationDescByType(GetCurrentFlag()) + " flag at range=" + ship_range + " with visibility=" + visibility_range + ", chance=" + chance + " and frnd=" + randVal);
         Recognized = true;
         SetGroupHostile(chr, false); // They start firing on you, so it is no immediate betrayal
       }
     }
   }
   return Recognized;
}
 
This bit
Code:
GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY
would suggest that there should indeed only be a chance at detection when you're enemies. So the problem lies with the fact that wary is regarded as being hostile, rather than more of a halfway point.

The problem that personal nation can also be used to trigger false flag checks is a different one. It shouldn't, really, although it is quite reasonable to have a chance at avoiding detection even when flying your personal flag. I'll have to work around that in a different way somehow.
 
Wary is definitely not Hostile. :no

By definition, a Personal Flag should NOT EVER be false. Because those are your true relations.
Those relations may be linked to another nation's, if you serve England for example. But personal is the truth.

Any any all "false flag detection" should be done only when your personal relation to the ship/character is hostile.
That is indeed the purpose of that line you found there. :onya

-------------------------------------------------------------

To make it hopefully simpler to understand, here is a cleaned up version of your code:
Code:
      // ccc Dec 05 You are recognized for your pirating actions
       if(GetServedNation() == PIRATE && GetCurrentLocationNation() != PIRATE)   // MT: If serving the pirates and in a non-pirate location, then:
       {
         if(frnd()<makefloat(GetRank(pchar, sti(NPChar.nation)))/12.0) //MT: Meant to make you easier to detect as a pirate as you go up in pirate rank
         {
           // Tavern Brawl because you're discovered as a pirate in a non-pirate location
         }
         else //MT: Not recognised as pirate.
         {
           // Nothing happens, dialog closes
         }
       }
       else //MT: You don't serve the pirates or you are in a pirate location, or both. (note: friendly does not neccesarily mean serving!)
       {
         if (frnd() < GetChanceDetectFalseFlag()) //MT: Chance to be recognised when at war with the nation the sailor belongs to. Does not have to involve a false flag
         {
           // Recognized as a spy
           if (makeint(NPchar.nation)==PIRATE)
           {
             // Pirate Tavern Brawl
           }
           else
           {
             // Soldiers Appear
           }
         }
         else
         {
           if (GetFlagRMRelation(sti(Npchar.nation)) <= REL_WAR && GetCurrentFlag() != PERSONAL_NATION) //MT: You're not personally hostile towards the nation the sailor belongs to, but your flag is. Also excludes you using your personal flag; personal hostility is covered under the false flag check above.
           {
             // Tavern Brawl
           }
           else //MT: you are not hostile to the person you're talking to, in any way, meaning you can hire them. Also includes you not being recognised.
           {
             if (frnd()>0.8) //MT: Random chance for people to ignore you
             {
               // Nothing happens
             }
             else
             {
               if (frnd()<makefloat(GetRank(pchar, sti(NPChar.nation)))/12.0 || frnd()<makefloat(GetRankFromPoints(GetScore(PChar)))/12.0) //MT: high-ranking officer with a nation or famous
               {
                 // Famous character
               }
               else //MT: if not famous
               {
                 if (IsInServiceOf(sti(Npchar.nation))) //MT: You serve the nation of whoever you're talking to, either through navy or LoM
                 {
                   // Navy Officer or Privateer
                 }
                 else //MT: not in service
                 {
                   // Default dialog
                 }
               }
               if(Pchar.Ship.Crew.Quantity<maxCrewquantity)
               {
                 // Possibility to hire
               }
               else
               {
                 // Dialog exits
               }
             }
           }
         }
       }

And here a complete "bare bones" version of how I figure it should work in pseudo-code:
Code:
if (pirate in non pirate location)
{
   // At least Tavern Brawl, but maybe instead SOLDIERS coming to arrest and hang you
}
else
{
   if (flag relation hostile)
   {
     // They THINK you're hostile, so all hell breaks loose too
     // You may not truly be hostile to them, but they don't know that
     // This also catches coming in under a hostile PERSONAL flag
   }
   else
   {
     if (personal relation hostile && false flag detected)
     {
       // You pretended to NOT be hostile, but you ARE and you got caught out
       // More hell breaking loose
     }
     else
     {
       // You truly ARE not hostile, or they think you aren't
       // Either way, let peaceful relations ensue
     }
   }
}
Of course you can put more fancy stuff in there somewhere, but I reckon that should be the basic functionality you need.
 
Wary is definitely not Hostile. :no

By definition, a Personal Flag should NOT EVER be false. Because those are your true relations.
Those relations may be linked to another nation's, if you serve England for example. But personal is the truth.

Any any all "false flag detection" should be done only when your personal relation to the ship/character is hostile.
That is indeed the purpose of that line you found there. :onya

-------------------------------------------------------------

To make it hopefully simpler to understand, here is a cleaned up version of your code:
Code:
      // ccc Dec 05 You are recognized for your pirating actions
       if(GetServedNation() == PIRATE && GetCurrentLocationNation() != PIRATE)   // MT: If serving the pirates and in a non-pirate location, then:
       {
         if(frnd()<makefloat(GetRank(pchar, sti(NPChar.nation)))/12.0) //MT: Meant to make you easier to detect as a pirate as you go up in pirate rank
         {
           // Tavern Brawl because you're discovered as a pirate in a non-pirate location
         }
         else //MT: Not recognised as pirate.
         {
           // Nothing happens, dialog closes
         }
       }
       else //MT: You don't serve the pirates or you are in a pirate location, or both. (note: friendly does not neccesarily mean serving!)
       {
         if (frnd() < GetChanceDetectFalseFlag()) //MT: Chance to be recognised when at war with the nation the sailor belongs to. Does not have to involve a false flag
         {
           // Recognized as a spy
           if (makeint(NPchar.nation)==PIRATE)
           {
             // Pirate Tavern Brawl
           }
           else
           {
             // Soldiers Appear
           }
         }
         else
         {
           if (GetFlagRMRelation(sti(Npchar.nation)) <= REL_WAR && GetCurrentFlag() != PERSONAL_NATION) //MT: You're not personally hostile towards the nation the sailor belongs to, but your flag is. Also excludes you using your personal flag; personal hostility is covered under the false flag check above.
           {
             // Tavern Brawl
           }
           else //MT: you are not hostile to the person you're talking to, in any way, meaning you can hire them. Also includes you not being recognised.
           {
             if (frnd()>0.8) //MT: Random chance for people to ignore you
             {
               // Nothing happens
             }
             else
             {
               if (frnd()<makefloat(GetRank(pchar, sti(NPChar.nation)))/12.0 || frnd()<makefloat(GetRankFromPoints(GetScore(PChar)))/12.0) //MT: high-ranking officer with a nation or famous
               {
                 // Famous character
               }
               else //MT: if not famous
               {
                 if (IsInServiceOf(sti(Npchar.nation))) //MT: You serve the nation of whoever you're talking to, either through navy or LoM
                 {
                   // Navy Officer or Privateer
                 }
                 else //MT: not in service
                 {
                   // Default dialog
                 }
               }
               if(Pchar.Ship.Crew.Quantity<maxCrewquantity)
               {
                 // Possibility to hire
               }
               else
               {
                 // Dialog exits
               }
             }
           }
         }
       }

And here a complete "bare bones" version of how I figure it should work in pseudo-code:
Code:
if (pirate in non pirate location)
{
   // At least Tavern Brawl, but maybe instead SOLDIERS coming to arrest and hang you
}
else
{
   if (flag relation hostile)
   {
     // They THINK you're hostile, so all hell breaks loose too
     // You may not truly be hostile to them, but they don't know that
     // This also catches coming in under a hostile PERSONAL flag
   }
   else
   {
     if (personal relation hostile && false flag detected)
     {
       // You pretended to NOT be hostile, but you ARE and you got caught out
       // More hell breaking loose
     }
     else
     {
       // You truly ARE not hostile, or they think you aren't
       // Either way, let peaceful relations ensue
     }
   }
}
Of course you can put more fancy stuff in there somewhere, but I reckon that should be the basic functionality you need.

I know, but the problem is that he's failing false flag checks under both his personal flag and while being wary to portugal, not hostile. The dialogue he's getting can only trigger when failing such a check. It's the false flag check that's not working properly.
 
Hang on. Is this check
Code:
if (frnd() < GetChanceDetectFalseFlag())
Written wrong? It should come back as false if you pass a false flag check, or if you weren't running a false flag.
 
Actually, the above doesn't cover the whole "pirate exception" part.
Because this can be quite complex, I suggested using the 'TradeCheck' function from PROGRAM\Characters\CharacterUtilite.c a while back.

With that, you could reduce the complexity to this:
Code:
if(GetServedNation() == PIRATE && GetCurrentLocationNation() != PIRATE)
{
  // At least Tavern Brawl, but maybe instead SOLDIERS coming to arrest and hang you
}
else
{
   if (TradeCheck(PChar, NPChar, true))
   {
     // For whatever reason, they figure you are OK
   }
   else
   {
     // Nope, you're an unwanted person for whatever reason
   }
}
Definitely a lot less functionality there than what used to be there.
But not technically wrong at least, and should be quite simple.

If you need more control, we could split the 'TradeCheck' function in a part that you can use,
with a second 'wrapper' function around it for shipyards/stores/tavern owners.
But I haven't thought of where that might be required yet.
 
Actually, the above doesn't cover the whole "pirate exception" part.
Because this can be quite complex, I suggested using the 'TradeCheck' function from PROGRAM\Characters\CharacterUtilite.c a while back.

With that, you could reduce the complexity to this:
Code:
if(GetServedNation() == PIRATE && GetCurrentLocationNation() != PIRATE)
{
  // At least Tavern Brawl, but maybe instead SOLDIERS coming to arrest and hang you
}
else
{
   if (TradeCheck(PChar, NPChar, true))
   {
     // For whatever reason, they figure you are OK
   }
   else
   {
     // Nope, you're an unwanted person for whatever reason
   }
}
Definitely a lot less functionality there than what used to be there.
But not technically wrong at least, and should be quite simple.

If you need more control, we could split the 'TradeCheck' function in a part that you can use,
with a second 'wrapper' function around it for shipyards/stores/tavern owners.
But I haven't thought of where that might be required yet.

Please check my above response. I think the problem might be there.
 
Hang on. Is this check
Code:
if (frnd() < GetChanceDetectFalseFlag())
Written wrong? It should come back as false if you pass a false flag check, or if you weren't running a false flag.
Written as that, it would return TRUE if you are caught, FALSE if you're not.

Note also that "if you weren't running a false flag" is NOT anywhere in there.
It just checks if (random number < certain fixed number) .

That fixed number depends on your fame, skills and the difficulty level.
Effectively it has ZERO to do with nation relations or flags.
So it won't return by definition '0.0' because you aren't flying a false flag.
In theory, you could be friendly with EVERY nation in the game and that line could STILL return either 'true' or 'false'.

But this line you found CAN be used to determine if your flag is actually false:
Code:
GetNationRelation(PERSONAL_NATION, sti(chr.nation))
If that DOES give RELATION_ENEMY, but GetFlagRMRelation does NOT, then in reality you're hostile, but your flag claims that you aren't.
That makes it a false flag.


Also, this check goes wrong:
Code:
GetFlagRMRelation(sti(Npchar.nation)) <= REL_WAR
You probably want to check:
Code:
GetFlagRMRelation(sti(Npchar.nation)) == RELATION_ENEMY
'GetFlagRMRelation' can only return RELATION_ENEMY, RELATION_NEUTRAL or RELATION_FRIEND which are #defined as '2', '1' and '0'.
But:
Code:
#define REL_WAR -60.0
So you're checking if "a value that could be 0, 1 or 2 is lower than or equal to -60". That will never happen.

You may have gotten confused by such functions like:
Code:
float rel = GetRMRelation(char, iNation);
That one returns the "relation points" you have which you CAN check against that limit of '-60.0'.

It can get quite complicated to check exactly which functions return what types of input and what type of output they then give.
You aren't the first to run into mismatches there and you won't be the last. I know for a fact that both myself and @Levis have also been guilty of it. :cheeky

Please check my above response. I think the problem might be there.
I was still writing this post! :whipa
 
I did show that check while we were still busy writing that code, and it was allright back then. :facepalm I guess you lacked context. I also know you were too busy with releasing the new version to check it all over back then though, so it's allright. Only problem is that i have only one day left to do it. I'll be gone for a week afterwards.

Written as that, it would return TRUE if you are caught, FALSE if you're not.

Note also that "if you weren't running a false flag" is NOT anywhere in there.
It just checks if (random number < certain fixed number) .

That fixed number depends on your fame, skills and the difficulty level.
Effectively it has ZERO to do with nation relations or flags.
So it won't return by definition '0.0' because you aren't flying a false flag.
In theory, you could be friendly with EVERY nation in the game and that line could STILL return either 'true' or 'false'.

But this line you found CAN be used to determine if your flag is actually false:
Code:
GetNationRelation(PERSONAL_NATION, sti(chr.nation))
If that DOES give RELATION_ENEMY, but GetFlagRMRelation does NOT, then in reality you're hostile, but your flag claims that you aren't.
That makes it a false flag.

So i should be replacing all instances of 'if (frnd() < GetChanceDetectFalseFlag())' with 'if GetNationRelation(PERSONAL_NATION, sti(chr.nation)) <=REL_WAR &&
GetFlagRMRelation(sti(Npchar.nation)) != RELATION_ENEMY'
to make it work as i intended? That does mean i need to make some further changes to the rest of the dialogue trees, in particular the pirates. That still leaves us with the 'personal spy' problem though.

Also, this check goes wrong:
Code:
GetFlagRMRelation(sti(Npchar.nation)) <= REL_WAR
You probably want to check:
Code:
GetFlagRMRelation(sti(Npchar.nation)) == RELATION_ENEMY
'GetFlagRMRelation' can only return RELATION_ENEMY, RELATION_NEUTRAL or RELATION_FRIEND which are #defined as '2', '1' and '0'.
But:
Code:
#define REL_WAR -60.0
So you're checking if "a value that could be 0, 1 or 2 is lower than or equal to -60". That will never happen.

You may have gotten confused by such functions like:
Code:
float rel = GetRMRelation(char, iNation);
That one returns the "relation points" you have which you CAN check against that limit of '-60.0'.

It can get quite complicated to check exactly which functions return what types of input and what type of output they then give.
You aren't the first to run into mismatches there and you won't be the last. I know for a fact that both myself and @Levis have also been guilty of it. :cheeky

I dunno. :shrug I was just copying things over from the WIP topic, so i guess that's what happened. At any rate, it's fixed now.

I was still writing this post! :whipa

Well yeah, but i'd also posted something at the same time you did, meaning you could have quite easily missed it. Better to quote so you get that notification, since i'm in a bit of a hurry here.
 
You could try replacing this:
Code:
if (frnd() < GetChanceDetectFalseFlag())
With this:
Code:
if (GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY && GetFlagRMRelation(sti(Npchar.nation)) != RELATION_ENEMY && frnd() < GetChanceDetectFalseFlag())

As for the spy nation name, you could use:
Code:
string sNation = GetNationDescByType(GetServedNation()) + " ";
if (GetServedNation() == PERSONAL_NATION) sNation = "";
Dialog.Text = DLG_TEXT[12] + GetNationDescByType(sti(NPChar.nation)) + DLG_TEXT[13] + sNation + DLG_TEXT[14];

That way it will be a "a English spy" if you serve England, but simply "a spy" if you're personal.
It is also better to use GetServedNation() here instead, because sti(pchar.nation) is always exactly the same as the flag you're currently flying.
So getting caught under a false Portuguese flag in a Portuguese town would get you accused of being a Portuguese spy.
Wha??? :rofl

I did show that check while we were still busy writing that code, and it was allright back then. :facepalm I guess you lacked context. I also know you were too busy with releasing the new version to check it all over back then though, so it's allright. Only problem is that i have only one day left to do it. I'll be gone for a week afterwards.
To my great regret, I have been being EXTREMELY busy the past few weeks. Mainly with real life work.
As much as I want to help, there's only so much I can do. :(
 
You could try replacing this:
Code:
if (frnd() < GetChanceDetectFalseFlag())
With this:
Code:
if (GetNationRelation(PERSONAL_NATION, sti(chr.nation)) == RELATION_ENEMY && GetFlagRMRelation(sti(Npchar.nation)) != RELATION_ENEMY && frnd() < GetChanceDetectFalseFlag())

But i'd have to place the &&'s in two seperate 'if's' though right? As in, the third condition would make up the second 'if'? I remember you saying i could only have one && and such per 'if' condition. Why is frnd() < GetChanceDetectFalseFlag() in there though? The way i understood it, it didn't do what we wanted at all. I'd solve the problem by putting a fame check in there, like frnd()<makefloat(GetRankFromPoints(GetScore(PChar)))/12.0.

As for the spy nation name, you could use:
Code:
string sNation = GetNationDescByType(GetServedNation()) + " ";
if (GetServedNation() == PERSONAL_NATION) sNation = "";
Dialog.Text = DLG_TEXT[12] + GetNationDescByType(sti(NPChar.nation)) + DLG_TEXT[13] + sNation + DLG_TEXT[14];

That way it will be a "a English spy" if you serve England, but simply "a spy" if you're personal.
It is also better to use GetServedNation() here instead, because sti(pchar.nation) is always exactly the same as the flag you're currently flying.
So getting caught under a false Portuguese flag in a Portuguese town would get you accused of being a Portuguese spy.
Wha??? :rofl

This looks like it's going to become an absolutely horrendous stack of 'if's', but i'll manage.

To my great regret, I have been being EXTREMELY busy the past few weeks. Mainly with real life work.
As much as I want to help, there's only so much I can do. :(

I understand. I wish i had more time for this too.
 
But i'd have to place the &&'s in two seperate 'if's' though right? As in, the third condition would make up the second 'if'? I remember you saying i could only have one && and such per 'if' condition.
You cannot mix and match '||' and '&&' in the same if-statement. But if you're just using '&&' you can use however many you want.

Why is frnd() < GetChanceDetectFalseFlag() in there though? The way i understood it, it didn't do what we wanted at all. I'd solve the problem by putting a fame check in there, like frnd()<makefloat(GetRankFromPoints(GetScore(PChar)))/12.0.
It does what *I* would want it to by introducing a random element based on skills and fame.
The other parts of the check are to ensure the false flag detection works only IF you have a false flag.
That isn't included in GetChanceDetectFalseFlag() itself so that function remains multi-purpose and can be used for other things too.

This looks like it's going to become an absolutely horrendous stack of 'if's', but i'll manage.
That code I suggested only needs to be included once.
If you reuse it, you can have it at the top of the dialog.c file and then just refer to the 'sNation' variable wherever you need it.
 
If that DOES give RELATION_ENEMY, but GetFlagRMRelation does NOT, then in reality you're hostile, but your flag claims that you aren't.
That makes it a false flag.
In principle, we can check for false flag when relations are positive, but with a different set of reactions.
If I'm a Spaniard in a Spanish Town, theoretically nothing prevents me from putting on English uniform, entering a tavern, and offering a toast to King Charles.
Those who know me well will be wondering why the heck I'm doing that, while the rest would probably attack me on sight.
Just random thoughts while I'm drinking my coffee...
 
At the moment there are just about zero checks that take into account your outfit.
(Only exception are some that trigger a "stealth game mode".)

If we're talking about "on sea" behaviour, if you fly a hostile flag, you will be treated as being hostile.
There was once a "friends detect false flags" option which would get ships of friendly nations at sea ALWAYS friendly regardless of the flag you're flying.
But that was in place back in the (quite recent) days when the False Flags mod didn't at all work as intended.
When I did the rewrite to fix it all, I decided to not restore that functionality.

For now, I'd want to keep things somewhere simple.
But stuff like that could definitely be added in the future, once the basics have been confirmed to not have any unintended side-effects. :yes
 
I am planning on adding a "false outfit" etc so you can disguise. But that is for build 15 probably.
 
Can't really make use of that until walking around hostile towns is actually as dangerous as it should technically be as per Low Priority - Hostile territory | PiratesAhoy! .
For now, it is somewhat dangerous if you're a pirate in a non-pirate town. And a bit more dangerous if you use Crewmembers on Shore.
But that's about the limit of it.
 
On Martinique playing 12/22 I have encountered characters with no dialogue "First name Random Phantom Character" These appear to be groups of pirates walking around. Also got this from a soldier in a port royal tavern on Port Royal.
 
Do you have error.log files to go with that?
Sounds like the files @morgan terror was working on; those indeed still have issues to be worked out.
 
Back
Top