• 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 Hornblower Storyline: Changes Required

Probably the best solution is to disable any sidequests that allow you to hire officers until AFTER the main Hornblower quest has completed.
 
Perhaps at the moment, but someone writing a mod in future may find a function called "HaveLetterOfMarque" and want to use it to check if you do in fact have a LoM. Or someone might want to change pirate behaviour again and have them tolerate a LoM but hate genuine commissioned officers.

Besides, check "PROGRAM\DIALOGS\governor.c", then tell me again that "HaveLetterOfMarque" is only used by pirates. ;)
The actual function use for the pirates isn't HaveLetterOfMarque but a different one. Can't remember by the top of my head.
I know for sure that it is used ONLY for that purpose though, because I wrote it myself quite recently and used it only there.
It does make use HaveLetterOfMarque but is named something like "HaveAnyLetterOfMarque" or something.
Editing HaveAnyLetterOfMarque does not influence HaveLetterOfMarque. :no
 
And any side quests which involve passengers, e.g. "A Girl Won in a Card Game" or "Elizabeth Shaw's Disappearance". They won't complete if the passengers in question are removed when you're captured.

How do you disable a side quest? If it's going to be done in "quests_reaction.c" then I may as well do the job, since what I'm working on at the moment already involves tinkering with that file.
 
Look at the Bartolomeu StartStoryline.c file; that one has some sidequests disabled.
Also relevant would be periods.c which is where most of them are enabled now.
Basically, you have to undo what is done there using DeleteAttribute lines like in the Bartolomeu example.
 
The Standard storyline quests_reaction.c file has these lines which removes your officers and stores them for later:
Code:
StorePassengers("Blaze");
Followed later by these which puts them back:
Code:
RestorePassengers("Blaze");
As I suspected, indeed Hornblower only uses the Store lines and not the Restore ones therefore you never get them back.

This happens twice, once in "Le_Reve_Capture_at_sea2" and once in "Again_Back_to_the_Indy".
Ideally each one of those should have an accompanying Restore line at an appropriate later time.
Might not be required if you don't have any officers, but it would be a good fail-safe "just in case" and requires only two lines of code.
All we'd need to know is where to put those lines to be appropriate.
 
In nations.c:
Code:
// PB -->
bool HaveAnyLetterOfMarque()
{
   ref PChar = GetMainCharacter();
   if (CheckAttribute(pchar, "professionalnavy")) return true; // <---------- ADD THIS LINE ------------
   for (int i=0; i<NATIONS_QUANTITY; i++)
   {
     if (i == PIRATE) continue;
     if (HaveLetterOfMarque(i)) return true;
   }
   return false;
}
// PB <--
That should take care of the pirates being OK with Hornblower and I don't foresee any unintended side-effects from this.
 
I still prefer to have the check done separately, for several reasons.

First is general principle. A function with a clear name like that ought to do just what it says with no side effects. It's made my job of modifying Hornblower's "quests_reaction.c" a lot easier if I can assume that, for example, "giveship2character" gives a ship to a character and that's all. Specifically, although "HaveAnyLetterOfMarque" may at the moment only be used for checking if pirates will do business with you, it's possible that some future modder may want for some reason to check whether you have any LoM, doesn't care which one, and also doesn't care about commissioned officers. Looking the other way, at the moment it's been decided that pirates should dislike both LoM and naval officers, but that could change - in fact, I'll suggest exactly that in another thread.

So I instead propose adding this to "PROGRAM\Characters\CharacterUtilite.c":
Code:
  if(mNation == PIRATE)
   {
     if(CheckAttribute(char, "professionalnavy"))
       return false;                                                     // Add this and the line above
     if(!HaveAnyLetterOfMarque())                       return true; // PB: Makes more sense
   //   if(rep <= TRADEREP_WAR)                          return true;
   }

I've done it to my own installation, then talked to Kate Blowhown, who now does indeed refuse to trade with Hornblower.

