• 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

OK, I'm definitely going to have to change that, once I know what I'm doing. Archie Kennedy can't be the one to tell you to go to Naval HQ. He's excused from all further duty due to being dead. xD (He dies shortly after confessing to shoving Captain Sawyer down the hold, thereby shifting any possible blame from Hornblower, even though in fact Sawyer fell into the hold without help from any junior officer.)

What's the difference between "ChangeCharacterAddress" and "ChangeCharacterAddressGroup"? In "quests_reaction.c" as it stands now, I've seen numerous "ChangeCharacterAddressGroup" lines which seem to put someone somewhere definite, and numerous "ChangeCharacterAddress" lines which put them nowhere, presumably allowing them to disappear. What do the various things in the brackets do?

What's the difference between "LAi_ActorDialog" and "LAi_ActorDialogNow", and what do the numbers do?

And what do the things in brackets after "LAi_ActorGoLocator" do? "Mother_tells2" appears to be a case reference. pchar is you, if you want to refer to someone else then I'm guessing it's characterFromID("[insert name here]"). (Some lines use pchar, some use Pchar - is this significant?)
 
He dies shortly after confessing to shoving Captain Sawyer down the hold, thereby shifting any possible blame from Hornblower, even though in fact Sawyer fell into the hold without help from any junior officer.
From what I understand of both the book and the film, that is never made completely clear. It may have been an accident. But it may actually have been Hornblower. A mystery! :wp

What's the difference between "ChangeCharacterAddress" and "ChangeCharacterAddressGroup"? In "quests_reaction.c" as it stands now, I've seen numerous "ChangeCharacterAddressGroup" lines which seem to put someone somewhere definite, and numerous "ChangeCharacterAddress" lines which put them nowhere, presumably allowing them to disappear. What do the various things in the brackets do?
You have the location ID, the locator group and the actual locator itself.
Why locators have a group while that group is already in the name itself though, I do not know. Silly game!

pchar is you, if you want to refer to someone else then I'm guessing it's characterFromID("[insert name here]").
Yep. But while PChar is a common term in the code, it depends on how the player is defined within the function used. Sometimes it is mainCharacter, sometimes mc, sometimes something else. Just to make things simple. :facepalm

(Some lines use pchar, some use Pchar - is this significant?)
The PotC-code is not particularly case-sensitive. :no

What's the difference between "LAi_ActorDialog" and "LAi_ActorDialogNow", and what do the numbers do?
Not entirely sure; the numbers are a delay, I think.
 
From what I understand of both the book and the film, that is never made completely clear. It may have been an accident. But it may actually have been Hornblower. A mystery! :wp
The game storyline takes a lot of artistic licence and deviates from both the books and TV series all over the place, starting with - well, the start, which I suspect in both books and TV series was nowhere near the Caribbean. xD In game, then, it's quite clear that Sawyer fell, you get to watch him do it. Anyway, the important bit is that Kennedy isn't around to tell you to go to Naval HQ at the end of the story. ;)

You have the location ID, the locator group and the actual locator itself.
Why locators have a group while that group is already in the name itself though, I do not know. Silly game!
What is a locator group? Valid values seem to include "goto" and "reload". (And nobody has yet explained the difference between "ChangeCharacterAddress" and "ChangeCharacterAddressGroup". ;))

Yep. But while PChar is a common term in the code, it depends on how the player is defined within the function used. Sometimes it is mainCharacter, sometimes mc, sometimes something else. Just to make things simple. :facepalm
Yes, I got caught by that once already. A piece of code which you quoted from some other file used "ch", I copied the code straight into "quests_reaction.c", the game didn't like that, and it didn't take me long to figure out that "ch" needed to be replaced by "Pchar". At least within Hornblower's "quests_reaction.c", it appears consistently to be "Pchar". Or "pchar".

The PotC-code is not particularly case-sensitive. :no
Except when it is. :D I fixed an error some time ago by changing a letter from upper case to lower case, though I'm not sure where it was now. If I remember correctly, someone tried to refer to "#S<insert town name>#" in a dialog and the town name never showed up because it should have been "#s<insert town name>#".
 
