Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: LL Notorious B.I.G. Will C-H on Tue 20/05/2003 17:00:37

Title: dialog request question
Post by: LL Notorious B.I.G. Will C-H on Tue 20/05/2003 17:00:37
how do you actually use the dialog request function in the main global script file? what im doing is this

function dialog_request (int 1) {
//my code here
}

using the command   run-script 1     in the actual dialog. is this right? well its obviously not cuz when i try and run the game it says Error (line 58); PE03: Parse error at '1'
its kindof had to tell what some of the stuff in the manual means. a lot of the functions have actual examples of what its meant to look like that you can copy and paste but in this case it just says    dialog_request (int parameter)   which makes it much harder to work out where youre going wrong.

any help with this much appreciated, cheers - will
Title: Re:dialog request question
Post by: Scorpiorus on Tue 20/05/2003 20:50:20
Yep, in the dialog script you use run-script 1 command. As about dialog_request() function you should organize it this way:

function dialog_request (int parameter) {

 if (parameter == 1) {
   // <...code here...>
 }

}

See? when you declare a function you need to use formal parameter name (parameter) instead of actual value.

-Cheers
Title: Re:dialog request question
Post by: LL Notorious B.I.G. Will C-H on Wed 21/05/2003 17:42:18
lovely, thankyou ( i actually ended up doing a cop put method using different dialogs and whatnot, but ill know for next time)
cheers -will