• 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: Matthews confused

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
I'm doing the chapter "Antigua Land Battle". Prior to one of the fights, I had to talk to Matthews, which I did by walking near him and pressing spacebar. He promptly recited the line about Renown having been captured, which had also been spoken at the correct point near the end of "Capture Spanish Fort".

What you're meant to do is walk to a particular spot, then Matthews will initiate conversation himself. I did, he did, and the rest of the chapter proceeded as normal, so it's not a serious problem.
 
Probably he just kept his dialog node from last time you spoke with him.
Ideally I suppose he should get a "default" thing to say when there isn't anything quest-worthy.
 
If u havent solved this well the same happened to me but after talking to him several times and waiting, he auto-talks with me and quest continues.
 
Does anyone have any savegames or log files related to this one?
This might be a simple fix by setting him to a default line of dialog, but we need a clue on where the relevant code is hiding.
Perhaps @Grey Roger is more familiar with the Hornblower quest code, but I'm not as I never got the chance to play it through very far....
 
Probably he just kept his dialog node from last time you spoke with him.
Ideally I suppose he should get a "default" thing to say when there isn't anything quest-worthy.
That would be the logical solution. I've seen other quest control files which did something like this, put the character's dialog node to a routine one after the current dialog is finished. I'll need to play through "Hornblower" again some time and do another round of bug-hunting and general polishing.
 
That would be the logical solution. I've seen other quest control files which did something like this, put the character's dialog node to a routine one after the current dialog is finished. I'll need to play through "Hornblower" again some time and do another round of bug-hunting and general polishing.
You could do that if you like. Though it might also be worthwhile having somebody else take a shot at it; different eyes see different things.
Eventually I'll be playing through all storylines prior to the Build 14 Full release as well and correcting whatever I find.
So depending on how important we consider this to be, you could also skip this for the time being as there are still other things to be done too.
Up to you. :shrug
 
During my current play through "Hornblower", I haven't got as far as "Antigua Land Battle" yet but a similar problem occurred just after landing on Cuba to attack the fort. Matthews warns that if Buckland doesn't move the ship then the Spanish will see her, then the Spanish do see her and there are some cannon shots. Kennedy then comments that the Spanish have seen the ship and us. If you then talk to either, they repeat those lines, and in fact talking to Matthews triggers a repeat of the cannon shots. This despite numerous lines in "Matthews_dialog.c" and "Archie Kennedy_dialog.c" saying 'Dialog.CurrentNode = "First time";'.

Those don't work. I replaced them with 'Characters[GetCharacterIndex("Matthews")].dialog.CurrentNode = "First time";' (or equivalent for Kennedy), replayed that section, and now if I talk to Matthews and Kennedy after the cannon shots, they do indeed revert to their default responses. With any luck that will also sort out Matthews during "Antigua Land Battle".
 
Perhaps you need dialog.NextNode? I think there is something like that for such purposes.

EDIT: It is Dialog.TempNode which is used for the next CurrentNode after the dialog closes.
 
Last edited:
YIKES! I just had a look through all dialog files in the Hornblower folder, and they were riddled with related mistakes.

If you look at normal dialog files, you'll notice that they have one of the following lines near their top:
Code:
makearef(Diag, NPChar.Dialog);
Or:
Code:
makearef(NextDiag, NPChar.Dialog);
Depending on which of the two it is, you should either use Diag.CurrentNode at the exit case or NextDialog.CurrentNode and that should work.
What does NOT work is assigning it to Dialog.CurrentNode as that does something completely different.

Why this is so convoluted, I do not know. And why it had to be two different names for the same thing is even more stupid.
But that is the way it is and how it apparently should be used.

I have now done a search-and-replace to correct this in all affected Hornblower files,
which will hopefully put an end to all those strange quest loops and inappropriate lines of dialog.

Will need to be double-checked and tested though.
 
After making these changes, I'm noticing some odd effects with the Hornblower dialogs in the early game.

For some characters, I have to press space TWICE to close the dialog for some reason, even though I see nothing particularly wrong with the code.
@pedrwyth had the same issue with the No Save Monks dialog files which was equally odd.
@Levis, do you happen to have any clue on this one?

One time a quest case also failed to be called, but I seem to have fixed that by removing some superfluous code.
If that is indeed necessary now, there may be a fair few similar situations where this needs to be done too.
I hope not.... :facepalm
 
Got a savegame where I can test it?
 
Got it! Archie and Matthews were the two characters to have this at the top of their dialog files:
Code:
switch(NextDiag.CurrentNode)
That should have been:
Code:
switch(Dialog.CurrentNode)

I have now changed all Hornblower dialog files to match with the normal way the code is supposed to work, so hopefully this one is well and truly fixed now.
 
Could you please do a Winmerge with your work and mine? Here's what I've been up to...

For one thing, I've been doing some dialog work of my own, now probably redundant. (If I claim I'm going to work on flag recognition, will you jump in and do the work for that as well? xD) As well as obsolete changes to a couple of dialog.c files, there are some minor grammatical corrections to dialog.h files. There's also a much more substantial change to Pellew's dialog for the endgame. Previously it was a terse one-liner, basically saying "Here's your new ship, here are your orders, goodbye", the sort of thing any random senior officer might say to any random junior officer. I've added some of the sort of banter often present in conversations to make it more specifically in character with Pellew talking to Hornblower.