What is a locator group? Valid values seem to include "goto" and "reload". (And nobody has yet explained the difference between "ChangeCharacterAddress" and "ChangeCharacterAddressGroup". ;))
If you look in the character init files, you'll see that a character location on a locator requires three lines of code.
The difference between those two functions is that the one includes the Group and the other one doesn't. I have no clue why there are two versions though. :facepalm

Yes, I got caught by that once already. A piece of code which you quoted from some other file used "ch", I copied the code straight into "quests_reaction.c", the game didn't like that, and it didn't take me long to figure out that "ch" needed to be replaced by "Pchar". At least within Hornblower's "quests_reaction.c", it appears consistently to be "Pchar". Or "pchar".
Indeed the quests_reaction.c files are quite straight-forward on their naming.
You get into confusion when you go into all sorts of other functions all over the place.
Generally "ch" can be used for any character while "pchar" does refer to the player. Usually the difference between also "NPChar" and "PChar" in dialogs.

Except when it is. :D I fixed an error some time ago by changing a letter from upper case to lower case, though I'm not sure where it was now. If I remember correctly, someone tried to refer to "#S<insert town name>#" in a dialog and the town name never showed up because it should have been "#s<insert town name>#".
Indeed some parts may be quite sensitive and that particular example does sound like one I indeed wouldn't recommend trying with capitals. :cheeky
 
It's better to use
ChangeCharacterAddressGroup
the other case has no group which can be goto or box for example.

I often name locators box box 31
and goto box31

You avoid going to the wrong locator with the recommended function.



It will be easy enough to exchange Archie to another character. You can also "borrow"
code from his 2 dialog files and use them elsewhere.

If you add a completely new character that will require a New Game and you can't use the save game.
So it will be much easier to use one already existing.
 
If you add a completely new character that will require a New Game and you can't use the save game.
So it will be much easier to use one already existing.
Very true. There are probably many characters you can use. It is also possible to generate temporary characters as needed.
Or "resurrect" characters that are already dead and rename them on purpose so nobody notices.
 
I'm working on my own version already. :D Knowing full well that using a completely new character requires all sorts of preparatory work, I'm using Lt. Eccleston as my messenger. He's already done this sort of job, having previously told Hornblower to report to the flagship. I may as well employ someone with suitable work experience. xD

The only time I've seen "ChangeCharacterAddress" has been "ChangeCharacterAddress(characterFromID("<insert_name_here>"), "None", ""). There is therefore no risk of him going to the wrong location since it's telling him to go to no location. :) Any line which tells someone to go somewhere, as opposed to nowhere, does indeed use "ChangeCharacterAddressGroup". So that's what I'm using to have Eccleston appear in Greenford town. (He's not going to be quite as polite as the late Archie Kennedy - he won't knock on the door, he'll ambush Hornblower when you leave Mrs. Mason's house.)
 
Here's what I've got so far. I've managed to get Eccleston to meet you as you leave Mrs. Mason's house, tell you that you've to report to Naval HQ, then he walks over to Naval HQ in case you've forgotten how to get there. :) You go in, I've yet to arrange for anyone to meet you, so all that happens is that you get the Atropos and "Old Friends - New Enemies" closes.

Snag 1 is that Greenford Naval HQ is locked. (It's Bridgetown Naval HQ when you look at it, but programming code still uses original PoTC island and town names.) I know how to unlock a location after my experiences with the boat at Guadeloupe, hence the line "Locations[FindLocation("Greenford_town")].reload.l19.disable = 0". But I can't see where the Naval HQ is locked earlier, or if it's locked or unlocked at any previous stage.

Snag 2 is that I've tried to add a line to the questbook about getting Atropos before the quest closes. The line is there in "RESOURCE\INI\TEXTS\ENGLISH\Storyline\Hornblower\QUESTBOOK\Old Friends - New Enemies.txt", but it's not added to the questbook. Do I need to have separate case blocks for "AddQuestRecord" and "CloseQuestHeader"?

Snag 3 is that Atropos still has negative amounts of food and rum. If someone doesn't modify the 6th Rate Frigate to have the same sort of expanded cargo hold as other ships soon, I'll do it myself. xD

Also in that zip file are a load of modified dialogs, mostly just minor corrections.
 

Attachments

  • Hornblower.zip
    123.4 KB · Views: 156
Locations[FindLocation("Greenford_town")].reload.l19.disable = 0
will do it. Add that while still in Maria's house as it else takes another reload to town to be
executed.

Do I need to have separate case blocks for "AddQuestRecord" and "CloseQuestHeader"
Yes 2 lines.
 
Grey Roger said:
Locations[FindLocation("Greenford_town")].reload.l19.disable = 0
will do it. Add that while still in Maria's house as it else takes another reload to town to be executed.
I've actually got it in the case block before you go to Mrs. Mason's house, and it does work because I tried it. :)

And I've just found out why it's necessary. The "disable = 1" version is in "Meet_Mrs._Mason", which is just after you get decommissioned. The Navy takes away your ship and then locks the HQ door so you can't get back in; they really know how to make you feel welcome. xD After that, I don't think the story ever requires you to go back to Naval HQ.

Just to show you why this sort of really basic learning experience is necessary for me:
The first time I tried to run the game after I'd added my bits, it refused to load "quests_reaction.c". It objected to 'case "assigned_to_atropos";'. First thought: all the other 'case' statements have the name begin with a capital, so I changed it to 'case "Assigned_to_atropos";'. It still refused to load. Eventually I spotted the mistake - pretty well every other line in the code ends with a semi-colon, this one is supposed to end with a colon. :facepalm With that corrected, it worked until I got into Naval HQ, at which point nothing happened. Remember how I'd changed the case name to "Assigned_to_atropos"? What I'd forgotten to do was capitalise the name in all the "win.condition" lines to match. Apparently this is another place where lower/upper case is significant. :D
 
I've actually got it in the case block before you go to Mrs. Mason's house, and it does work because I tried it. :)
Good. Just check so you can't enter the Naval HQ before Maria's house.
 
I can't even read my own code. xD

The unlock line is after you leave Mrs. Mason's house, in "Assigned_to_atropos". It works because leaving Mrs. Mason's house triggers Eccleston's arrival, his dialog triggers the advance to "assigned_to_atropos2", and that presumably activates the unlock line - certainly when I follow Eccleston to Naval HQ, it is now unlocked.

Now to try to write someone senior into Naval HQ to tell Hornblower the good news that he's getting a new ship and free reign to do what he likes with it...
 
Snag 3 is that Atropos still has negative amounts of food and rum. If someone doesn't modify the 6th Rate Frigate to have the same sort of expanded cargo hold as other ships soon, I'll do it myself. xD
Just to be sure you are using the updated ships_init.c numbers, have you started a new game recently and/or press F11 yet?
Of course everything related to the capacities is VERY much experimental.
 
Now that's a good question. The savegame which I've been using for testing my work is one from a previous playthrough and I'm not sure whether the updated cargo capacities had been applied at that time. Pressing F11 has no effect. But I'm well into another playthrough originally intended to be one last check of the whole game for errors remaining and for unintended side effects of my modifications, and have got as far as the attack on Antigua. This one certainly does have the updated cargo capacities, it's where those screenshots of the excessive capacities of Justinian and Indefatigable came from. So when I get to the end of this one, I'll see if Atropos has enough space to store its own supplies.
 
When are text files such as "RESOURCE\INI\TEXTS\ENGLISH\Storyline\Hornblower\QUESTBOOK\Old Friends - New Enemies.txt" read? Once per game, or when the quest starts? They're certainly not read by lines such as "AddQuestRecord("Old Friends - New Enemies", 18)". As an experiment, I modified the file, deleting the line about proposing marriage to Maria, so the new line about assignment to Atropos became line 18. (I did remember to change the start of the line to "text.t18". :)) After I finished talking to Maria, the line about proposing marriage appeared in the quest book, and that line wasn't even in "Old Friends - New Enemies.txt" any more!

Meanwhile, apart from weirdness with quest book entries, I've finished this mod. It's now Lt. Chadd who tells you to report to Naval HQ. There you report to Lt. Eccleston at the door, who tells you the admiral is waiting; then Admiral Pellew comes forward to tell you about the Atropos and order you to seek out the enemy wherever he may be found - in other words, free-play.

I've also put a lock/unlock pair into the sections in Mrs. Mason's house. The problem: if you're too quick on the spacebar when you enter the house, you can leave again after Maria has said her first piece, which interrupts the whole conversation and then fouls up the game when Lt. Chadd doesn't show up. The solution: the moment you enter Mrs. Mason's house, the door locks behind you and you're not getting out again until you've proposed marriage to Maria. xD
 
They're certainly not read by lines such as "AddQuestRecord("Old Friends - New Enemies", 18)
It should be "18".

I've also put a lock/unlock pair into the sections in Mrs. Mason's house.
Yes, that's what questwriting is about most of the time; preventing the player from doing the "wrong" things.
 
It should be "18".
Line 18 is the one which refers to marrying Maria. I added line 19, about being given the Atropos. Unless you mean the number should have quote marks round it; no other "AddQuestRecord" lines have that, and 'AddQuestRecord("Old Friends - New Enemies", 18)' works without.

My point is that if I delete the line about marrying Maria and make line 18 the one about Atropos, 'AddQuestRecord("Old Friends - New Enemies", 18)' still adds the line about Maria to the quest book - even though the line about Maria no longer exists in 'Old Friends - New Enemies.txt'. :confused: This is why I'm wondering when 'Old Friends - New Enemies.txt' is actually read.
 
Hmm, I see that no other addquestrecord have quote marks (in Hornblower) but I have always used them...
So both ways work then.

The problem you have: guess a new game is required for new questbook lines to be accepted.
I tried also to add a line (19) and it gives a pling and "quest book updated" but the line isn't visible.
Pressing F11 didn't help.
 
Now that's a good question. The savegame which I've been using for testing my work is one from a previous playthrough and I'm not sure whether the updated cargo capacities had been applied at that time. Pressing F11 has no effect.
If it is for the player character, then after pressing F11, you have to use GiveShip2Character as well because ships already owned by characters in the game retain their stats even after reinitalization.

When are text files such as "RESOURCE\INI\TEXTS\ENGLISH\Storyline\Hornblower\QUESTBOOK\Old Friends - New Enemies.txt" read? Once per game, or when the quest starts? They're certainly not read by lines such as "AddQuestRecord("Old Friends - New Enemies", 18)". As an experiment, I modified the file, deleting the line about proposing marriage to Maria, so the new line about assignment to Atropos became line 18. (I did remember to change the start of the line to "text.t18". :)) After I finished talking to Maria, the line about proposing marriage appeared in the quest book, and that line wasn't even in "Old Friends - New Enemies.txt" any more!
All code files are loaded when you start ENGINE.exe . There are some exceptions, but those are specifically coded to load when they are requested.
This applies mainly to dialogs and console.c (why do you think console is so awesome? ;) ). All other things pretty much require you to close the game and reopen it again.
New game is not required, though. Just make a save, close the game, start the game and load your save and you should be back in business.

Line 18 is the one which refers to marrying Maria. I added line 19, about being given the Atropos. Unless you mean the number should have quote marks round it; no other "AddQuestRecord" lines have that, and 'AddQuestRecord("Old Friends - New Enemies", 18)' works without.
At some point Pirate_KK rewrote the questbook code to use an integer (without quotes) instead of a string (with quotes) as input.
However, he wrote it so that any string used is converted to integer, so effectively it doesn't matter.
 
Back
Top