Tutorial for Merchant dialogue bugged?

Started by SDA, Fri 18/01/2013 20:45:07

Previous topic - Next topic

SDA

Well, I'm not sure if it would be considered a bug, but it seems to be a problem for me.

I'm using the standard tutorial that comes with the download of the AGS editor. I fixed some of the problems I already had (the merchant not even appearing made me feel pretty stupid) but now I'm at a weird point.

The tutorial asks for me to have the merchant and the character start a dialog. They introduce themselves, and the first option (Who are you?) and the third option (Bye, see you later.) both work, but the second option (Tell me more about your wares.) begins the first two lines, but when the choice between items is meant to come up, nothing appears and I am unable to get out of the dialog.

I know it's kind of really bad looking for me to have problems with the tutorial, but I'm almost completely positive I'm doing the dialogue correctly, copying  what's in the screenshots in the tutorial. If the tutorial is still correct, than maybe it's not in the dialogue.

The two I have for dialogue are:

// Dialog script file
@S  // Dialog startup entry point
EGO: "Greetings!"
MERCHANT: "Hello there!"
return
@1
MERCHANT: My name is Derek, and I'm a local merchant.
MERCHANT: I can sell you all sorts of things.
return
@2
MERCHANT: I specialize in selling various random items.
MERCHANT: My jackets and fake eyeballs are popular.
goto-dialog dWares
@3
MERCHANT: Do pop by again sometime.
stop

and

// Dialog script file
@S  // Dialog startup entry point
return
@1
MERCHANT: A fine leather jacket - for you, just $200!
EGO: That's a bit expensive, isn't it?
MERCHANT: Not for this, Sir. It's hand-made by my wife.
EGO: Oh, ok then.
return
@2
MERCHANT: A perfect joke item, the eyeball is just $3.99
return
@3
MERCHANT: Very well.
goto-previous

I only get up to "My jackets and fake eyeballs are popular."

If there's something else I should post, say so. I'm really trying to wrap my head around this.

RetroJay

Hi SDA.

Have you named the second dialog as dWares in the property window?
If not your game won't find it.

Only a thought.
Jay.

SDA

Quote from: RetroJay on Fri 18/01/2013 21:52:43
Hi SDA.

Have you named the second dialog as dWares in the property window?
If not your game won't find it.

Only a thought.
Jay.
Yeah, dialog 1 is titled dWares. Dialog 0 is the one leading up to it. That's what is confusing me.

Khris

I can replicate this by checking only one option's "Show" box and putting a "return" in the script for that option.

What happens is AGS notices that there's only one possible choice, and auto-selects it. The script is run, and when it gets to "return", it goes back to the choices. Again, the only active choice is auto-selected, and voilà , endless loop.

Check your dialog options and make sure their "Show" box is ticked. ("Show" means the option is active or on, and is listed on the choice GUI, "Say" means the player will say the option after it was selected, as opposed to AGS jumping to the dialog script immediately.)

You can also put this in game_start
Code: ags
  game.show_single_dialog_option = 1;

but this doesn't really fix the underlying problem. I'm mentioning it just for reference.

SDA

#4
Quote from: Khris on Sat 19/01/2013 16:16:38
I can replicate this by checking only one option's "Show" box and putting a "return" in the script for that option.

What happens is AGS notices that there's only one possible choice, and auto-selects it. The script is run, and when it gets to "return", it goes back to the choices. Again, the only active choice is auto-selected, and voilà , endless loop.

Check your dialog options and make sure their "Show" box is ticked. ("Show" means the option is active or on, and is listed on the choice GUI, "Say" means the player will say the option after it was selected, as opposed to AGS jumping to the dialog script immediately.)

You can also put this in game_start
Code: ags
  game.show_single_dialog_option = 1;

but this doesn't really fix the underlying problem. I'm mentioning it just for reference.

I just checked, and each 'Show' box is ticked for each line of dialog. I'm wary of following your suggestion only because I screwed up a line of code on here before and I think that's what started my mess.

EDIT: Well, this is odd. On the dWares dialog, I removed the first 'return' command, the one before @1, and it performed the first bit of dialog about the leather jacket, and then becomes stuck again in the same way. If I skip the 'return' on each line for dWares, it simply goes through the dialog until it starts from dMerchant. I'm not good at understanding why that is, but it's interesting, anyway.

Khris

All the line does is keep AGS from auto-selecting the only remaining dialog option. You can't break anything by using it.

SDA

#6
Quote from: Khris on Sat 19/01/2013 20:24:25
All the line does is keep AGS from auto-selecting the only remaining dialog option. You can't break anything by using it.

