Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 13/05/2005 21:08:13

Title: Dialogs / questions
Post by: on Fri 13/05/2005 21:08:13
Hi, i guess I'm still a noob with AGS, i have two simple questions about dialogs:
1. Why cant i use sctipting commands in dialogs
2. Is there a way to do it / how?

Im just trying to use a variable in dialog, if you use the correct stuff, you should get your variable higher.
[i've red the manual many times, anyway]
thanks
::)
Title: Re: Dialogs / questions
Post by: geomis on Fri 13/05/2005 21:21:45
If you mean commmands like  give inventory items i am sure i saw that some where in the help index or some where in help but if thats not what you were meaning then i dont know what your on about coz i a noob too.
Title: Re: Dialogs / questions
Post by: on Fri 13/05/2005 21:34:43
Yeah, but i only need my variable to work now.
Title: Re: Dialogs / questions
Post by: BorisZ on Fri 13/05/2005 21:36:16
It's all in the manual. Check it again!
Title: Re: Dialogs / questions
Post by: on Fri 13/05/2005 21:41:32
Well, im doing this all day. Could you point me at least?
Title: Re: Dialogs / questions
Post by: Ubel on Fri 13/05/2005 21:55:21
Dialog request is the thing you need.

Write this in the Dialog script: run-script 1

Then this to global script:

function dialog_request (int parameter) {
if (parameter==1) {
//your code here
}
}

I'm not sure if this is absolutely correct (didn't check from the manual).
Title: Re: Dialogs / questions
Post by: on Fri 13/05/2005 22:13:47
Thanks, almost got it to work.  :)

function dialog_request (int parameter) {
if (parameter==1) {
// trust is the name of the variable:
trust += 1;
}
}

Now it shows "Undefined token 'trust'", but i've added this variable to the 'global variables' thingy , what did i did wrong...?
Title: Re: Dialogs / questions
Post by: Ishmael on Fri 13/05/2005 22:17:25
Read the scripting tutorial in the manual, it'll give you a nice start.

Anyway, to get the variable working, you need to define it... put:

int trust;

into the beginning of the global script...
Title: Re: Dialogs / questions
Post by: on Sat 14/05/2005 17:42:25
Heeey tuntis how's your ags life ;] i figured it out, thanks all (maybe?)
Title: Re: Dialogs / questions
Post by: TerranRich on Sat 14/05/2005 21:32:55
BFAQ'ed: http://balder.prohosting.com/bfaq/#coding02

I'll let it slide for now since the original site for the BFAQ is currently down. I will update all links with this temporary URL. :)
Title: Re: Dialogs / questions
Post by: on Sun 15/05/2005 01:42:37
Thats a nice citey, but i figured it all, and i know EVERYTHING ELSE!
[ya right]
thanks again to all