PDA

View Full Version : Ask user for a number into a variable.


Kirbya
10-26-2006, 09:57 AM
Yes I need more help with my final project, this time I want to know if it's possible to make it so when I use the world level function "Ask user for a number" if i can take that input and make into a world level variable that I can use throughout my program.

Kirbya
10-30-2006, 09:36 AM
Anyone know if it's possible? Please?

DrJim
10-30-2006, 08:47 PM
It should be very straightforward:

First create the new variable and define it as a number using the "create new variable" option in the world's property list.

Second, drag it to the place in your program where you first want to use it and give it a dummy value.

Third, go to the world function list and drag the "ask user for a number" function over and replace the dummy value.

Now, when you run the program, a window with "Enter a Number:" (or what ever text you want to use) will appear and the number entered will be available until it gets changed by some other instruction.

Kirbya
10-31-2006, 10:02 AM
What I'm doing now is just testing this.

I have a sphere in the world and I have it moving up "distance" meters. When I drag the "Ask user for a number" onto "distance" meters it just replaces it and when I enter a number it doesn't modify the variable, just moves the sphere up however many meters I enter into the "Enter a number" window. I need it to edit the variable so i can use it later throughout my program.

EDIT: Nevermind I figured it out now.