Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: proskiier on Tue 15/01/2008 21:46:08

Title: Dialog script problems(SOLVED)
Post by: proskiier on Tue 15/01/2008 21:46:08
(http://img120.imageshack.us/img120/9386/errornm0.png)



basically my first dialog has a person where you can guess their favorite color and if you get it right i wanted to give the player an inventory item

(http://img183.imageshack.us/img183/4757/playerwi2.png)

ive tried so many of the add inventory ways and it gives an error for all of them.

Please help me soon, this is driving me nuts!!!
Title: Re: Dialog script problems
Post by: Galen on Tue 15/01/2008 21:52:32
Read The Freaking Manual.

add-inv X
Adds inventory item X to the current player's inventory. This does the same thing as the AddInventory script command, but is provided here because it is frequently used in dialogs.
Title: Re: Dialog script problems
Post by: proskiier on Tue 15/01/2008 21:59:29
ok and how about play sound???

Is there a list of all dialog commandS???

nervermind found it in the help file... thanks... kinda dumb you can only do so few things :(
Title: Re: Dialog script problems
Post by: NiksterG on Tue 15/01/2008 22:05:02
Yes, there is. It's in the main Dialogs page in the manual. Please read this - it's got good information.

To answer your question, in order to play a sound during the dialog, you'll have to do run-script x.

If the sound should be played after every time the player gets an item, you can do that under game settings.
Title: Re: Dialog script problems
Post by: Galen on Tue 15/01/2008 22:28:38
Quote from: proskiier on Tue 15/01/2008 21:59:29
nervermind found it in the help file... thanks... kinda dumb you can only do so few things :(
You're ignoring the function that allows you to add scripts (in a way) into it.
Title: Re: Dialog script problems(SOLVED)
Post by: Khris on Wed 16/01/2008 00:05:44
And fyi:
It should be possible to do this:

// dialog script file
@S
@2
COLORTWIN: "Wow, you're right!"
run-script 1
goto-dialog 4
@1
@3
@4
COLORTWIN: "Nope, that's not right!"
return
@5
COLORTWIN: "Ok fine, bye!"
stop


Then, in the global script, find/create the function dialog_request:
function dialog_request(int param) {
  if (param==1) {
    cEgo.AddInventory(iColorSplotch);
    PlaySound(2);
  }
}