[HELP] - How to make textNumber to "if" - [Possoble or not?]

Talk about making games.

[HELP] - How to make textNumber to "if" - [Possoble or not?]

Postby bat78 » Mon May 14, 2012 4:30 pm

Hello developers ..long days ago i try to make sth like that:
if (score.textNumber==500) {
DestroyActor("EventActor");
}

But it is no results.. if have another way .. maybe with Global Code - Defines or includes or variables..idk. Help me :cry:
reson.png
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby SuperSonic » Mon May 14, 2012 7:12 pm

I'm not quite sure what your problem is :|
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby bat78 » Mon May 14, 2012 7:18 pm

it cant be -
The script cant make that effect that need..
Ok lets get 1 Normal Actor named - Actor
Lets make him a text - 0000
lets make sth like that:
KeyDown-->"SPACE" (REPEAT) -->Script Editor:
Actor.textNumber=Actor.textNumber+1;

And for now all is ok but:

VIEW-->Draw Actor: if (Actor.textNumber==50) {
ExitGame();
}

But that does not take effect :)
So we press "space" to up the 0000 to 0050 but then..the game do not exit..now can u understand ? :P
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby skydereign » Mon May 14, 2012 10:13 pm

Don't use textNumber like that. It isn't a normal variable and should not be used like one. Instead, create a separate variable for score, and use that. It should work if you use the same setup, but instead of Actor.textNumber you just use score. Another thing, you might want to use >= instead of just ==, since if you get to 51, that if statement won't trigger.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby bat78 » Mon May 14, 2012 10:14 pm

what's the code? i cant understand what u mean.. :oops:
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby skydereign » Mon May 14, 2012 10:17 pm

By what you said it sounds like you already know how to declare variables. So, declare a variable called score (or whatever you want to call it).
skydereign wrote:It should work if you use the same setup, but instead of Actor.textNumber you just use score.

The code you should be able to figure out from my post.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby bat78 » Mon May 14, 2012 10:21 pm

[*]instead of Actor.textNumber you just use score.

So well: score(var).textNumber ?
thats variable need to define sth function..how then..
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby skydereign » Mon May 14, 2012 10:25 pm

No... I said to replace Actor.textNumber with the variable name (score).
view -> Key Down Space -> Script Editor
Code: Select all
score=score+1;

view -> Draw Actor -> Script Editor
Code: Select all
if(score==50)
{
    ExitGame();
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: [HELP] - How to make textNumber to "if" - [Possoble or n

Postby bat78 » Mon May 14, 2012 10:29 pm

i know what u mean now..very clever :D
thank u +1
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest