• 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

I was able to test this again last night. After loading up a savegame from Nevis White Bay, I detoured to Martinique to collect Fred Bob, then went to Jamaica for the Lieutenant's Examination, fireship and start of "The Duchess and the Devil", collecting both Marc Blacque and Rys Bloom while I was there. After completing "The Duchess and the Devil" I detoured to Puerto Rico, Nevis and Puerto Rico again to complete "Help the Lady", then continued on with "Land Battle", finally delivering Marc to his family while I was on Martinique. This time round, all the "RestorePassengers", "RemoveOfficersIndex" and "RemovePassenger" lines were in "quests_reaction.c" and took effect at their proper times. So the Duchess of Wharfedale and Midshipman Hunter did not re-appear after "Help the Lady". Job done. :doff
 
And now I've run into a snag I can't fix. Whether a result of something I've done or a side effect of a side quest, I'm getting stuck during "Old Friends - New Enemies". I've helped Teresa Moreno get the relic from the church, decided to help Sharpe and his men in the battle at the plantation, joined in the battle, and can't get any further. Looking at "quests_reaction.c", it gets as far as "FIGHT PLAYER" but does not proceed to "Murray_wounded333". There are one rifleman and one French soldier who keep on fighting, both seem to be immortal so their fight never ends, all the rest of the French are dead.

Here are the "compile.log", "save.log" and a savegame as I'm just about to leave church so the options to join the battle or join Teresa's ship are still both open. There was no "error.log".

I added a whole bunch of "logit" lines temporarily to "quests_reaction.c" to see how far it gets. It does seem to get through all the "Pchar.quest.<stuff>.win_condition" lines in "FIGHT_PLAYER", so presumably it then gets to the "break" line, but I've no idea where it breaks to.

What's worrying is that last time I played "Hornblower" all the way through, this battle worked and I was able to talk to Murray, then proceed to the house to get changed back into uniform and continue to complete the game. So either I'm missing something I need to do around Murray, or some recent change has broken this scene.
 

Attachments

  • -=Player=- Guadeloupe.zip
    847.9 KB · Views: 88
  • compile.log
    3.1 KB · Views: 92
  • system.log
    1.1 KB · Views: 97
This line:
Code:
PChar.quest.Murray_wounded333.win_condition.l1.character = characterFromID("Soldier8X");
Should be this:
Code:
PChar.quest.Murray_wounded333.win_condition.l1.character = "Soldier8X";
The quest code needs a regular character ID and not the reference to that character, so I'm surprised that this used to work at all!

There is a second similar situation further down that should have the same change applied.
See attached for my corrected file.
 

Attachments

  • quests_reaction.zip
    78.5 KB · Views: 93
Thanks! Except you used an obsolete version of "quests_reaction.c" which doesn't have my more recent changes, particularly all the "RemovePassenger" lines and the fix for "The Duchess and the Devil". ;)
I may have missed your full up-to-date version so was working from the last version I did have....
However: WinMerge for the win! :dance
 
From another thread:
Code:
WaitDate("", 0, 0, 1, 0, 0); // "", years, months, days, hours, minutes
Is that the general command to force a certain amount of time to pass? Because our old friend "The Duchess and the Devil" has another little bug which that may be able to squash. You don't spend very long in the prison fort at the moment...
 
Is that the general command to force a certain amount of time to pass?
Yup, it is. :yes

One thing to consider when doing that is that you do consume rations when waiting.
Of course that doesn't make sense while you are imprisoned, but the game might still consider that you are in charge of a ship somewhere.
 
Hornblower is a commissioned officer. Does he consume rations?

What does "TakeShipCommandFromOfficer(pchar.id);" do? Particularly if I insert it in the section "Go_to_Beach_for_Prison", which is right after the capture of Le Reve? (I found it in the "standard" storyline, somewhere among what looks like the bit about Rabel Yverneau, probably where you've brought the corvette to Jamaica and it's taken from you.)

Also found in the "standard" storyline is "AddCharacterGoods(pchar, GOOD_WHEAT, 40);" and a similar one for GOOD_RUM, so if I need to feed Hornblower while he's in prison, those seem like the lines to do it.
 
Hornblower is a commissioned officer. Does he consume rations?
Not until after Beta 3.3 . When we introduced Commissioned and went playing with that, we figured that wasn't actually logical reason for the crew of navy ships to not consume rations.
So now they do. However, that could indeed affect the Hornblower storyline which hopefully your playing brings to light.

What does "TakeShipCommandFromOfficer(pchar.id);" do? Particularly if I insert it in the section "Go_to_Beach_for_Prison", which is right after the capture of Le Reve? (I found it in the "standard" storyline, somewhere among what looks like the bit about Rabel Yverneau, probably where you've brought the corvette to Jamaica and it's taken from you.)
Didn't even know that function existed, but indeed I found it in PROGRAM\QUESTS\quests.c:
Code:
bool GiveShipCommandToOfficer(string idCharacter, int idx)
{
   int idxCh = GetCharacterIndex(idCharacter);
   if(idxCh==-1) return false;
   ref refCh = GetCharacter(idxCh);

   if(idx==-1) return false;
   if(CheckAttribute(refCh,"Fellows.Old.Passengers")) return false;

   string sTmp;
   aref arTmp;

   makearef(arTmp,refCh.Fellows.Old.Passengers);
   sTmp = "id0";
   arTmp.(sTmp) = idx;

   RemovePassenger(refCh,GetCharacter(idx));
   ChangeCharacterAddress(GetCharacter(idx),"none","");

   return true;
}

bool TakeShipCommandFromOfficer(string idCharacter)
{
   int idxCh = GetCharacterIndex(idCharacter);
   if(idxCh==-1) return false;
   ref refCh = GetCharacter(idxCh);
   if(!CheckAttribute(refCh,"Fellows.Old.Passengers")) return false;

   int idx;
   aref arTmp,arCur;

   makearef(arTmp,refCh.Fellows.Old.Passengers);
   arCur = GetAttributeN(arTmp,0);
   idx = sti(GetAttributeValue(arCur));
   AddPassenger(refCh,GetCharacter(idx),false);

   DeleteAttribute(refCh,"Fellows.Old.Passengers");

   if (!CheckAttribute(refCh,"Fellows.Old.Officers"))
     DeleteAttribute(refCh,"Fellows.Old");

   return true;
}
Looks like these two functions go together to give your ship to a companion and to subsequently give it back again.
Though I don't see any reference to your ship there at all, so I'm a bit confused on it.

If you want to remove the player ship, this might work:
Code:
DeleteAttribute(pchar, "Ship");
ch.Ship.Type = SHIP_NOTUSED_TYPE_NAME;
ch.Ship.Name = "";
I think that would set up your player character similar to how you start the Bartolomeu storyline, where you also don't have a ship for a while.
Then use GiveShip2Character once you do need to go back to sea and that might sort this one out.

Also found in the "standard" storyline is "AddCharacterGoods(pchar, GOOD_WHEAT, 40);" and a similar one for GOOD_RUM, so if I need to feed Hornblower while he's in prison, those seem like the lines to do it.
That is probably the simplest solution. :yes
 
@Jack Rackham or @Bartolomeu o Portugues: Do you reckon you could help Grey Roger a bit in adding a few quest scenes at the end to introduce the change into Free Play mode for Hornblower?
That is definitely missing right now and I would do it myself, except I have so many other things lines up that it might take a long time before I might get to it. :facepalm
 
Not until after Beta 3.3 . When we introduced Commissioned and went playing with that, we figured that wasn't actually logical reason for the crew of navy ships to not consume rations.
So now they do. However, that could indeed affect the Hornblower storyline which hopefully your playing brings to light.
Which presumably means it is possible to stop you consuming rations. How? Can it be switched off and then back on during the game?

If you want to remove the player ship, this might work:
Code:
DeleteAttribute(pchar, "Ship");
ch.Ship.Type = SHIP_NOTUSED_TYPE_NAME;
ch.Ship.Name = "";
I think that would set up your player character similar to how you start the Bartolomeu storyline, where you also don't have a ship for a while.
Then use GiveShip2Character once you do need to go back to sea and that might sort this one out.

That is probably the simplest solution. :yes
Having put the PoTC directory into Windows Index, and knowing that "GiveShip2Character" exists, I tried searching for things like "RemoveShip" or "TakeShip", and found the one I mentioned. Your way is probably what I want. "GiveShip2Character" is already present, there's one for when you're released from prison and put back on the Indy.

Incidentally, your fix for the battle scene on Guadeloupe worked. :onya
 
Minor problem: the action on Guadeloupe involves Rifleman Cooper, who is supposed to provide Hornblower with a lockpick to break into the church room, and is supposed to fiddle with the gate lock to prevent French reinforcements arriving. Only one snag - he's likely to get killed earlier, during the fight in Mystery House in "Tunnel of Trouble", which means although the dialog still refers to Cooper, it's actually Rifleman Gilbert Breese who is doing the job in my current game. I'm inclined to make Cooper immortal for the Mystery House fight in the hope that he'll show up as himself on Guadeloupe.

Not so minor problem: when you proceed to Anse Casse Bois to rejoin Hotspur, there's a locked icon when you get to the rowing boat and you can't board the ship. There's a workround in that there's always the icon to teleport to your ship, but I'd like to know why the boat is locked and how to unlock it. Probably somewhere around "Hogan_Quest_Done" or "Hogan_Quest_Done_More".
 
@@Jack Rackham or @@Bartolomeu o Portugues: Do you reckon you could help Grey Roger a bit in adding a few quest scenes at the end to introduce the change into Free Play mode for Hornblower?
Maybe a little later, but not right now. Want to finish at least part 23/25 of the GoldBug first. Maybe all.
Is the situation this: the Hornblower storyline is completed and you can continue playing in free play?
Are there any jump starts in Hornblower?
 