How much of this is actually needed to remove a character?
Code:
       SetCharacterRemovable(characterFromID("Richard Sharpe"), true);
       RemoveOfficersIndex(pchar, GetCharacterIndex("Richard Sharpe"));
       RemoveCharacterCompanion(Pchar, characterFromID("Richard Sharpe"));
       RemovePassenger(pchar, characterFromID("Richard Sharpe"));
This from 'case "Back_to_Maria_at_Greenford"'. 'RemovePassenger' is the one which takes them out of your "Passengers" list; until I added one of those for Sharpe and his men plus Quelp, they all stayed with you when they were supposed to have gone their own ways. Also, a few cases earlier I've added a line 'Locations[FindLocation("Oxbay_Lighthouse")].locators_radius.goto.goto25 = 4.0;' which makes it a bit easier to trigger the dialog with Sharpe; you now don't need to hunt for the exact spot to stand.

During the battle at Antigua, Sir Arthur Wellesley appeared as "Duke" during my recent playthrough. (Has this been corrected in one of the updates? At the time I still had nothing newer than the 31st July update installed.) In fact he wasn't made Duke until 1814. I'm going to install the current update, then play through again, and one thing I'll be watching for is what the new system of titles does to the Earl of Edrington...
 

Attachments

  • Hornblower.zip
    124.5 KB · Views: 66
Could you please do a Winmerge with your work and mine? Here's what I've been up to...
Done! You caught a lot of spelling errors again too. This just keeps getting better and better! :cheers

For one thing, I've been doing some dialog work of my own, now probably redundant. (If I claim I'm going to work on flag recognition, will you jump in and do the work for that as well? xD)
Sorry 'bout that. I ran into it while doing some testing and had to figure out why it wasn't doing what clearly it was intended to do. :facepalm

There's also a much more substantial change to Pellew's dialog for the endgame. Previously it was a terse one-liner, basically saying "Here's your new ship, here are your orders, goodbye", the sort of thing any random senior officer might say to any random junior officer. I've added some of the sort of banter often present in conversations to make it more specifically in character with Pellew talking to Hornblower.
That's great! Certainly nice to add some more atmosphere to the game. :onya

How much of this is actually needed to remove a character?
Code:
       SetCharacterRemovable(characterFromID("Richard Sharpe"), true);
       RemoveOfficersIndex(pchar, GetCharacterIndex("Richard Sharpe"));
       RemoveCharacterCompanion(Pchar, characterFromID("Richard Sharpe"));
       RemovePassenger(pchar, characterFromID("Richard Sharpe"));
This from 'case "Back_to_Maria_at_Greenford"'. 'RemovePassenger' is the one which takes them out of your "Passengers" list; until I added one of those for Sharpe and his men plus Quelp, they all stayed with you when they were supposed to have gone their own ways.
SetCharacterRemovable is for locked characters that you can't touch for quest purposes. I think the other lines override it so this one shouldn't be needed.
RemoveOfficersIndex should remove a character from your active shore party.
RemoveCharacterCompanion removes a character as a ship companion. I don't think you CAN even put Sharpe in command of a ship, can you?
Especially not if he's indeed got SetCharacterRemovable is false!
And, as you already noticed, RemovePassenger removes a character from your passenger list.

During the battle at Antigua, Sir Arthur Wellesley appeared as "Duke" during my recent playthrough. (Has this been corrected in one of the updates? At the time I still had nothing newer than the 31st July update installed.) In fact he wasn't made Duke until 1814.
Ah, yes; I did that. Thought I remembered him being a Duke. I'll set it back to "Sir" for the next upload.

I'm going to install the current update, then play through again, and one thing I'll be watching for is what the new system of titles does to the Earl of Edrington...
Having a look in the code, it is going to do nothing with the "Earl of Edrington". He doesn't actually have a rank nor title as far as the game is concerned.
But you won't notice that as it's part of his name. Should work the same as it did before, as nothing was changed where he's concerned. :no
 
Another little thing - I found out how to make a character sit down. And then stand up, and sit back down. So when you report to Bridgetown Naval HQ at the end, Lt. "Yo-yo" Eccleston will initially be seated, will stand to attention to greet you, then sit back down to return to work. :D
 
@Grey Roger: Have you noticed any dialog strangeness in your current Hornblower play-through?
Or could this actually be "Fixed" for real now?
 
In my current playthrough: plenty, see Correct display of rank titles and names for details. :D

During the last playthrough in which I got as far as Matthews' confusion: no, Matthews wasn't confused any more, after I'd applied my fix. I've yet to see how he reacts to yours. ;) Since then a succession of updates plus my own work on Charlestown and Point a Pitre churches meant I needed to keep starting new games. This time I'm continuing regardless, which incidentally means I won't be trying out any more updates for a while, partly to see if the storyline still behaves itself and partly because I have another idea that I want to try out which requires that I continue the story a lot further through this time...
 
Changed this to fixed
 
Grey Roger said he didn't yet confirm the latest changes to work because he didn't get that far in playing.
Probably does work now, but I wouldn't object to it being confirmed....
 
Back
Top