Page 1 of 1

Display a variable, help needed

PostPosted: Thu Apr 12, 2007 9:26 am
by littlekruser
I'm a complete noob at this and that's y I'm using GE :P. I want to display a variable some how and don't understand how. If some1 would be nice enough to give me a step by step how to I would greatly appreciate it!

step by step for the absolute beginer

PostPosted: Thu Apr 12, 2007 12:10 pm
by pixelpoop
-click on the Add actor button in the top menu. now name it in the box that comes up and click OK.

-if you don't have the Actor Control window open then right click on your actor and then click Actor Control

-in the Actor Control menu click on "Text". in the Set Text menu window enter a bunch of zeros (0000000).

-now click on the New Font button and then on the True Type button.

-now brows to a .ttf file, then set the color to something other then your back ground and set the size. now click OK and then OK in the Set Text menu.

-your packmanish figure is now a bunch of zeros

-in the actor control menu click on Add, then click on the Key Down option. now enter a key you want to use for the activation of this event. I chose the space bar.

-now click Add Action, and select Script Editor from the drop down menu.
copy and paste this


Code: Select all
//makes an integer variable called i and then makes it equal 20.
int i;
i=20;

textNumber=i;
//sets the zeros to equal i;

//if you want to set this actor's text from another
//actor then you would type    actorname.textNumber=i;


-now click on Ok and then on Imediate action
-now at the top click on Game Mode and press your activation key(space bar) to make the text equal 20.

PostPosted: Fri Apr 13, 2007 12:40 am
by littlekruser
ok, thanks alot. But I have a variable that I want to show called hunger that goes down by 1. How do I get it so that it's updated periodically instead of on a keydown event?

PostPosted: Fri Apr 13, 2007 3:16 am
by makslane
You can use a timer or put the script in a Draw Actor event.