(By the way, if you're declaring variable Pchar, should not the check also use Pchar, rather than pchar? ;))
 
More updates to "quests_reaction.c":
At case "war_with_france", Britain is at war with France, Spain and Holland; so is Portugal; and with the addition of a few "SetActualRMRelation" lines, so are you personally.
At case "Deliver_the_documents", they're all neutral again.
Various characters are removed from the Passengers list when no longer required. More may need to go when I get to the end of the story and I see who else is still there that should not be...

There was a peculiar bug whereby, when you approach Martinique to attack the Temeraire, you become hostile to Britain! The only line around there which does anything to relations is this in "French_Battle_Setup":
Code:
SetActualRMRelation("French_Squadron", REL_WAR);
I commented this out and tried the battle again; that did the trick, you no longer become hostile to Britain, and Temeraire still attacks because I'm flying a British flag. It would probably attack if you're flying Personal flag too, since the above changes make sure you're at war with France. You could probably approach in peace by flying a false French flag, but since the whole point of this mission is to destroy Temeraire, you'd presumably only do that in order to get into a favourable position before hoisting British or Personal flag and starting the battle.
 

Attachments

  • quests_reaction.c
    773.1 KB · Views: 107
First guess for where to put a "RestorePassengers" line would be at "Repair_to_Jamaica", as that's where "The Duchess and the Devil" ends and "Land Battle" begins. What's got me confused is that there are two "StorePassengers" lines - it may be necessary to put a "RestorePassengers" line right before the second "StorePassengers", depending on what "StorePassengers" actually does and whether the second one would cause the original passengers to be pushed out of wherever they're stored by the first one. Or possibly comment out the second "StorePassengers" line and see if anyone joins you back in prison who should not be there.

Officers aren't the only problem. If you've taken a side quest which involves a passenger and then get captured, that quest can't complete. Of particular concern is "Saga of the Blaque Family" - you could visit St. Pierre and start the quest while you're on the way from Nevis to Bridgetown to collect Quelp and Bracegirdle very early in the story, but you don't often get to Kingston until you need to take Wellesley and Foster there after "Tunnel of Trouble". Right after that is "Examination for Lieutenant", and right after that is "The Duchess and the Devil", which means if you collect Marc Blaque around this time, you're going to lose him...
 
Last edited:
First guess for where to put a "RestorePassengers" line would be at "Repair_to_Jamaica", as that's where "The Duchess and the Devil" ends and "Land Battle" begins. What's got me confused is that there are two "StorePassengers" lines - it may be necessary to put a "RestorePassengers" line right before the second "StorePassengers", depending on what "StorePassengers" actually does and whether the second one would cause the original passengers to be pushed out of wherever they're stored by the first one. Or possibly comment out the second "StorePassengers" line and see if anyone joins you back in prison who should not be there.
Indeed I would imagine that each StorePassengers must have a RestorePassengers line before the next StorePassengers.
I'm not sure how those functions are written, but that would be the safest solution to prevent overwriting a previously stored set of passengers.

Officers aren't the only problem. If you've taken a side quest which involves a passenger and then get captured, that quest can't complete. Of particular concern is "Saga of the Blaque Family" - you could visit St. Pierre and start the quest while you're on the way from Nevis to Bridgetown to collect Quelp and Bracegirdle very early in the story, but you don't often get to Kingston until you need to take Wellesley and Foster there after "Tunnel of Trouble". Right after that is "Examination for Lieutenant", and right after that is "The Duchess and the Devil", which means if you collect Marc Blaque around this time, you're going to lose him...
Very true. As far as the game is concerned, officers and passengers are the same thing. You can probably assign an officer type to Virginie as well, for example. Who knows? Perhaps she makes a good bosun? :cheeky

More updates to "quests_reaction.c":
At case "war_with_france", Britain is at war with France, Spain and Holland; so is Portugal; and with the addition of a few "SetActualRMRelation" lines, so are you personally.
At case "Deliver_the_documents", they're all neutral again.
Various characters are removed from the Passengers list when no longer required. More may need to go when I get to the end of the story and I see who else is still there that should not be...
Brilliant; thanks for doing this! :cheers

There was a peculiar bug whereby, when you approach Martinique to attack the Temeraire, you become hostile to Britain! The only line around there which does anything to relations is this in "French_Battle_Setup":
Code:
SetActualRMRelation("French_Squadron", REL_WAR);
I commented this out and tried the battle again; that did the trick, you no longer become hostile to Britain, and Temeraire still attacks because I'm flying a British flag. It would probably attack if you're flying Personal flag too, since the above changes make sure you're at war with France. You could probably approach in peace by flying a false French flag, but since the whole point of this mission is to destroy Temeraire, you'd presumably only do that in order to get into a favourable position before hoisting British or Personal flag and starting the battle.
That does indeed look like a very bad line of code. SetActualRMRelation works between nations, but "French_Squadron" is not a nation.
"England" is a default of sorts in the code, so possibly because you are asking the game to set you hostile to something it doesn't understand, it figures it will set you hostile to the default England instead.
Not so good! :shock
 
Very true. As far as the game is concerned, officers and passengers are the same thing. You can probably assign an officer type to Virginie as well, for example. Who knows? Perhaps she makes a good bosun? :cheeky
I know you can't assign her as commander of a prize ship because I tried. It doesn't complain about skills or anything, it just doesn't let you assign her.
Brilliant; thanks for doing this! :cheers
Someone already reported the list of passengers here. From that list:
William Chumley: removed at "Find_Kennedy_in_Tavern", which is where "Land Battle" ends and "Mutiny" begins
Henry Wellard: removed at "Buckland_on_deck", round about where his death during recapture of Renown is announced
Archie Kennedy, Lt. Percy Buckland: removed at "Retribution_and_Promotion2", which is where a couple of other "Remove" commands for Buckland are located, and round about where Pellew tells you that you're cleared due to Kennedy's "confession" before he died
Teresa Moreno, Jack Hammond: still to be done
Sharpe and his men: undecided about them. On the one hand, they're army, not marines, so perhaps ought to be removed until needed for some future quest. On the other hand, they were assigned to your ship for the Guadeloupe action and could stay with you for future free-play action on land.
Styles, Wilks: part of your crew, they can stay.
That does indeed look like a very bad line of code. SetActualRMRelation works between nations, but "French_Squadron" is not a nation.
"England" is a default of sorts in the code, so possibly because you are asking the game to set you hostile to something it doesn't understand, it figures it will set you hostile to the default England instead.
Not so good! :shock
That makes sense. Anyway, the battle works with that line commented out because I tried it.
 
Sharpe and his men: undecided about them. On the one hand, they're army, not marines, so perhaps ought to be removed until needed for some future quest. On the other hand, they were assigned to your ship for the Guadeloupe action and could stay with you for future free-play action on land.
My first impression is that they should be removed as well. They aren't even in the films or books at all and having too many companions to support you might make Free Play not quite challenging enough.
 
I'm not that worried about consistency with the books or TV series, partly because Sharpe and Hornblower did not appear in each other's material, and partly because their activities took place on the other side of the Atlantic. The whole storyline involves a great deal of artistic licence! xD

Meanwhile, back to the fixing...

I tried putting in two "RestorePassengers" lines, one right before the second "StorePassengers" and another at "Repair_to_Jamaica". This messed up the dialog when Hornblower and the Duchess have just been fished out of the sea and are in Pellew's cabin. I took out the first "RestorePassengers" and it seemed to work, except that the remaining "RestorePassengers" had the side effect of restoring both the Duchess and Midshipman Hunter. So I then added some removal lines to get rid of them again. That seems to have done the trick, though a further development involving one of the side quests means I'm going to have to do some more testing when I have time for a long play session... I've also added "RemovePassengers" lines to get rid of Teresa Moreno and Jack Hammond at relevant times - there may be a case for Sharpe to remain assigned to Hornblower's ship, but Teresa Moreno will be off fighting her own campaign, and Jack Hammond is dead at the end of the Guadeloupe action.

Talking of Guadeloupe, I found this:
Code:
    case "Land_Guedeloupe_for_Hogan":
       LAi_SetOfficerType(characterFromID("Teresa Moreno"));
       pchar.quest.To_Guadeloupe_shore_Hogan.win_condition.l1 = "location";
       Pchar.quest.To_Guadeloupe_shore_Hogan.win_condition.l1.character = Pchar.id;
       pchar.quest.To_Guadeloupe_shore_Hogan.win_condition.l1.location = "Guadeloupe_shore_01";
       pchar.quest.To_Guadeloupe_shore_Hogan.win_condition = "To_Guadeloupe_shore_Hogan";
     break;
I can't find any call to "Land_Guedeloupe_for_Hogan", nor any variant involving a correct spelling of "Guadeloupe". So whatever that section is supposed to be doing, it's probably not doing it...
 
Talking of Guadeloupe, I found this:
Code:
    case "Land_Guedeloupe_for_Hogan":
       LAi_SetOfficerType(characterFromID("Teresa Moreno"));
       pchar.quest.To_Guadeloupe_shore_Hogan.win_condition.l1 = "location";
       Pchar.quest.To_Guadeloupe_shore_Hogan.win_condition.l1.character = Pchar.id;
       pchar.quest.To_Guadeloupe_shore_Hogan.win_condition.l1.location = "Guadeloupe_shore_01";
       pchar.quest.To_Guadeloupe_shore_Hogan.win_condition = "To_Guadeloupe_shore_Hogan";
     break;
I can't find any call to "Land_Guedeloupe_for_Hogan", nor any variant involving a correct spelling of "Guadeloupe". So whatever that section is supposed to be doing, it's probably not doing it...
If I recall, I have found code before that wasn't references anywhere at all. Might be from some idea that SJG never got round to finishing.
 
Correction: it is used after all. It isn't called from within "quests_reaction.c", it's called from within "Teresa Moreno_dialog.c".

Which puzzles me. My main campaign finished with "The Duchess and the Devil" long ago, which means all my code involving "RestorePassengers" and removing the Duchess of Wharfedale and Midshipman Hunter hasn't taken effect. That means the Duchess and Hunter were still stashed away, and then resurrected after I completed "Help the Lady". As a quick'n'dirty fix to get them out of my main game, I saved game on the worldmap just off Guadeloupe, then added some removal lines just to get them out of this game. First I tried putting them in "Land_Guedeloupe_for_Hogan", and they had no effect - I even added a "logit" line to see if the game had even got to those lines and no message appeared. I moved the whole lot down to "To_Guadeloupe_shore_Hogan", the "logit" message duly appeared, and the Duchess and Hunter promptly disappeared from my Passengers list and walked off.
 
Another minor change to relations. When war with France starts, America is also at war with France. Likewise, when everyone else makes peace with France, so does America. The reason is the Quasi-War.

Basically, America had some deals with France following its own revolution, but those were with the Kingdom of France. America then refused to continue them, saying that they no longer applied to the French republic. France didn't like that at all and, after diplomacy failed, started attacking American shipping. America didn't like that and rebuilt its navy with a view to taking on French privateers. No war was formally declared. Likewise, America didn't formally ally with Britain nor officially co-operate, but merchant ships from each nation could join the other's convoys.

In the initial briefing to Hornblower, Sir Hew Dalrymple says "Things are not as cut and dried in these waters as they are in Europe. Technically we are not at war, yet. But that will not stop the occasional battle between us." That was probably an excuse to cover the fact that default relations in "Napoleonic" have Britain hostile to France, but in this story war is not declared until later in the game. Since I've arranged that Britain and France are neutral until the proper time, that excuse is no longer needed, so I changed the dialog. But if Hornblower had been talking to a senior American, that line would perfectly describe relations between America and France. Much of the action in the Quasi-War took place in the Caribbean, putting it right into our game. :)

The Quasi-War started in 1798 and ended in 1800, near enough the same time as the storyline's war and peace between Britain and France, so I put America's relation changes together with the rest so anyone else who wants to play with relations doesn't need to search all through "quests_reaction.c" to find them.

Incidentally, if you look at that article about the Quasi-War, you'll find reference to the Magicienne. And now I know what sort of ship to make her. :D
 
Back
Top