• 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 Havana Blacksmith Old Dialog Code to be replaced

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
Under the latest version of Beta 3.4 (I downloaded the installer and zip file yesterday and installed them both), the blacksmith at Havana still fails to repair single blades for me. And he'll only repair batches to Average quality:
havana_blacksmith.jpg
At the time that picture was taken, I was carrying a Back-Bladed sword which I'd taken from a dead enemy. It was either Fine or Good quality - it had previously been polished to Excellent by the blacksmith in Kingston, but I'd landed at a beach on Cuba and fought several battles with brigands to get into Havana, as well as boarding a pirate ship on the way to Cuba.

Attached are log files plus a savegame. If you do look at the savegame, please also go to the store and see how many weapons, items and maps he has for sale...
 

Attachments

  • compile.zip
    7 KB · Views: 63
  • error.zip
    455 bytes · Views: 61
  • system.zip
    1.9 KB · Views: 62
  • -=Player=- Cuba.zip
    703.8 KB · Views: 66
The main issue you mention is intentional and therefore Not a Bug. See here this post where I announced that:
http://www.piratesahoy.net/threads/updates-to-blacksmiths.24355/page-4#post-497182
If you have any comments or suggestions on that, feel free to let me know. Due to lack of feedback on that before, I left it as per my suggestion there.
Since I don't like the Havana blacksmith (because he's a boring copy of the Bonaire one), I made him pretty crappy until somebody makes the guy more interesting.... :whipa

That being said, single blade repairs should work at ALL blacksmiths! I'm pretty sure we checked it and it works too.
So that is very strange.
 
The main issue is that he only repairs all blades, i.e. batch mode. (The fact that he only repairs batches up to Average doesn't bother me because I don't use batch mode anyway.)

This isn't limited to the "Nelson" campaign, I found the same problem in a previous game, though at that time I was playing a version of Beta 3.3 which was already not quite up to date. But this report and saved game are based on Beta 3.4. The fact that I'm Nelson is evidence of that. ;)
The Havana blacksmith is more like a copy of the San Juan one in that he's grumpy. If the citizen dialog files were also based on San Juan, I'd make up a new story about why he's grumpy!
 
That is very odd. Can you check your PROGRAM\Storylines\Nelson\DIALOGS folder to see if there are any blacksmith dialogs in there?
I'm pretty sure I edited all files properly, but if a storyline folder contains an out-of-date file, that could indeed happen. :modding

Alternatively, check PROGRAM\Characters\init\Cuba.c and search for "blacksmith". That should tell you exactly which dialog file the Havana one uses from the PROGRAM\DIALOGS folder.

Are you able to do single blade repairs at the other blacksmiths?
 
"PROGRAM\Characters\init\Cuba.c" indicates that the correct file is "Blacksmith7_dialog.c". I can't do anything with the .c file but "Blacksmith7_dialog.h" does appear to contain the relevant dialog for single blade repairs. Marco (which is the name mentioned in that file and is indeed the Havana blacksmith's name) just doesn't use it. (Neither the .c or .h file appear in the .7z update so I looked at them in the main installer.)

Kingston blacksmith does single repairs. That's how I got the Back-Bladed Sword to Excellent. ;)
 
Is Blacksmith7_dialog.h indeed the grumpy one? Thought it was a copy of the Bonaire one. Oh well, that doesn't matter very much.

The .c file is what controls what features are available.
If you do a WinMerge between the Blacksmith4 and Blacksmith7 dialog.c files you should be able to see how different/not different they are in functionality.
Blacksmith4 is the Jamaica one that you say does work properly for you.
 
There certainly are differences. For one thing, the top of "Blacksmith7_dialog.c" indicates that it's a copy of, or based on, "Blacksmith2_dialog.c" - which smith is that?

From "Blacksmith4_dialog.c":
Code:
if(HasSubStr(BladeID,"halberd"))     //JRH
     {
       needexit = false;
       Dialog.text = DLG_TEXT[35];
       link.l100 = DLG_TEXT[4];
       link.l100.go = "exit";
     }
     else
     {
       if (BladeID != "")
       {
         // Retrieve blade name, blade quality, and upgrade prices
         string BladeName  = GetItemNameByID(BladeID);

From "Blacksmith7_dialog.c":
Code:
if(HasSubStr(BladeID,"halberd"))     //JRH
     {
       needexit = false;
       Dialog.text = DLG_TEXT[28];
       link.l100 = DLG_TEXT[29];
       link.l100.go = "exit";
     }
     else
     {
       if(CheckCharacterItem(MainChar,"halberd") || CheckCharacterItem(MainChar,"halberd-1") || CheckCharacterItem(MainChar,"halberd-2"))
       {
         //JRH option of repair 1 blade only in this case

         if (BladeID != "")
         {
           // Retrieve blade name, blade quality, and upgrade prices
           string BladeName  = GetItemNameByID(BladeID);
Both have what appears to be a check for a halberd, but "Blacksmith7_dialog.c" has some sort of additional check before proceeding to the single blade repair. That additional check does not appear in "Blacksmith2_dialog.c".
 
You should remove that line. It doesnt seem right
 
Probably that blacksmith7_dialog.c file is COMPLETELY out of date then and has to be replaced.
 
@Levis, do you reckon you could figure this out? Perhaps even @Grey Roger now that you've seen what it should NOT be like? :cheeky
If not, I'll have to remember to sort this out on Sunday.
 
I don't think it's a matter of the file being out of date. That line appears to be a check for a halberd. There's an identical line further down, preceding what appears to be the code to repair all blades. At that location, if the check passes then it goes to a section which just contains a comment line, otherwise it proceeds to the code to repair all blades, which appears identical to that part of "Blacksmith2_dialog.c".

The problem with the offending line is that if the condition passes then it goes to the code to repair single blades. If I understand it correctly, that means the Havana blacksmith will only repair a halberd! Whereas I believe you're not supposed to be able to repair a halberd. (Can you take the halberd away from Havana? If so, you can get it repaired at any other blacksmith. ;))

Try this, which is what it looks like after I've done there what JRH did further down at the section to repair all blades:
Code:
if(CheckCharacterItem(MainChar,"halberd") || CheckCharacterItem(MainChar,"halberd-1") || CheckCharacterItem(MainChar,"halberd-2"))
       {
         //Grey Roger - what is supposed to happen to a halberd
       }
       else
       {
 
There is a check Before it already for the halbert, do just remove that if statement
 
Then presumably the similar check preceding the code for batch repairs can also go?
 
it should be like this:
Code:
if(HasSubStr(BladeID,"halberd")) //JRH
{
needexit = false;
Dialog.text = DLG_TEXT[28];
link.l100 = DLG_TEXT[29];
link.l100.go = "exit";
}
else
{
//JRH option of repair 1 blade only in this case

if (BladeID != "")
{
// Retrieve blade name, blade quality, and upgrade prices
string BladeName = GetItemNameByID(BladeID);
 
I can assure you that file is outdated. The code you posted is something I rewrote weeks ago.
What Levis posts looks much more correct.
 
Just copy another blacksmith.c file. They're all interchangeable.
Have to check when I get near my files again I suppose.
 
Apart from the indenting, and the comment by JRH which applied to the line you've removed, that makes this part similar to what is in "Blacksmith2_dialog.c". You will also need to scroll down to the end of the section on repairing a single blade and remove a "}" to balance the "{" which you removed along with the redundant condition.

After that section comes this:
Code:
if(CheckCharacterItem(MainChar,"halberd") || CheckCharacterItem(MainChar,"halberd-1") || CheckCharacterItem(MainChar,"halberd-2"))
     {
       //JRH no option of repair all blades
     }
     else
     {
       link.l94 = DLG_TEXT[30];
       link.l94.go = "RepairAllBlades";
     }
That bit is outside the chunk of code which is conditional upon the proper halberd check. The "if(CheckCharacterItem(MainChar,"halberd")..." condition is missing from "Blacksmith2_dialog.c". Should it also be removed from here?

Update: looks like Pieter was replying while I was typing that. The logical solution seems therefore simply to replace the existing "Blacksmith2_dialog.c" with a copy of "Blacksmith7_dialog.c". The original "Blacksmith7_dialog.c" in the Part 2 archive is exactly that, a copy of "Blacksmith2_dialog.c".
 
Don't worry about this one. I'll have it sorted in a minute on Sunday.
 
Yep, blacksmith7 dialog was very much out of date. Replaced with original functionality restored as intended. :cheeky
 
Back
Top