problem whit variable

Non-platform specific questions.

problem whit variable

Postby qwertiope31 » Fri Jul 10, 2009 3:33 pm

my actor cant die

I create an actor player an actor enemy and a variable hp
I put this scipt

scipt editor: player -> create actor
int hp = 7;

script editor: player -> collision (any side of enemy)
hp = hp - 7;
if (hp=0)
{

DestroyActor("vie");
DestroyActor("vie");

}
qwertiope31
 
Posts: 5
Joined: Wed Apr 01, 2009 9:55 pm
Score: 0 Give a positive score

Re: problem whit variable

Postby Kalladdolf » Fri Jul 10, 2009 3:38 pm

qwertiope31 wrote:if (hp=0)

You need to write:
Code: Select all
if(hp == 0)
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: problem whit variable

Postby qwertiope31 » Fri Jul 10, 2009 4:15 pm

ok tanks
qwertiope31
 
Posts: 5
Joined: Wed Apr 01, 2009 9:55 pm
Score: 0 Give a positive score

Re: problem whit variable

Postby qwertiope31 » Fri Jul 10, 2009 4:20 pm

dont work
qwertiope31
 
Posts: 5
Joined: Wed Apr 01, 2009 9:55 pm
Score: 0 Give a positive score

Re: problem whit variable

Postby qwertiope31 » Fri Jul 10, 2009 4:27 pm

script editor: collision -> (any side of enemy)
hp = hp - 7;
if (hp == 0)
{

DestroyActor("player");
DestroyActor("player");

}



scipt editor: player -> create actor
int hp = 7;

and I have my actor player and enemy and my variable hp what is the problem
qwertiope31
 
Posts: 5
Joined: Wed Apr 01, 2009 9:55 pm
Score: 0 Give a positive score

Re: problem whit variable

Postby jimmynewguy » Fri Jul 10, 2009 4:28 pm

ummm idk try
if(hp<=0)
and make sure it's an actor variable
and make sure the actor is spelled right
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: problem whit variable

Postby Kalladdolf » Fri Jul 10, 2009 4:29 pm

Try one more thing: On "Create Actor" just put "hp = 7;"
And create a hp variable with the tools provided by Game Editor.
In order to do so, hit the "Variables" button in the script editor.
Then click "Add". Name it and make it an actor variable.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: problem whit variable

Postby qwertiope31 » Fri Jul 10, 2009 4:38 pm

that work tanks
qwertiope31
 
Posts: 5
Joined: Wed Apr 01, 2009 9:55 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron