TEXT OBJECT ISSUES

Non-platform specific questions.

TEXT OBJECT ISSUES

Postby d-soldier » Sat May 26, 2007 3:15 pm

I noticed that the behavior of my Lives-Meter (text object) was not working correctly. It was not displaying the correct number of lives after the player died. I checked my code but everything looked right, and worked fine in my previous game..

if(text_lives.textNumber>0)
{
text_lives.textNumber -= 1;
CreateTimer("Event Actor", "1second", 1000);
}
else if(text_lives.textNumber==0)
{
DestroyActor("player");
speed = 0;
CreateActor("gameover", "gameover_00000", "(none)", "(none)", 0, 0, true);
PlaySound2("data/wav_hitmetal.wav", 1.000000, 1, 0.000000);;

}

So I thought about what I had changed, and I realized that after accidently hitting shift, all keyboard keydowns started appearing in my score text-object, so I went through and changed all my textobjects to "NO" for TEXT INPUT. Once I changed it back to yes, the correct number started appearing for the player's lives... Not sure why the TEXT INPUT option would affect the displayed number, but it seemed to multiply it by 2...
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby makslane » Sat May 26, 2007 3:35 pm

Can you send me a little game with the problem?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: TEXT OBJECT ISSUES

Postby marcusr » Sat Jun 23, 2007 4:23 pm

d-soldier wrote:
So I thought about what I had changed, and I realized that after accidently hitting shift, all keyboard keydowns started appearing in my score text-object, so I went through and changed all my textobjects to "NO" for TEXT INPUT. Once I changed it back to yes, the correct number started appearing for the player's lives... Not sure why the TEXT INPUT option would affect the displayed number, but it seemed to multiply it by 2...


I have a similar problem. When I have a text actor set to NO for input, it doesn't always display the new value when I set it using textNumber=123
If I set it to YES, it does always accept the new number. I want it not to be a text input, but just a display. Let me know if a game sample would help
marcusr
 
Posts: 6
Joined: Fri Aug 04, 2006 6:12 pm
Score: 0 Give a positive score

Postby d-soldier » Sat Jun 23, 2007 9:09 pm

Makslane solved this problem for me a while back... keep the text-input to "no" and in the create-actor event give it a strating number... such as:
udi_level.textNumber=01;

Not sure why this fixes it, but i think he said the text object needed to be initialized or somthing in the create-actor event... obviously you'll need to adjust that code to the name of your text actor... let me know if that solved it.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest