Wrong dialog being displayed on .Start()

Started by Denzil Quixode, Thu 21/01/2016 15:22:05

Previous topic - Next topic

Denzil Quixode

I have recently opened a project that was started in AGS 3.3.3 in version 3.3.4 and discovered that one of the dialogs is now consistently being replaced with a different one when I try to .Start() it. The one that it gets replaced by happens to be the dialog with ID 0. I tried going back to AGS 3.3.3 but the problem persists, so maybe it is just a coincidence that I noticed this now.

There are other dialogs in the game that do not seem to be affected. I tried creating a new dialog, but the new one had the same problem.

I did have a custom dialog rendering routine, but I tried disabling it and that didn't fix it. I also tried putting this in dialog_options_get_dimensions:

Code: ags
Display("%d", info.DialogToRender.ID);


...and confirmed that the ID of the dialog is 0, not the ID that it should be.

I also tried dialog[<x>].Start() instead of dDialog<x>.Start(), but that didn't fix it.

Has anyone had a similar problem? And any suggestions for what might fix it?

Crimson Wizard

So, let me clarify this. You have Dialogs named like dDialog0, dDialog1, dDialog2, etc, and when you call, for example dDialog5.Start(), dDialog0's lines and options play instead?

Couple of questions: how many dialogs you have in total, and do you use subfolders in the dialogs list? I recall we had number of issues with folders before (although I think they were fixed)

Denzil Quixode

#2
Quote from: Crimson Wizard on Thu 21/01/2016 15:45:46
So, let me clarify this. You have Dialogs named like dDialog0, dDialog1, dDialog2, etc, and when you call, for example dDialog5.Start(), dDialog0's lines and options play instead?
Essentially, yes - the actual ID was 7, and I did give it a custom script-name instead of keeping the default, if that makes any difference.

Quote from: Crimson Wizard on Thu 21/01/2016 15:45:46
Couple of questions: how many dialogs you have in total, and do you use subfolders in the dialogs list? I recall we had number of issues with folders before (although I think they were fixed)
55 in total, and yes - the dialog in question is 2 folders deep.

Denzil Quixode

I tried moving every dialog out to the root of Dialogs, and deleting all the (empty) subfolders - curiously, this fixed the dialog I was having problems with, but the same problem is now happening with other dialogs that (I think) were okay before.

Crimson Wizard

Would it be acceptable for you to send me your project? I would like to look at what's going on under debugger.

Taxler Endiosk

Ok, I worked out what it was (laugh) Predictably, the root cause was a stupid mistake on my part, and it's a pretty unlikely situation - but it's a case where AGS should probably try to give an error message if possible.

You can reproduce it by creating a new game with 4 dialogs.

dDialog0:
Quote@S
  Display("Hello from Dialog 0!");
stop

dDialog1:
Quote@S
  /* I'm a comment, but something is wrong... /*
  Display("Hello from Dialog 1!");
stop

dDialog2:
Quote@S
  Display("Hello from Dialog 2!");
stop

dDialog3:
Quote@S
  /* I'm a comment */
  Display("Hello from Dialog 3!");
stop

This will compile with no problems. Calling dDialog2.Start() will instead begin dDialog0.

Essentially, dDialog2 has been entirely /* commented out */ thanks to the unclosed comment started in dDialog1 that carries through to the comment in dDialog3.

The syntax highlighting in the editor also manages to miss that the comment was unclosed - the line after it was highlighted as normal - so I didn't spot this until I was really hunting through all the dialogs.

Crimson Wizard

Oh. That's probably because dialog script has different syntax highlighting.
Also, when dialogs are compiled they are actually all merged into one huge script.

Denzil Quixode

Thanks for working it out Taxler. Crimson- right, that all makes a lot of sense, it's a perfect storm of bad luck more than anything else.

SMF spam blocked by CleanTalk