Updated my original post, just so you know. Edit: No, wait, I mean the one you responded to. I'm having an off time with this. Grr.

Also, do I enter that at line 1, or is it at another point? I don't want to move things that shouldn't be moved.

Slasher

As Khris points out you could also put the piece of script in the Global asc.

Go into the Global asc script and look for function game_start() (line 47 I believe):


Code: AGS

function game_start() 
{  
 game.show_single_dialog_option = 1; // add this 

 initialize_control_panel(); // this will already be there
 KeyboardMovement.SetMode(eKeyboardMovement_Tapping); // this will already be there
{


SDA

Quote from: slasher on Sat 19/01/2013 21:00:40
As Khris points out you could also put the piece of script in the Global asc.

Go into the Global asc script and look for function game_start() (line 47 I believe):


Code: AGS

function game_start() 
{  
 game.show_single_dialog_option = 1; // add this 

 initialize_control_panel(); // this will already be there
 KeyboardMovement.SetMode(eKeyboardMovement_Tapping); // this will already be there
{


Yup, just tried it. Not working. Maybe I should start the tutorial over again?

Khris

SDA, please stop quoting the entire previous post. There's a reply button at the bottom.

Quote from: SDA on Sat 19/01/2013 20:19:03If I skip the 'return' on each line for dWares, it simply goes through the dialog until it starts from dMerchant. I'm not good at understanding why that is, but it's interesting, anyway.

It's actually quite straightforward. The @1, @2 etc. are simply entry points. When an option is selected, AGS goes into the dialog script at the corresponding entry point and moves down until it hits "stop" (which ends the dialog), "return" (making AGS go back to showing the dialog options GUI) or "goto-previous" (making AGS go back to the previous dialog).
If you remove all the "return"s, AGS will enter the script and process every line in order, ignoring @-lines, until it hits "goto-previous" at the end, at which point it goes back to dMerchant.

So let's recap:
1) dWares is called by dMerchant
2) dWares has multiple options, and all of them have their "Show" box ticked
3) at the start of dWares it says
Code: ags
@S  // Dialog startup entry point
return
which basically disables the additional feature of executing commands at the very start of the dialog, so this shouldn't have any affect at all

I can't conceive of a situation in which this wouldn't let you select one of dWares' options, sorry.

SDA

Well, I'm restarting the tutorial tomorrow to see what will happen. Same thing happens, I'll let you guys know here.

Khris

Before doing that, you could upload your current source files somewhere and let us take a look at them.

SDA

Quote from: Khris on Sun 20/01/2013 16:11:12
Before doing that, you could upload your current source files somewhere and let us take a look at them.

Oh, that's an idea. Any suggestions?

Khris

Off the top of my head: netload, uploaded, rapidshare, mediafire, dropbox, google drive?


Khris

That's just the main script; we need all the source files.

In your game dir, delete all *.exe files in the _Debug and Compiled dirs to keep the file size small.
Then pack the game's directory using Winrar or 7zip or any other free packer.
Upload the resulting archive file.

SDA

Quote from: Khris on Sun 20/01/2013 21:02:09
That's just the main script; we need all the source files.

In your game dir, delete all *.exe files in the _Debug and Compiled dirs to keep the file size small.
Then pack the game's directory using Winrar or 7zip or any other free packer.
Upload the resulting archive file.

http://netload.in/dateixdyTUC85wx/Practice.zip.htm

Well, that was embarrassing on my end. I didn't delete anything because I wasn't quite sure which to delete, but it's only a few megabytes I think.

Khris

Well, that was easy...

You didn't enter any text in the options' text boxes. Looks like AGS ignores dialog options if there's no text entered, which kind of makes sense since it uses that text to display the option to the user in the first place.
Granted, this is mentioned just in passing by the tutorial: "create three new options and type them in".

SDA

Quote from: Khris on Sun 20/01/2013 23:08:27
Well, that was easy...

You didn't enter any text in the options' text boxes. Looks like AGS ignores dialog options if there's no text entered, which kind of makes sense since it uses that text to display the option to the user in the first place.
Granted, this is mentioned just in passing by the tutorial: "create three new options and type them in".

On a scale of dumb-to-braindead, I feel pretty stupid. Thanks for the help.

SDA

Okay, so I'm moving on from this tutorial, but the scripting and making a custom quit GUI pages are either missing or not linking properly. I don't know why that is, though.

I don't want to create a new topic for every problem, though. I'm also not sure if that belongs in this forum, as it's a problem I'm having with the tutorial rather than the scripting itself.

SMF spam blocked by CleanTalk