Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sylvr on Tue 12/09/2006 01:04:19

Title: Having to talk to a character twice
Post by: Sylvr on Tue 12/09/2006 01:04:19
Hi... I've come across another problem (but on the plus side my game is nearly complete, so you'll be hearing from me less :P...). Anyway, here it is:

There is one character that I have to talk to twice in order to retrieve the item. From the interaction panel point of view, everything looks okay...

(http://i8.photobucket.com/albums/a33/trumpet_nerd/trouble.jpg)

I guess I should throw in the scripts too, if that would help...
Title: Re: Having to talk to a character twice
Post by: alimpo83 on Tue 12/09/2006 01:27:37
I think you sould make just ONE dialog to that character. After the first dialog talk you would make a script telling to turn on a dialog option that you could click the second time you talk to him, then he would give you the object. I hope I explained myself right ;D
Title: Re: Having to talk to a character twice
Post by: Sylvr on Tue 12/09/2006 01:31:39
Yeah, it's a good idea. I could... But I would like to keep it constant with the other characters, whom it seems to work for. The fact is that what I have now doesn't work, oddly enough. Thank you!  :)
Title: Re: Having to talk to a character twice
Post by: Ashen on Tue 12/09/2006 01:34:41
QuoteI guess I should throw in the scripts too, if that would help...

It probably would ... From what you've shown, it should work OK, so it must be something in one of those 'Run script's. Or possibly the dialogue scripts. Just to clarify - do you WANT to have to talk to him twice (which alimpo's suggestion would solve), or is the problem THAT you have to talk to him twice?

Why do you have so many 'Run script's, by the way? I'd guess to have RunDialogs running in the right order, but I'm not sure why you'd need SO MANY dialogues.
Title: Re: Having to talk to a character twice
Post by: Sylvr on Tue 12/09/2006 01:47:27
My RunScripts Say:

1)dKurtis.Start(); 
2)DisplayMessage(509);
3)dKurtisEnd.Start(); 
4)cMan.AddInventory(inventory[5]);
   object[0].Visible = false ;
 
And then

5) Add Score on First Execution (1)

And all of that comes after the conditional, which is now working fine.  I tried to combine all the scripts into one before I posted, because I really don't need that many, and I got this error message when I tried to test:

"Runtime Error: Unexpected eof"

So that's 2 problems. Tell me if I'm not being specific enough.
Title: Re: Having to talk to a character twice
Post by: Ashen on Tue 12/09/2006 02:00:56
2 and 3 could probably be combined easily enough.
Why do you need the 2 dialogues? If it's just to have the DisplayMessage in there, you could add it in to the dialogue itself, either by having the 'narrator' character say it, or by using dialog_request (BFAQ Link (http://americangirlscouts.org/agswiki/index.php/Scripting%2C_Code_%26_Interaction#Running_regular_code_inside_dialog)) to add normal code to the dialogue. You could also use the second method to replace the 4th 'Run script', and have the item/object taken care of by the dialogue script.

What exactly was the error when you tried combining them? The 'unexpected eof' sounds like you might have missed out a bracket, or a semi-colon, or something, somewhere when you were moving the code around. Try it again, and see if you have the same problem - if so, post the combined script and see if someone can spot the problem.
Title: Re: Having to talk to a character twice
Post by: Sylvr on Tue 12/09/2006 02:06:01
Here is the combined script (comes before 'Add Score'):

dKurtis.Start(); 
DisplayMessage(509);
dKurtisEnd.Start(); 
cMan.AddInventory(inventory[5]);
object[0].Visible = false;

I still got the error, and I was sure to copy paste it from the very original...
Title: Re: Having to talk to a character twice
Post by: Sylvr on Tue 12/09/2006 23:39:26
Well... turns out the problem solved itself. (I hope this won't be shot for double-posting...) In my frustration with not being able to figure out the script error, I left without saving (as we're forced to do). Today when I checked it out it seemed to be fine. But I still would like to know what the problem is if someone can figure it out. ???