• 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 [WIP] Some dialog errors with surrendered captain

Tingyun

Corsair
Storm Modder
Picked up some errors from a navy captain who had surrendered, though he seemed to become my officer ok and the dialogue seemed to work alright.

I do think it was missing an initial greeting though. He opened with something like "Britain will hunt you down" and it seemed to have skipped over something.

RUNTIME ERROR - file: dialog.c; line: 414
incorrect argument index
COMPILE ERROR - file: dialog.c; line: 414
file not found: dialogs\English\2.869378h
COMPILE ERROR - file: dialog.c; line: 414
file not found: dialogs\2.8693781

Here is the line 414 from dialog.c

DialogFile = GetAttributeN(ParentDialog,i);

Here is the broader function:

Code:
void ProcessAllDialogEvent(ref Character)
{
    if(DIALOG_DEBUG) Trace("Dialog: Process all files for Character: " + Character.ID + " Current Node: " + Dialog.CurrentNode);
    //Here we open all dialog files so dialog options are stored
    int i, dn;
    string DFile, DPath;
    aref DialogFile, ParentDialog;
    makearef(ParentDialog,Character.LoadedDialog);
    dn = GetAttributesNum(ParentDialog);
    if(DIALOG_DEBUG) Trace("Dialog: Number of dialog files = " + dn);
    //Little bit of cleaning up
    if(CheckAttribute(&Dialog,"PreLinks")) DeleteAttribute(&Dialog,"PreLinks");
    //Check the files
    for(i=0; i<dn; i++)
    {
        DialogFile = GetAttributeN(ParentDialog,i);
        DFile = GetAttributeValue(DialogFile);
        DPath = LoadDialogFile(DFile);
        //Only process if there is a file, just to be sure.
        if(DPath != "")
        {
            DialogFilesLoaded = i;
            if(DIALOG_DEBUG) Trace("Dialog: Start Process");
            ProcessDialogEvent();
            //Make sure links aren't overwritten unless specified.
            ProcessLinks(dn, i);
            if(DIALOG_DEBUG) Trace("Dialog: Process Done");
            //Check if the dialog is already closed because of dialog exit, else close it.
            if(DialogFilesLoaded > -1)
            {
                UnloadDialogFile(DPath, DFile);
                DialogFilesLoaded = -1;
            }
        }
    }
    //Levis add attribute for easy checking where we are in the dialog
    Character.Dialog.Lines = sti(Character.Dialog.Lines) + 1;
}
 
Oh, that is scary!

I've seen such bizarre errors before, but can't remember what triggered it.
What I do remember is that the real problem was something completely different.
 
Could you generate a attribute dump for this character @Tingyun ? Probably there is something wrong with the dialog files assigned to this officer
 
@Levis

Unfortunately I don't have any saved games: I was running rapid fire tests of your captain generation by boarding repeatedly, not playing really, so I didn't keep any saved games, just boarded, recorded results, boarded again.

He was an English officer I believe, if that helps in tracking in down.

He was one of those with the soldier flag as character portrait, so like a guard, rather than a picture.
 
So wait ... the the error appear when you talked to him or after you hired him?
If it's after hirering I'm only more tempted to get rid of that special hirering code which is written for captains :p.
 
Levis, I'm afraid I don't know for certain, because I only checked the error log after shutting down the game. So I don't know when exactly it occurred.

I had talked to him to get his surrender and hire him, and then after he was hired he immediately talked to me with the standard officer "what should I do captain" line.

If it is not clear which from the errors and code I posted, then I have no idea either sadly :(
 
@Levis Testing the navy captain equipment, the hybrid navy/merchant captain it created gave similar dialog errors when surrendering:

RUNTIME ERROR - file: dialog.c; line: 414
incorrect argument index
COMPILE ERROR - file: dialog.c; line: 414
file not found: dialogs\English\-0.084684h
COMPILE ERROR - file: dialog.c; line: 414
file not found: dialogs\-0.0846840

He had a guard picture as his character portrait as well.

I did the, ask him for money, then take him as officer dialog choices.
 
again I need a character dump of this character or a savegame with him in it
 
I'll get you one, I was surprised again by it being in the error log. It happens everytime I hit a small navy ship, shouldn't be hard to find it. :)
 
@Levis Ok, bagged another one.

But this time the dialog error didn't occur, so while I made the saved game and uploaded it, it probably won't help.

However, I think I did figure out where the bug occurs. This time I followed the same dialogue tree, asking for his gold first, them his as an officer. But the dialogue had another 3 or so conversation parts that I had never heard in the past cases. Stuff about how many of his crew are good men and such.

I think the problem is with the dialogue tree asking for money, and then talking to him about his crew's fate. It might be linked to the past ones being tier 8 ships, not sure.

When I get another one I will make you a save with it, but it apparently happens somewhat frequently, since I've hit it twice, but not everytime.
 

Attachments

  • -=Player=- Open Sea May 15th, 1682.rar
    513.9 KB · Views: 205
@Levis Just to be clear, the surrender dialogue tree was very different, with an extra dialogue question about what to do with the crew.

So I think the problem isn't post hire, it is pre-hire, where the captain is bugging out in what he needs to say regarding his crew. Seems to happen in tier 8 ships, though maybe coincidence.
 
@Levis Got the error again, this time with a merchant captain, but I was able to save this time. :)

Saved game attached.

RUNTIME ERROR - file: dialog.c; line: 414
incorrect argument index
COMPILE ERROR - file: dialog.c; line: 414
file not found: dialogs\English\1.803785h
COMPILE ERROR - file: dialog.c; line: 414
file not found: dialogs\1.8037854

I think something is wrong with the first dialogue option, where you ask for money. But I hired the guy (you can hire after demanding money) so you have him in the attached save, as the most recently hired and very high level officer.
 

Attachments

  • Save with dialogue error captain.rar
    502.1 KB · Views: 202
Here's another save, with both recently hired officers (so two of them, one merchant, one navy) having triggered this kind of error. Both were hired through the first demand money, then hire as officer dialogue tree.
 

Attachments

  • SECOND SAVE.rar
    523.2 KB · Views: 225
Should be fixed in my latests fixes.
 
Has anyone seen an error like this in the 7th January or 31st August installs, with or without the fixes archive applied?
 
Has anyone seen an error like this in the 7th January or 31st August installs, with or without the fixes archive applied?
Yup I've seen them.
and I found the problem.

I'll provide the fix tonight hopefully
 
Back
Top