Display a variable, help needed

Non-platform specific questions.

Display a variable, help needed

Postby littlekruser » Thu Apr 12, 2007 9:26 am

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!
littlekruser
 
Posts: 15
Joined: Wed Apr 11, 2007 6:22 am
Score: 0 Give a positive score

step by step for the absolute beginer

Postby pixelpoop » Thu Apr 12, 2007 12:10 pm

-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.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby littlekruser » Fri Apr 13, 2007 12:40 am

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?
littlekruser
 
Posts: 15
Joined: Wed Apr 11, 2007 6:22 am
Score: 0 Give a positive score

Postby makslane » Fri Apr 13, 2007 3:16 am

You can use a timer or put the script in a Draw Actor event.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest