Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sat 20/09/2003 20:14:41

Title: Dialog (and scripting?) problems..
Post by: on Sat 20/09/2003 20:14:41
How can I disable and enable a dialog option in the middle of conversation?

And how I can make things to happen in the middle of conversation? Like when you use right dialog options, an object will appear in the room (or some other room) etc..

Final question may be the answer to both earlier, but how the regular scripting language works in dialog script?
Title: Re:Dialog (and scripting?) problems..
Post by: taryuu on Sun 21/09/2003 04:18:52
well there's  these commands

option-off X
Turns option X for the current topic off, meaning it won't be displayed in the list of choices next time.

option-off-forever X
Turns option X off permanently. It will never again be displayed, not even if an "option-on" command is used.

option-on X
Turns option X for the current topic on, including it in the list of choices to the player next time they are displayed.

read the tutorial here
http://www.agsforums.com/acintro8.htm

and as for the other question you can scripts from the global script in your conversation with this

run-script X

Runs global text script function "dialog_request", with X passed as the single parameter. This allows you to do more advanced things in a dialog that are not supported as part of the dialog script. The "dialog_request" function should be placed in your game's global script file, as follows:

 function dialog_request (int xvalue) {
   // your code here
 }

does that help?
Title: Re:Dialog (and scripting?) problems..
Post by: PaladinOfHonor on Sun 21/09/2003 12:01:37
What the "X" means ?

What I need to set on it ?

:o :o :o
Title: Re:Dialog (and scripting?) problems..
Post by: on Sun 21/09/2003 14:26:38
A number.
Title: Re:Dialog (and scripting?) problems..
Post by: PaladinOfHonor on Sun 21/09/2003 15:05:12
Quote from: TK -Visiting Cousin on Sun 21/09/2003 14:26:38
A number.

how couldnt I guss...

but what number ?  :o
Title: Re:Dialog (and scripting?) problems..
Post by: Isegrim on Sun 21/09/2003 16:52:10
The number of the dialog option you want to turn on/off...
sonds logic, hm? :P
Title: Re:Dialog (and scripting?) problems..
Post by: PaladinOfHonor on Sun 21/09/2003 19:51:17
Quote from: Isegrim on Sun 21/09/2003 16:52:10
The number of the dialog option you want to turn on/off...
sonds logic, hm? :P

but what if I want to disable just one line of the dialog ?

And where I put it ?
Begin , Middle or end ?

:o
Title: Re:Dialog (and scripting?) problems..
Post by: Isegrim on Sun 21/09/2003 19:59:14
Can you be more concrete?
Title: Re:Dialog (and scripting?) problems..
Post by: PaladinOfHonor on Sun 21/09/2003 20:07:17
Quote from: Isegrim on Sun 21/09/2003 19:59:14
Can you be more concrete?

A : @s "Hello !"
B : @s "Hail :D !"

<here I want when he will "return" function to here , they wont say it>

A : @1 "what is ur name ?"
B : @1 " My name is Pigi , short of pigines"
A : @1 "Umm...."

<here I want to disable it>

A : @2 "What is ur price for all ?"
B : @2 "34 gp"

return


thats all...

where i put the "<" ">" i want to know what to put ^^
Title: Re:Dialog (and scripting?) problems..
Post by: Isegrim on Sun 21/09/2003 20:27:54
Your code is totally screwed.

So... In your editor, the dialog topic 0 should contain the following options:
1: "What is your name"
2: "What is your price?"
behind both lines, both boxes should be checked. ("Show" and "Say" are on)

Then your dialog script should look like:

// dialog script file
@S// dialog startup entry point
   A:"Hail!"
   B:"Hello!"
   return
//Note: what stands above will be said AUTOMATICALLY

 
@1 // option 1
   B:"My name is..."
   A:"blahblah"
   option-off 1 //now only the question "What is your price..." remains
   return //return to the dialog
   
   
@2// option 2
   B:"Blahblah"  
   stop //will exit the dialog and return to the game



Also note that when the "Say" option is on, the line will be said. You do not need to put it in the dialog script again.

For your further progress I strongly suggest that you take a very close look at Demo Quest. It contains really all you need. I must say that you could find most answers to your questions yourself by looking how they did Demo Quest.

Edit:
Sorry if that sounds a bit hard, but honestly: Play with Demo Quest. Change settings, add your own rooms, copy their script functions and modify them. This way you learn more about AGS than during a month here in the forum. Btw. I think there is also a small cutscene (When Roger opens a door)
Title: Re:Dialog (and scripting?) problems..
Post by: PaladinOfHonor on Mon 22/09/2003 11:27:37
Quote from: Isegrim on Sun 21/09/2003 20:27:54
Your code is totally screwed.

So... In your editor, the dialog topic 0 should contain the following options:
1: "What is your name"
2: "What is your price?"
behind both lines, both boxes should be checked. ("Show" and "Say" are on)

Then your dialog script should look like:

// dialog script file
@S// dialog startup entry point
   A:"Hail!"
   B:"Hello!"
   return
//Note: what stands above will be said AUTOMATICALLY

 
@1 // option 1
   B:"My name is..."
   A:"blahblah"
   option-off 1 //now only the question "What is your price..." remains
   return //return to the dialog
   
   
@2// option 2
   B:"Blahblah"  
   stop //will exit the dialog and return to the game



Also note that when the "Say" option is on, the line will be said. You do not need to put it in the dialog script again.

For your further progress I strongly suggest that you take a very close look at Demo Quest. It contains really all you need. I must say that you could find most answers to your questions yourself by looking how they did Demo Quest.

Edit:
Sorry if that sounds a bit hard, but honestly: Play with Demo Quest. Change settings, add your own rooms, copy their script functions and modify them. This way you learn more about AGS than during a month here in the forum. Btw. I think there is also a small cutscene (When Roger opens a door)

1 - i didnt want to write everythink in the right order because i dont realy remember...

2 - so if the "@S" is auto so its a problem :/
nevermind , i could manage with that i guss...

3 - oh yes , now i got it with the numbers

4 - wher i can find the demo quest ?
Title: Re:Dialog (and scripting?) problems..
Post by: Isegrim on Mon 22/09/2003 11:38:28
The @S thingy is not a problem at all...
Don't write anything but "return" and all is well.

You can download Demo Quest right where you downloaded the AGS editor.
Title: Re:Dialog (and scripting?) problems..
Post by: Scummbuddy on Mon 22/09/2003 21:48:53
Download the Demo here

http://www.agsforums.com/acdload.htm