Which presumably means it is possible to stop you consuming rations. How? Can it be switched off and then back on during the game?
If I recall, it was just done by setting the BuildSettings.h food toggle to false in the StartStoryline.c file, but I'm not convinced that is a very good approach.
That might have weird side-effects, such as it being re-enabled upon loading a savegame (because then StartStoryline.c isn't run again) or remaining disabled even in other storylines afterwards.

If we do indeed want Hornblower to not consume rations at all during the main quest, we can figure out a different approach.
There is already an attribute for "notcaptain" that is used to prevent you from hiring officers.
The same attribute can be placed around the ration consumption code in PROGRAM\WorldMap\DailyCrewUpdate.c .

Having put the PoTC directory into Windows Index, and knowing that "GiveShip2Character" exists, I tried searching for things like "RemoveShip" or "TakeShip", and found the one I mentioned. Your way is probably what I want. "GiveShip2Character" is already present, there's one for when you're released from prison and put back on the Indy.
I figured that might be the case, so hopefully that will be a quick fix.
Good use of the Windows Index too! You can find all sorts of things that way. :woot

Incidentally, your fix for the battle scene on Guadeloupe worked. :onya
It had better! I tested it! :whipa

Maybe a little later, but not right now. Want to finish at least part 23/25 of the GoldBug first. Maybe all.
I'm not suggesting any huge amounts of work to be done; just tying up some loose ends in the story here and there.

Is the situation this: the Hornblower storyline is completed and you can continue playing in free play?
Indeed the storyline is already completed, but there are some rough edges here and there.
@Grey Roger is taking care of most of them right now, but a couple will require some extra quest scenes.
Basically the story has a "traitor" character, but that one isn't dealt with before the story ends but also doesn't impact anything afterwards.
So that is a "loose end" that would be nice to close.

Originally it also wasn't set up to properly allow free play afterwards, so the story ends with you marrying Maria and officially being landlocked due to the (temporary) end of the war.
Grey Roger and me did add some code to the end of the storyline to put you in charge of a new ship and enable ordinary free play.
However, there is no dialog explaining this. So basically the last thing you know is that you get married and suddenly you are promoted and in charge of a new ship.
Works for gameplay but doesn't actually make any sense. :razz

Are there any jump starts in Hornblower?
Yes, there are. With ENABLE_CHEATMODE on, there is a C.S. Forester "storyteller" character to be found in the Antigua port opening scene. :yes
 
Basically the story has a "traitor" character, but that one isn't dealt with before the story ends but also doesn't impact anything afterwards.
So that is a "loose end" that would be nice to close.

Originally it also wasn't set up to properly allow free play afterwards, so the story ends with you marrying Maria and officially being landlocked due to the (temporary) end of the war.
Grey Roger and me did add some code to the end of the storyline to put you in charge of a new ship and enable ordinary free play.
However, there is no dialog explaining this. So basically the last thing you know is that you get married and suddenly you are promoted and in charge of a new ship.
Works for gameplay but doesn't actually make any sense. :razz
I'll have to check when I get to the end of my current playthrough, but as I recall from last time, the game ends with Hornblower at the rank of Commander and in charge of Hotspur, which was his status at the start of the final action on Guadeloupe. The added code means he enters Mrs. Mason's house in command of Hotspur and leaves in command of Atropos, meaning Mrs. Mason has just given him a new ship as a wedding gift. xD A new quest which results in Hornblower being transferred to Atropos would be nice, even if it's just a midshipman running up to him and telling him to report to Naval HQ, where a senior officer tells Hornblower that he's been given the new ship.

During the first action on Guadeloupe, Hornblower is worried that if he gets caught in British uniform, it could start a war. If that's a reasonable concern then the French really won't like their signal tower and fort being blown up and their ships destroyed in port, so I'm going to add some more relation changes to resume war between Britain and France. Besides, unless I do that, free-play is going to be a bit boring with everyone at peace and only pirates to chase!
 
I'll have to check when I get to the end of my current playthrough, but as I recall from last time, the game ends with Hornblower at the rank of Commander and in charge of Hotspur, which was his status at the start of the final action on Guadeloupe. The added code means he enters Mrs. Mason's house in command of Hotspur and leaves in command of Atropos, meaning Mrs. Mason has just given him a new ship as a wedding gift. xD A new quest which results in Hornblower being transferred to Atropos would be nice, even if it's just a midshipman running up to him and telling him to report to Naval HQ, where a senior officer tells Hornblower that he's been given the new ship.
Yup, that sounds about right. Do you have any thoughts on dealing with that traitor as well?

During the first action on Guadeloupe, Hornblower is worried that if he gets caught in British uniform, it could start a war. If that's a reasonable concern then the French really won't like their signal tower and fort being blown up and their ships destroyed in port, so I'm going to add some more relation changes to resume war between Britain and France. Besides, unless I do that, free-play is going to be a bit boring with everyone at peace and only pirates to chase!
Agreed. Plus renewed war with France is a very good reason for Hornblower getting a command again.
 
If I recall, it was just done by setting the BuildSettings.h food toggle to false in the StartStoryline.c file, but I'm not convinced that is a very good approach.
That might have weird side-effects, such as it being re-enabled upon loading a savegame (because then StartStoryline.c isn't run again) or remaining disabled even in other storylines afterwards.
I don't want food consumption disabled entirely for Hornblower, just while he's in prison. And not necessarily for the whole time, just around where the "WaitDate" commands are doing their stuff. For preference, define a new variable somewhere in "quests_reaction.c", then do something like this:
Code:
old_food = FOOD_ON;
food_setting = false;
WaitDate("", 0, 0, 1, 0, 0);
FOOD_ON = old_food;
That ought to prevent any long term side-effects as well as preserving the player's choice of whether food consumption is enabled normally.

If we do indeed want Hornblower to not consume rations at all during the main quest, we can figure out a different approach.
There is already an attribute for "notcaptain" that is used to prevent you from hiring officers.
The same attribute can be placed around the ration consumption code in PROGRAM\WorldMap\DailyCrewUpdate.c .
That should not be necessary. The ship has enough food and rum to get to where it's going, unless you divert from plot and go off in search of loot and side-quests. In that case you're effectively taking over the ship and may as well take over the responsibility of feeding it. xD
 
Yup, that sounds about right. Do you have any thoughts on dealing with that traitor as well?
Not unless I ever learn how to write quests. Otherwise whoever wants to do the job can do what he likes to the traitor. I'll think more about new stuff after I've got the existing stuff working properly. ;) And on that note, nobody has said anything about how to deal with the locked boat at Anse Casse Bois...

Agreed. Plus renewed war with France is a very good reason for Hornblower getting a command again.
It might be a good reason for Hornblower getting a new command. He received command of Hotspur along with promotion back to Commander at the start of "Old Friends - New Enemies", and still has them when he returns from Guadeloupe to get married.
 
Back
Top