Author Topic: Tutorial for Merchant dialogue bugged?  (Read 4938 times)

SDA

Tutorial for Merchant dialogue bugged?
« on: 18 Jan 2013, 20:45 »
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

  • Frankly, my dear, I'm a Kerbal and Proud of it.
    • RetroJay worked on one or more games that won an AGS Award!
    •  
    • RetroJay worked on one or more games that was nominated for an AGS Award!
Re: Tutorial for Merchant dialogue bugged?
« Reply #1 on: 18 Jan 2013, 21:52 »
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

Re: Tutorial for Merchant dialogue bugged?
« Reply #2 on: 19 Jan 2013, 15:31 »
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.

Re: Tutorial for Merchant dialogue bugged?
« Reply #3 on: 19 Jan 2013, 16:16 »
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: Adventure Game Studio
  1.   game.show_single_dialog_option = 1;
but this doesn't really fix the underlying problem. I'm mentioning it just for reference.

SDA

Re: Tutorial for Merchant dialogue bugged?
« Reply #4 on: 19 Jan 2013, 20:19 »
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: Adventure Game Studio
  1.   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.
« Last Edit: 19 Jan 2013, 20:27 by SDA »

Re: Tutorial for Merchant dialogue bugged?
« Reply #5 on: 19 Jan 2013, 20:24 »
All the line does is keep AGS from auto-selecting the only remaining dialog option. You can't break anything by using it.

SDA

Re: Tutorial for Merchant dialogue bugged?
« Reply #6 on: 19 Jan 2013, 20:32 »
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.
« Last Edit: 19 Jan 2013, 20:41 by SDA »

Slasher

  • .
    • I can help with AGS tutoring
    • I can help with scripting
    • I can help with story design
    • Lifetime Achievement Award Winner
    • Slasher worked on one or more games that won an AGS Award!
    •  
    • Slasher worked on one or more games that was nominated for an AGS Award!
Re: Tutorial for Merchant dialogue bugged?
« Reply #7 on: 19 Jan 2013, 21:00 »
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: Adventure Game Studio
  1. function game_start()
  2. {  
  3.  game.show_single_dialog_option = 1; // add this
  4.  
  5.  initialize_control_panel(); // this will already be there
  6.  KeyboardMovement.SetMode(eKeyboardMovement_Tapping); // this will already be there
  7. {
  8.  

SDA

Re: Tutorial for Merchant dialogue bugged?
« Reply #8 on: 19 Jan 2013, 21:41 »
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: Adventure Game Studio
  1. function game_start()
  2. {  
  3.  game.show_single_dialog_option = 1; // add this
  4.  
  5.  initialize_control_panel(); // this will already be there
  6.  KeyboardMovement.SetMode(eKeyboardMovement_Tapping); // this will already be there
  7. {
  8.  

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

Re: Tutorial for Merchant dialogue bugged?
« Reply #9 on: 19 Jan 2013, 21:50 »
SDA, please stop quoting the entire previous post. There's a reply button at the bottom.

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.

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: Adventure Game Studio
  1. @S  // Dialog startup entry point
  2. 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

Re: Tutorial for Merchant dialogue bugged?
« Reply #10 on: 20 Jan 2013, 01:55 »
Well, I'm restarting the tutorial tomorrow to see what will happen. Same thing happens, I'll let you guys know here.

Re: Tutorial for Merchant dialogue bugged?
« Reply #11 on: 20 Jan 2013, 16:11 »
Before doing that, you could upload your current source files somewhere and let us take a look at them.

SDA

Re: Tutorial for Merchant dialogue bugged?
« Reply #12 on: 20 Jan 2013, 19:36 »
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?

Re: Tutorial for Merchant dialogue bugged?
« Reply #13 on: 20 Jan 2013, 19:49 »
Off the top of my head: netload, uploaded, rapidshare, mediafire, dropbox, google drive?

SDA

Re: Tutorial for Merchant dialogue bugged?
« Reply #14 on: 20 Jan 2013, 20:57 »
http://netload.in/dateito7DwXCNCH/GlobalScript.asc.htm

I think I did it right. Let me know.

Re: Tutorial for Merchant dialogue bugged?
« Reply #15 on: 20 Jan 2013, 21:02 »
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

Re: Tutorial for Merchant dialogue bugged?
« Reply #16 on: 20 Jan 2013, 22:59 »
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.

Re: Tutorial for Merchant dialogue bugged?
« Reply #17 on: 20 Jan 2013, 23:08 »
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

Re: Tutorial for Merchant dialogue bugged?
« Reply #18 on: 20 Jan 2013, 23:44 »
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

Re: Tutorial for Merchant dialogue bugged?
« Reply #19 on: 21 Jan 2013, 00:29 »
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.