quick question

Game Editor comments and discussion.

quick question

Postby NightOfHorror » Thu Dec 22, 2011 12:12 am

why is my 2 going to 0 when I click on an actor to make it change
the code was
actorsName.textNumber=actorsName.textNumber-1;
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 Hblade » Thu Dec 22, 2011 12:13 am

Are you using 2 cloned actors? I had a similar issue, both actors take the 1 actors event, causing it to double the variable change.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: quick question

Postby NightOfHorror » Thu Dec 22, 2011 12:18 am

no.
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 Hblade » Thu Dec 22, 2011 12:22 am

hmm, strange then o-o I know your pain though, having a problem you can't figure out. it's aggravating huh?
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: quick question

Postby SuperSonic » Thu Dec 22, 2011 12:23 am

Could you upload your ged? :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 » Thu Dec 22, 2011 12:29 am

here you go. I will only wait five minutes and then I will delete the file


DELETED FILE
Last edited by NightOfHorror on Thu Dec 22, 2011 12:35 am, edited 1 time in total.
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 Hblade » Thu Dec 22, 2011 12:29 am

Lol night is mad. poor guy, I know how he feels T.T
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: quick question

Postby NightOfHorror » Thu Dec 22, 2011 12:39 am

HBlade, can you delete this topic now
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 12:43 am

Ok, I fixed it! :mrgreen:

First, you have to create an integer in your global code like this:
Code: Select all
int PunchNumber = 2;

Next, on punch, edit the mouse button down event and put:
Code: Select all
PunchNumber -= 2;

And finally, add a draw actor event to M_punch_number and put:
Code: Select all
textNumber = PunchNumber;


And it will work :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 Hblade » Thu Dec 22, 2011 12:54 am

NightOfHorror wrote:why is my 2 going to 0 when I click on an actor to make it change
the code was
actorsName.textNumber=actorsName.textNumber-1;

Try changing 1 to .5. It's doubling for some reason, double of .5 is 1, so you should get your 1 result. Otherwise add a double and use that as .5 and then yeah xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: quick question

Postby NightOfHorror » Thu Dec 22, 2011 1:02 am

well sonic, and H thanks. +1s
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 NightOfHorror » Thu Dec 22, 2011 1:14 am

H, your code made the number be .5, and supersonic, each time I put in int M_punch_number=2;, it says "redeclaration of parameter "M_punch_number"".
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 Hblade » Thu Dec 22, 2011 1:23 am

Weeeird o-o

try .25
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: quick question

Postby skydereign » Thu Dec 22, 2011 1:24 am

This is why you shouldn't do math with textNumers. Only use textNumber as a means of displaying, like in SuperSonic's fix.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: quick question

Postby NightOfHorror » Thu Dec 22, 2011 2:45 am

why does it work so well with pong. Also, why does the message in Sonic's code appear when I try to do it.
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

Next

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest