Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Mon 05/03/2007 17:57:33

Title: Dialog
Post by: on Mon 05/03/2007 17:57:33
Hi,

after my first problem, I've got a problem with my dialog.

My situation is: EGO comes into the ROOM5 and PoJIT will come to him, FaceCharacter and start the dialog1. I want that if EGO choose option 1 and not option 2, the dialog will not start next time EGO comes to ROOM5.

What shall I do?
Title: Re: Dialog
Post by: Joe on Mon 05/03/2007 18:31:07
Here's something you could do



//At room script, player enters room after fade in
if(GetGlobalInt(1)==0){
//Facing stuff
dialog.Start();
}

//At dialog script, option 1
//Conversation
run-script 1

//At global script, dialog_rquest
if(parameter==1)SetGlobalInt(1,1);

Title: Re: Dialog
Post by: on Mon 05/03/2007 18:47:36
Thank you for your answer, but it doesn't work.
Title: Re: Dialog
Post by: Ashen on Mon 05/03/2007 18:48:07
Slight error in that code, as you're checking GI 1, but setting GI 50... Change them to match and it should work.
Other than that little typo, variables are definitely the way to go - but if you use GlobalInts, you can use the dialog script command set-globalint (http://www.adventuregamestudio.co.uk/manual/Conversations.htm) (e.g. set-globalint 50 1) instead of messing around with run-script.
Title: Re: Dialog
Post by: on Mon 05/03/2007 20:05:06
 ???
Nothing happens!

Here is my script
if (GetGlobalInt (1) ==0) {
       {
gGui0.Visible = false;
cFred.Walk(166,135,eBlock);
cEgo.Walk(214, 135, eBlock);
cEgo.FaceCharacter(cFred) ;
cFred.FaceCharacter(cEgo);
cEgo.FaceLocation(43, 123);
d1.Start(); 
}
}

//in Room after fadein
--------------------------------------------------------------------
Fred: X!
option-off-forever 2
option-on 3
option-off-forever 1
run-script 4
run-script 5
set-globalint 1 1
return

//in the dialog script!

But nothing happens!
Title: Re: Dialog
Post by: Joe on Mon 05/03/2007 20:23:47
Do you really have two braces to open the conditional and other two to close it??
Title: Re: Dialog
Post by: on Mon 05/03/2007 21:11:23
Yes, now I have one to open and one to close but it doesn't work.
Title: Re: Dialog
Post by: Ashen on Mon 05/03/2007 23:06:55
Can you just clarify what you mean by 'Nothing happens' and 'it doesn't work'? (Dialog still runs second time, dialog doesn't run either time, something else entirely...)
Title: Re: Dialog
Post by: on Tue 06/03/2007 15:09:20
sorry ::)

I'm starting the game, go to the room and the dialog doesn't even start. So what shall I do?
Title: Re: Dialog
Post by: Khris on Tue 06/03/2007 16:35:46
Quote from: Bogald on Mon 05/03/2007 20:05:06d1.Start();
I'm not sure what AGS makes of "d1", but that's probably the reason why nothing's happening.

Name the dialog properly, like "Fred1", then run it using:
dFred1.Start();
Title: Re: Dialog
Post by: on Tue 06/03/2007 17:35:48
I have changed the script like you told me but the dialogFred1 doesn't start yet.
Title: Re: Dialog
Post by: Joe on Tue 06/03/2007 18:14:25


if (GetGlobalInt (1) ==0) {
gGui0.Visible = false;
cFred.Walk(166,135,eBlock);
cEgo.Walk(214, 135, eBlock);
cEgo.FaceCharacter(cFred,eBlock) ;
cFred.FaceCharacter(cEgo,eBlock);
cEgo.FaceLocation(43, 123,eBlock);
Wait(20);
dFred1.Start(); 
}



Try using that code.
Blocking commands are necessary so that things happen one by one.
And adding that 'Wait' maybe fixes it.
But I'm not sure at all!
Title: Re: Dialog
Post by: on Tue 06/03/2007 19:06:44
I'm seeing my mistake I'm such an idiot :-[

GlobalInt1 is already used for whatever.
I took GlobalInt66 and now it is running like never before  8)

Thank you for your help.