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
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!
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:
{
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!