• 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": problems with Anacleto

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
You've fallen overboard in a storm, been washed ashore on Bonaire, made your way to the pirate fort and had an argument with Anacleto. He draws a gun and puts a small hole in you. You draw a better gun and put a big hole in him, and he drops dead. A pirate walks in, takes one look at the scene and walks back out without saying a word.

The problem is that if a fight ends with a gunshot instead of a sword swipe, usual methods of disarming the player - including a simple 'LAi_SetFightMode(PChar, false)' - don't seem to work. And if someone tries to initiate a dialog while you have weapons drawn, the dialog fails and quits at once, which leads to a variety of bugs and exploits but that's another story.

So, at the end of case "kill_anacleto_complete", I've added this:
Code:
//       LAi_SetStayType(pchar);
//       LAi_SetPlayerType(pchar);
       LAi_SetFightMode(PChar, false); // GR: If player kills Anacleto with one shot, player isn't automatically disarmed, so force it
       LAi_SetActorType(PChar);
       LAi_type_actor_Reset(PChar);
       LAi_ActorWaitDialog(PChar, sld);
       LAi_ActorDialog(sld, pchar, "sld_exit_from_pirate_tavern", 3.0, 1.0);
The commented out lines are the original code. I'm not sure how much of the new stuff is really necessary or whether there's a tidier way to do it, but that works because I tried it - I reloaded the scene, shot Anacleto, and with that code in place I then automatically put away my weapons and the pirate says his piece.


So now you get Anacleto's ship - or do you? Here's the code to give you the ship:
Code:
       pchar.ship.type = characters[GetCharacterIndex("Anacleto Rui Sa Pinto")].ship.type;
       pchar.ship.name = characters[GetCharacterIndex("Anacleto Rui Sa Pinto")].ship.name;
       pchar.ship.nation = characters[GetCharacterIndex("Anacleto Rui Sa Pinto")].nation; // KK
       SetCrewQuantity(pchar, 200);
       SetBaseShipData(pchar);
The line added by KK is ineffective because 'SetBaseShipData' sets the ship to your nation. The line 'SetCrewQuantity(pchar,200)' is a relic from the stock game in which a pinnace had a crew of over 300, while ours has a crew of a little over 100. And in any case this whole lot is unnecessarily complicated because there's a neat function to do the job properly, and the original authors knew about it because they used it for a different purpose. 'ExchangeCharacterShip(Pchar, characterFromID("Ship Storage"))' gives your ship to a dummy character whose entire purpose is to look after the ship when it's taken from you, e.g. because you fell overboard. A similar line later gives you the ship back. It also works to take someone else's ship. So, in both cases "kill_anacleto_complete" and "kill_anacleto_complete_2", comment out or remove those five lines and add:
Code:
ExchangeCharacterShip(Pchar, characterFromID("Anacleto Rui Sa Pinto"));
And now you get Anacleto's actual ship.
 
if someone tries to initiate a dialog while you have weapons drawn, the dialog fails and quits at once
Indeed that is always tricky and there may be a fair bit of spots in various storylines and sidequests that don't do "automatic sword (un)sheathing" where necessary.
Though I do seem to remember that normally when an NPC walks up to me, wanting to talk with me having my sword drawn, as soon as I sheath my sword, the dialog starts after all.

So, at the end of case "kill_anacleto_complete", I've added this:
I definitely appreciate you smoothing this out! :onya

I'm not sure how much of the new stuff is really necessary or whether there's a tidier way to do it, but that works because I tried it
For a fair few of those lines, I honestly haven't got a clue what they do or why.
But if works, that's all that matters! ;)

So, in both cases "kill_anacleto_complete" and "kill_anacleto_complete_2", comment out or remove those five lines and add:
Brilliant!
I would normally be tempted to just use GiveShip2Character, but an actual exchange is ever better. :woot
 
Indeed that is always tricky and there may be a fair bit of spots in various storylines and sidequests that don't do "automatic sword (un)sheathing" where necessary.
Though I do seem to remember that normally when an NPC walks up to me, wanting to talk with me having my sword drawn, as soon as I sheath my sword, the dialog starts after all.
I've seen that happen a few times as well, and when I find out how it happens, I'm going to start using the same trick. Meanwhile in my own code I've often been using a combination of 'LAi_SetFightMode(PChar, false)' and 'LAi_LocationFightDisable' so that you're forced to put your weapon away and then can't draw it again until the character who wants to talk to you has done so.
 
Hi Grey Roger,
Have tested this as per the 7 Jan update - It indeed is a bug if you use your pistol to kill Anacleto. If you shoot him, but not kill him, and finish him with your sword - game progresses normally.

I believe in the stock game and Build 13 - when you were shipwrecked, you lost all of your money and inventory? Could be wrong though. This would mean that you could not defend yourself when entering the jungle at night. Currently in the latest version (and all of Build 14) you only loose your money.

I tried inserting your code above into the quest_reaction.c file and the crewman did not walk out - but he didn't talk either even when approached. not sure what is happening though.

Either way, you don't have to talk to the crewman as you have the ship when you go to the bay.
 
In Build 13 you also only lost your money, not your equipment. I'm not sure whether Build 13 still required you to go into town first and ask at the tavern before going back to the pirate fort, which is certainly what you had to do in the stock game. I usually did it anyway, and by the time I'd been to town and back, and wiped out a few gangs of highwaymen or general thugs on the way, I had quite a bit of cash.

Strange that the crewman did not talk to you - he did when I tried it. I will need to look into that further. Have you a savegame from before you entered the tavern and talked to Anacleto?

It is true that you get Anacleto's ship anyway, but it's neater if the crewman explains why you got it.
 
My apologies Grey Roger -
I reviewed the code in quests_reaction.c and found I had made an error.
I had inadvertently overwritten a line of code in copying your lines above.
The above changes do in fact work perfectly. You can call this one fixed as well.
:modding
 
Thanks for testing this, @salonikasurf! :onya

It's about time I uploaded my fixed version of "quests_reaction.c", which contains both the fix for shooting Anacleto and the revised code to give you his ship.
 

Attachments

  • quests_reaction.c
    345.1 KB · Views: 167
Back
Top