Page 1 of 1

TEXT OBJECT ISSUES

PostPosted: Sat May 26, 2007 3:15 pm
by d-soldier
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...

PostPosted: Sat May 26, 2007 3:35 pm
by makslane
Can you send me a little game with the problem?

Re: TEXT OBJECT ISSUES

PostPosted: Sat Jun 23, 2007 4:23 pm
by marcusr
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

PostPosted: Sat Jun 23, 2007 9:09 pm
by d-soldier
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.