Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Dave Gilbert on Thu 12/05/2005 19:28:15

Title: rundialog and delayed activation
Post by: Dave Gilbert on Thu 12/05/2005 19:28:15
From the manual:

Quote
NOTE: The conversation will not start immediately; instead, it will be run when the current script function finishes executing.

Is there any way around this issue?  My current script has a lot of "runDialogs", and splitting the script up into a dozen dialog_request functions is making it real messy.  Any advice appreciated!

Thanks,

-Dave
Title: Re: rundialog and delayed activation
Post by: Ishmael on Thu 12/05/2005 19:53:15
In the interactions editor you can split your code into two Run Scripts, and have the RunDialog end the first one...
Title: Re: rundialog and delayed activation
Post by: Pumaman on Thu 12/05/2005 23:15:51
If you've got a lot of script interspersed with RunDialogs, might it be easier simply to translate the dialog into DisplaySpeech commands so it's all in the script? Obviously this would kinda defeat the point of the dialog editor if the conversations were complicated though.
Title: Re: rundialog and delayed activation
Post by: Dave Gilbert on Fri 13/05/2005 03:52:06
Well, I decided to break up long dialogs sequences by giving the player dialog OPTIONS at various points.  So there are already a bunch of DisplaySpeech commands (or should I use "Say" commands now?), but at various points I want the player to make a dialog choice, which I have to use the dialog editor and RunDialog for.  So now I have to go and move chunks of the code into the global script and divide it up into various Dialog_Request functions.  I'd really prefer to keep everything in the local room script.  I don't know if there's a neat and clever way to do that, but I'll do it the messy way if there are no other options. :)
Title: Re: rundialog and delayed activation
Post by: Pumaman on Fri 13/05/2005 19:35:39
Ah I see, I don't think there's an easy way of doing that.

Would some sort of  ShowDIalogOptions(int topic)  blocking command be useful, so that you could prompt the user to choose a dialog option directly from the room script?
Title: Re: rundialog and delayed activation
Post by: Dave Gilbert on Fri 13/05/2005 19:40:57
Would that return to the room script once the it is complete?  If so, then it would be very very useful for me. :-D
Title: Re: rundialog and delayed activation
Post by: Stacy Davidson on Mon 07/09/2009 06:43:06
I know this is really old one, but I thought it might be worth asking the question over again, since it's been a few years and I notice this is still in v3:

QuoteNOTE: The conversation will not start immediately; instead, it will be run when the current script function finishes executing.

I was just wondering today why it works this way, and then I ran across this older post.  Is there a reason a function can't pause to run a dialog, then return to the same spot in the script?  As opposed to continuing through the script and then running the dialog afterward?

As it stands, I have just been using indenting to write truck loads of code within each dialog.

Is that the best way to do it, or has this issue been addressed in some way since this message?

Thanks,
-s

Title: Re: rundialog and delayed activation
Post by: Gilbert on Mon 07/09/2009 07:04:48
As far as I know this had not been changed and (as you knew already) the recent addition of the script-in-a-dialogue feature (as opposed to the old run-script method) serves sort of as a work-around.

I'm not sure, but it's probably due to design choice that, dialogues were somewhat implemented differently from other scripts, so it's difficult to make dialogues run in-between a function (probably requires a re-write of a huge amount of codes).

I personally would find this useful also, but am always wondering what should happen, if say, there's a room-change within the dialogue and the current room script got unloaded.
Title: Re: rundialog and delayed activation
Post by: Pumaman on Tue 08/09/2009 18:37:52
The reason for this is that the script engine is not currently re-entrant -- meaning that if you call into the AGS Engine with a command like Dialog.Start(), AGS cannot then call back into the script to run your dialog scripts since it is already running.

This is something that I'd like to address at some point, but for now this still applies.