Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - graysond

#1
Hello!

I have created a custom gui with a text box, and I know how to use the "OnActivate" event. But here's a use case I can't figure out:

I would like a character to say some dialogue, then the player to provide a text input while the script waits for this input, then the character to respond to that input.

The problem I run into is that if I call the gui with the text box, the script continues to run. I would like the game to wait until an OnActivate event is called.

As an example:

Code: ags
{
cRoger.Say("What would you like for breakfast?");
// A custom gui pops up with a text box. The script does not continue until the player enters text and that text is stored as string via OnActivate.
cRoger.Say("[TOAST], eh? I can do that.");
}

Another scenario might be: A character asks the player "What's your name?", the player is prompted to give a name, then the conversation continues.

The default Game.InputBox seems to work like this normally, as if it's calling a special wait function, but I don't know how to achieve the same behavior with a custom gui.

I have found some workarounds for my specific use case but they are inefficient. But that said, because I have something that works I am mostly interested in the "best" way to do this rather than other workarounds.

Thanks in advance!
#2
Hi everybody! This is a new account but the forums (and Discord) have been invaluable for me in learning AGS. I am excited to share my game!

KIDNAME: ICEBOY

Download on itch.io!

Screenshots below! And two vods already online:

DecafJedi: https://www.youtube.com/watch?v=OYIorMQC-dY&t
Retrograde Tom: https://www.youtube.com/watch?v=5cvkF3T5l7E

QuoteKIDNAME: ICEBOY is a fan-made prequel to the legendary Sierra On-Line title CODENAME: ICEMAN. The prequel follows patriotic child JW as he embarks on the adventure of his young lifetime--a trip to the US Navy's new Submarine Camp program!





SMF spam blocked by CleanTalk