Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: TheVolumeRemote on Sun 31/01/2021 22:47:26

Title: Variable to check if dialog has been run (do nothing if it has been run)
Post by: TheVolumeRemote on Sun 31/01/2021 22:47:26
I need to remove the option to talk to a character after talking to the character once. So basically I don’t want the player to able to talk to the character again after their dialog has been run.

I had used option-off-forever but as I’m sure you know that just causes a crash when you try to talk to the character a second time. I’d like it so if you try to talk a second time the game returns nothing, no dialog, no message etc.

Thank you for any help, I couldn’t find anything on disabling dialog after it’s been run but my apologies if this has been covered :)
Title: Re: Variable to check if dialog has been run (do nothing if it has been run)
Post by: Khris on Mon 01/02/2021 01:02:40
You can solve this with Game.DoOnceOnly() (https://www.adventuregamestudio.co.uk/manual/ags53.htm#Game.DoOnceOnly).
Title: Re: Variable to check if dialog has been run (do nothing if it has been run)
Post by: TheVolumeRemote on Mon 01/02/2021 02:36:56
Ah hidden in plain sight. Thank you Khris! I need to curb my tendency to look for overly specific solutions and recall what works for all.
I appreciate you mate!
Title: Re: Variable to check if dialog has been run (do nothing if it has been run)
Post by: Khris on Mon 01/02/2021 08:31:27
Quote from: TheVolumeRemote on Mon 01/02/2021 02:36:56I need to curb my tendency to look for overly specific solutions
That's easier said than done, as I know from many years of personal experience :-D
Anyway, you're welcome :)