• 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 "Tales of a Sea Hawk": Rabel Yverneau's ship is not attacked

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
I've just met Tobias, then Rabel Yverneau, then put to sea in Rabel Yverneau's ship. The escape would be a lot more dramatic if the blockade ships and the fort were firing at me. They're not.
safe_exit.jpg
That's a top grade compass, which would show the French ships as red if they were hostile. For that matter, if someone was shooting at me then the compass icon in the top left to allow access to worldmap wouldn't be there.

Attached are log files plus a save game where you're about to leave the tavern to go to the shipyard. Of possible concern is this in "compile.log":
Code:
Quest name Story_Follow_Rabel_And_Counterspy FOUND in QuestComplete
Quest name Story_Follow_Rabel_And_Counterspy FOUND in QuestComplete
Quest name Story_Follow_Rabel_And_Counterspy_2 FOUND in QuestComplete
Quest name Story_Follow_Rabel_And_Counterspy_2 FOUND in QuestComplete
It's reporting each of those quest cases being completed twice.
 

Attachments

  • -=Player=- Barbados.zip
    830.6 KB · Views: 140
  • compile.log
    21.2 KB · Views: 105
  • error.log
    672 bytes · Views: 109
  • system.log
    7.7 KB · Views: 106
The escape would be a lot more dramatic if the blockade ships and the fort were firing at me. They're not.
What flag are you flying?
Code:
FLAGS: The 'Speightstown Fort' has spotted us at 152.78, but is not interested as we are not hostile
FLAGS: The 'Cléopâtre' has spotted us at 387.38, but is not interested as we are not hostile
FLAGS: The 'Sémillante' has spotted us at 426.35, but is not interested as we are not hostile
FLAGS: The 'Pensee' is out of range so can neither remember nor forget us
FLAGS: The 'Pensee' has spotted us at 448.84, but is not interested as we are not hostile
^ Actually, isn't that behaviour something that YOU added to Screwface_functions.c? I don't think that is mine....

Just to be sure, can you upload that file please?

And do you have a screenshot of your F2>Nations Relations Interface for that part of the story?
 
What flag are you flying?
French, due to auto-hoist. But that shouldn't matter because of this:
Code:
    case "Story_Follow_Rabel_And_Counterspy_2":
       Group_SetTaskAttack("Story_French_Squadron", PLAYER_GROUP, true);
       Group_LockTask("Story_French_Squadron");
// KK -->
       characters[GetCharacterIndex("Rabel Iverneau")].AbordageMode = 0;
       if (GetRMRelation(pchar, FRANCE) > REL_WAR) SetRMRelation(pchar, FRANCE, REL_WAR);
       HoistFlag(FRANCE);
       iForceDetectionFalseFlag = 1;
// <-- KK
       AddCharacterGoods(pchar, GOOD_WHEAT, 40);  // Cat
       AddCharacterGoods(pchar, GOOD_RUM, 20);  //  Cat
     break;

You're supposed to hoist a false French flag, and the game is supposed to be set to automatically see through it.

Code:
FLAGS: The 'Speightstown Fort' has spotted us at 152.78, but is not interested as we are not hostile
FLAGS: The 'Cléopâtre' has spotted us at 387.38, but is not interested as we are not hostile
FLAGS: The 'Sémillante' has spotted us at 426.35, but is not interested as we are not hostile
FLAGS: The 'Pensee' is out of range so can neither remember nor forget us
FLAGS: The 'Pensee' has spotted us at 448.84, but is not interested as we are not hostile
^ Actually, isn't that behaviour something that YOU added to Screwface_functions.c? I don't think that is mine....
Yes, it's to do with fort memory. I added a toggle so that forts won't remember you if you're friendly. Without that, I imagine Speightstown fort will remember you as French, which incidentally could cause trouble when you return after Speightstown has been retaken by Britain... So if the memory code is what's responsible then it's going to foul things up here whether it remembers you as French and therefore friendly, or disregards you because you're friendly. Anyway, shouldn't 'iForceDetectionFalseFlag = 1' override that?

Just to be sure, can you upload that file please?

And do you have a screenshot of your F2>Nations Relations Interface for that part of the story?
File attached. I don't have a screenshot of nation relations at that point readily available. But the line 'if (GetRMRelation(pchar, FRANCE) > REL_WAR) SetRMRelation(pchar, FRANCE, REL_WAR);' should be a clue. ;)
 

Attachments

  • Screwface_functions.c
    24.8 KB · Views: 115
Anyway, shouldn't 'iForceDetectionFalseFlag = 1' override that?
Yes, it should. And, looking at that code, no it doesn't.
Turns out that while I did add the "override so you're never recognized" functionality in my rewrite of all this code,
I skipped over the "override so you're always recognized" one. So looks like this one's on me.
Uhm.... Oops...? :facepalm

In Screwface_functions.c, find:
Code:
// chance = 1.0;
Replace with:
Code:
if(iForceDetectionFalseFlag == 1) chance = 1.0;
I think that is going to help quite a bit.... :wp
 
Just to be sure, have I done this right? I am trying hard at the time, to be more
familiar to coding.Udklip.PNG
 
Looks good to me! Only thing I would do different is to keep the same indentation. But that doesn't affect the code.
 
That is purely to keep the code looking clean though; it usually helps with understanding the general structure.
 
As it turns out, my modification to the memory system was also to blame. If I disable it in "InternalSettings.h" then I'm attacked as I should be. Presumably the fort and ships log the fact that you're French, then somewhere check whether it's a false flag, but don't do the false flag check if they haven't logged you. That does raise the question of how this ever worked before the memory system was added, but that's a matter of minor game history interest.

Meanwhile, I've added this to my "Screwface_functions.c":
Code:
void CheckInitialFlagRelations(ref chr, float visibility_range, float ship_range)
{
   // Initialize nations
   int iNation = GetCurrentFlag();
   int nNation = sti(chr.nation);
   float rel = GetRMRelation(GetMainCharacter(), nNation);                                                                                             // GR: find your true relation to ship's nation
   bool IsFort = GetAttribute(chr, "ship.type") == SHIP_FORT_NAME;

   // Initialize relations between NPC ships
   UpdateAllShipsAtSea(chr, IsFort);

   if (IsCompanion  (chr)) return; // Companions don't care
   if (CharacterIsDead(chr)) return; // Already dead, don't change relation again

   if (rel <= REL_WAR && iForceDetectionFalseFlag == 1 && ship_range < visibility_range) chr.recognized = 1; // GR: obey forced recognition of false flag
The idea is that if you're in visible range, are actually hostile to the ship and "iForceDetectionFalseFlag == 1" is in force, the ship has its "recognized" attribute set. Further down in the function, that attribute is checked and the ship made hostile if it is set.

It could probably do with some more testing, but preliminary tests with my savegame prior to leaving Speightstown in the frigate and with another savegame at Martinique seem to work - the Speightstown fort and blockade ships attack me because "iForceDetectionFalseFlag" is in force, but St. Pierre and nearby ships don't attack me because at this point in the game I'm not famous enough for them to have much chance of detecting the false flag the normal way.
 

Attachments

  • Screwface_functions.c
    25.1 KB · Views: 110
That should help too.

I think the reasoning that I had for not adding it to the initial relations is that it gets caught by the check every minute anyway.
So they might not catch you being hostile straight away, but they should do one minute later.
 
Back
Top