quick question

Game Editor comments and discussion.

Re: quick question

Postby skydereign » Thu Dec 22, 2011 3:01 am

The redeclaration error means that you have the variable already declared somewhere else. Remove the extra and it should work. And what do you mean by work so well with pong? Pretty much no one but krenisis would suggest using textNumber like that, and the only reason he would was he couldn't figure out variables. textNumber isn't guaranteed to work like that, it is only meant for displaying, therefore it might work if you do math with it, but it also may not. Since there is any chance of it not working, avoid it by doing the right thing.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: quick question

Postby SuperSonic » Thu Dec 22, 2011 6:45 am

@NOH: The reason the error message appears is that you already have an actor named M_punch_number. Try naming the int M_punch_number_var. That should work :D

Oh, and thank you for the point :P
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: quick question

Postby NightOfHorror » Thu Dec 22, 2011 4:23 pm

In the code am I supposed to have the variable or the actor in the code.
viewtopic.php?f=2&t=12136
"I have not failed. I just found 10,000 ways that wont work." quoted by Thomas Edison.
Over the year, I decided my motto for me is I am knowledgeable, but not practical.
User avatar
NightOfHorror
 
Posts: 1823
Joined: Fri Aug 27, 2010 2:50 am
Location: Cedar Hill, MO, of the USA
Score: 51 Give a positive score

Re: quick question

Postby SuperSonic » Thu Dec 22, 2011 7:56 pm

NightOfHorror wrote:In the code am I supposed to have the variable or the actor in the code.

NightOfHorror wrote:and supersonic, each time I put in int M_punch_number=2;, it says "redeclaration of parameter "M_punch_number"".

All you have to do is change "int M_punch_number=2;" to "int M_punch_number_var=2" :wink:
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: quick question

Postby NightOfHorror » Fri Dec 23, 2011 1:55 am

I did all of this and when I click nothing happens.
viewtopic.php?f=2&t=12136
"I have not failed. I just found 10,000 ways that wont work." quoted by Thomas Edison.
Over the year, I decided my motto for me is I am knowledgeable, but not practical.
User avatar
NightOfHorror
 
Posts: 1823
Joined: Fri Aug 27, 2010 2:50 am
Location: Cedar Hill, MO, of the USA
Score: 51 Give a positive score

Re: quick question

Postby skydereign » Fri Dec 23, 2011 2:03 am

This is why you need to understand what the other person is suggesting. If you can't understand what the person is suggesting, or why it should fix your problem, then you won't be able to debug it. But, with things like this, it is much harder for us to figure out what you aren't doing correctly than it would be for you. All the fix is is to create a variable, and use it properly (in your case reduce it by one and also to display it). I believe you have the capacity to figure that out. The error that you were experiencing was due to you declaring a duplicate variable, all you would have to do is remove one of the two decelerations. And, then you have your variable, and can use it properly.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: quick question

Postby SuperSonic » Fri Dec 23, 2011 5:24 am

Make sure that on your click event, you have this:
Code: Select all
M_punch_number_var -= 1;

:D
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: quick question

Postby NightOfHorror » Fri Dec 23, 2011 10:58 pm

Guys, you wont care, but to me, its my hugest jump in GE. That is figuring out and correcting the problem by myself. It was the code textNumber=M_punch_number_variable;. I knew I had to somehow had to make the actor=variable, but couldn't do that because it would create error. All I had to do was put M_punch_number.textNumber=M_punch_number_variable.

Thanks Supersonic by the way. :D
viewtopic.php?f=2&t=12136
"I have not failed. I just found 10,000 ways that wont work." quoted by Thomas Edison.
Over the year, I decided my motto for me is I am knowledgeable, but not practical.
User avatar
NightOfHorror
 
Posts: 1823
Joined: Fri Aug 27, 2010 2:50 am
Location: Cedar Hill, MO, of the USA
Score: 51 Give a positive score

Re: quick question

Postby SuperSonic » Sat Dec 24, 2011 2:28 am

You're welcome. I'm glad I could help you. Keep learning man :wink:
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

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest