Game Development Community

In-Game Player Input

by Nick Voloro · in General Discussion · 05/07/2008 (3:33 pm) · 3 replies

Hello, I have done a lot of research on this matter and I can't really find anything on it. When the player arrives at the bank I would like him to type in how much money he wants to deposit. But my problem is I can't find out how to make a gui where the player can input an integer that will be stored as a variable. Any help would be greatly appreciated. Thanks.

About the author


#1
05/08/2008 (6:27 am)
It sounds like you are looking for the gui function "getScriptValue()" or maybe just "getValue()", one of which returns the internal value tied to that gui object (like the text in a textfield).

Have you considered using a scrollbar / slider to get an integer input? It might be easier to get the value from that than from text.
#2
05/08/2008 (1:55 pm)
Is there anyway to get it by text input? Is there any gui out there that is capable of that?
#3
05/08/2008 (2:13 pm)
You probably want to use a GuiTextEditCtrl for inputing text. Torquescript does not have any types so you don't have to worry about "saving their input as an integer".

You can assign the field altCommand in your GuiTextEditCtrl to a function you want executed when "enter" is pressed. There you can use getValue() to get what they have entered.