Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Joseph on Thu 08/07/2010 18:55:09

Title: How to tell when stop is run ina dialogue???
Post by: Joseph on Thu 08/07/2010 18:55:09
Hola IM back    ;D ;D ;D once again but with a VeNGence

is there a way to find out when the stop has been run in a dialogue? I have a code i wrote that i want to run each time stop is run inside a dialog but i dont want to retype that code evertime in each dialogue when you want it to stop.

I woudl place this inside my repeatedlty_execute of course, (like, check if "stop" has run in a dialogue, if "yes", do this code)

ps: http://www.poopreport.com/BMnewswire/972.html
Title: Re: How to tell when stop is run ina dialogue???
Post by: Calin Leafshade on Thu 08/07/2010 18:59:27
Set a bool to true everytime you run stop, then check for that bool in rep_ex and set it back to false if its true.

so like this:

In dialogue:

  flag = true
stop


then in rep_ex:

if (flag) {
    flag = false;
    //Do your other stuff here.
}
Title: Re: How to tell when stop is run ina dialogue???
Post by: Joseph on Thu 08/07/2010 20:15:38
Is tehre a way I can do it without adding a bool everytime I run stop? Id rather not have to add anything at all in the dialog scripts...just somehow have it so repeatly execute "sees" when stop has been run  (is there a hardcoded script inisde AGs that says when"Stop" is proccesed?

Ifno t I can do your way with a bool no problemo  :=
Title: Re: How to tell when stop is run ina dialogue???
Post by: Mazoliin on Thu 08/07/2010 20:41:19
You could replace the stop with a run-script command, and use StopDialog() (http://www.adventuregamestudio.co.uk/manual/StopDialog.htm) in the dialog_request function.
Title: Re: How to tell when stop is run ina dialogue???
Post by: Khris on Thu 08/07/2010 21:25:07
Or just use this:

void Stop() {
  flag = true;
  StopDialog();
}


Then use " Stop();" instead of "stop".
Title: Re: How to tell when stop is run ina dialogue???
Post by: Mazoliin on Thu 08/07/2010 21:40:19
Why I used a run-script instead of a custom function was due to this line in the manual:

"This command can only be used from within the dialog_request function"

but if this is incorrect, a custom function is a much better solution.
Title: Re: How to tell when stop is run ina dialogue???
Post by: Khris on Thu 08/07/2010 22:43:04
Oh, right, didn't know that. It might still work as long as a dialog is running. Otherwise, never mind my post.
Title: Re: How to tell when stop is run ina dialogue???
Post by: Calin Leafshade on Fri 09/07/2010 00:55:22
For christ's sake Khris. Read the fucking manual.... n00b..
Title: Re: How to tell when stop is run ina dialogue???
Post by: Dualnames on Fri 09/07/2010 00:59:03
Quote from: Calin Leafshade on Fri 09/07/2010 00:55:22
For christ's sake Khris. Read the fucking manual.... n00b..

I see Death coming at you Calin. Khris f$%@ him up. ;)

*Bets on Khris*
Title: Re: How to tell when stop is run ina dialogue???
Post by: Khris on Fri 09/07/2010 09:16:00
Hehe, walked into my own trap there, eh?

Well, I tested it, and indeed it doesn't work. I'll be in the corner of shame, if anyone needs me ;)