Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: holden24 on Thu 16/11/2006 03:08:07

Title: dialog_request
Post by: holden24 on Thu 16/11/2006 03:08:07
I cant get my run-script x in my dialogs to work.

Code:
#sectionstart dialog_request  // DO NOT EDIT OR REMOVE THIS LINE
function dialog_request(int parameter) {

dialog_request (1) {
player.Walk(160,171,eBlock);
player.Say("Why, Thank-you");
player.Walk(160,160);
}
 
}
#sectionend dialog_request  // DO NOT EDIT OR REMOVE THIS LINE
Title: Re: dialog_request
Post by: Khris on Thu 16/11/2006 04:05:02
#sectionstart dialog_request  // DO NOT EDIT OR REMOVE THIS LINE
function dialog_request(int parameter) {

  if (parameter==1) {
    player.Walk(160,171,eBlock);
    player.Say("Why, Thank-you");
    player.Walk(160,160);
  }

}
#sectionend dialog_request  // DO NOT EDIT OR REMOVE THIS LINE


Using run-script x is like writing dialog_request(1); in a regular script.
If AGS hadn't rejected the syntax, you'd have gotten a function repeatedly calling itself until AGS'd have crashed.

BTW, if you want to display those grey boxes, use code tags:
[*code]...[*/code] without the *s
For other forum tags, check the link directly above the row of smileys.
Title: Re: dialog_request
Post by: Ashen on Thu 16/11/2006 10:59:57
Not only is dialog_request explained in the manual (albeit poorly) and the BFAQ (http://americangirlscouts.org/agswiki/Scripting%2C_Code_%26_Interaction#Running_regular_code_inside_dialog) (much better), it's been asked on the forums many, MANY times. Please, check all of those places before posting.