Page 1 of 1

[Help] When score = 550, create actor

PostPosted: Mon Sep 28, 2009 5:26 pm
by Garfield501
Hello,
I have a new question.

When my score is 550, I want that an actor is created.
I am using the following script. (LOL, I know I don't have to use the script editor, but that's the only way I saw).
Code: Select all
if (score.textNumber = 550)
{
    CreateActor("game_complete", "icon", "(none)", "(none)", 49, 10, true);
}

But the only thing it does, is setting the score to 550 on start-up.

Re: [Help] When score = 550, create actor

PostPosted: Mon Sep 28, 2009 7:16 pm
by Kalladdolf
if(score.textNumber == 550)
You need two equal signs.

Re: [Help] When score = 550, create actor

PostPosted: Mon Sep 28, 2009 7:24 pm
by DST
It is not recommended to use textNumber as a variable, its only for display. You will likely always have problems if you use it that way.

Use a global variable called score, and just use textNumber as a way to display score.

Re: [Help] When score = 550, create actor

PostPosted: Tue Sep 29, 2009 1:46 pm
by Garfield501
DST wrote:It is not recommended to use textNumber as a variable, its only for display. You will likely always have problems if you use it that way.

Use a global variable called score, and just use textNumber as a way to display score.

Okay, thanks for the information.
I'll keep this in mind for my real games. (this is just for trying).

Kalladdolf wrote:if(score.textNumber == 550)
You need two equal signs.

Can you explain me why I need to use two "="?
I would like to know that, cause I want to be a game programmer and everything I know about programming in Game-Editor is an advantage.
(I gotta start somewhere, right???)