I already did a search on this and it didn't turn anything up that I was looking for.
I was just wondering if there is some way to fill in a text-box, have that information get turned into a variable when you press OK and then be able to pass that on to another script somewhere else in the game?
// global script
int a; // variable
export a; // add "import int a;" to the script header to make it global
// code itself
String n = Game.InputBox("Enter number:");
a=n.AsInt; // convert to int
I hate simple answers. You never see them. ;)
Thanks a bunch, Khris.
EDIT:
I just realized something, this just generates a rudimentary input box. How about calling what is in a text field?
Please don't double post.
And re-read the manual. It sounds like what you want is the TextBox.Text (http://www.adventuregamestudio.co.uk/manual/TextBox.Text.htm) property, e.g.:
String n = txtMyText.Text;
a = n.AsInt;
(Or possibly just a = txtMyText.Text.AsInt; will work.)
Then you'd have to put the code inside the _onClick-function of the OK-button.
Use TextBox.Text to get the number:
// if the textbox's script o-name was "Input"
a = Input.Text.AsInt;
EDIT: Ashen beat me.