Topic:   More help...   (Read 21697 times)


0 Members and 1 Guest are viewing this topic.

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
More help...
« on: August 12, 2008, 07:06:23 PM »
yea me again I can't seem to fix this one. I need this code to go to different level each time you beat a day. (days advance by beating a wave of goblins) for some reason it only goes to day one, even though I don't tell it to and it's susposed to be on another day...

IF day = 1 THEN
GOTOCARD 5
END IF
IF day = 2 THEN
GOTOCARD 6
END IF
IF day = 3 THEN
GOTOCARD 7
END IF
IF day = 4 THEN
GOTOCARD 8
END IF
IF day = 5 THEN
GOTOCARD 9
END IF
IF day = 6 THEN
GOTOCARD 10
END IF
IF day = 7 THEN
GOTOCARD 11
END IF
IF day = 8 THEN
GOTOCARD 12
END IF
IF day = 9 THEN
GOTOCARD 13
END IF
IF day = 10 THEN
GOTOCARD 14
END IF
IF day = 11 THEN
GOTOCARD 15
END IF
IF day = 12 THEN
GOTOCARD 16
END IF
IF day = 13 THEN
GOTOCARD 17
END IF
IF day = 14 THEN
GOTOCARD 18
END IF
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

Mystor


  • GMG-er

  • **


  • Posts: 696

  • I am the myst that consumes us all.
Re: More help...
« Reply #1 on: August 12, 2008, 07:27:56 PM »
Do you actually set day to the next number?

Mist
"I'll lie to him."
"And if that doesn't work?"
"Then I'll tell the truth. We're allowed to do that, in emergencies. We can't plan for everything, you know."
   -Colonel Graff, Ender&

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
Re: More help...
« Reply #2 on: August 12, 2008, 07:36:38 PM »
yea, of course!
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: More help...
« Reply #3 on: August 12, 2008, 08:14:05 PM »
I think the bug may be in the code that counts up the days. Maybe you could post it?


-Gandolf

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
Re: More help...
« Reply #4 on: August 12, 2008, 08:33:10 PM »
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: More help...
« Reply #5 on: August 12, 2008, 08:47:00 PM »
I found no faults in your code that wouldn't allow you to change cards. But, in the "Next" button's code, try changing the last part of the timer to this:

IF counter < 2 THEN
day = day + 1
GOTOCARD 3
END IF

It just might fix it. Though the fight scene will end 1 second early.


-Gandolf

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: More help...
« Reply #6 on: August 12, 2008, 08:52:49 PM »
There is nothing wrong with that code.
on card 5 you have it so it goes to card 3 before it declares day as 3
EDIT: found by, Putting an ALERT on card before code that said ALERT day $day$

Quote
I found no faults in your code that wouldn't allow you to change cards. But, in the "Next" button's code, try changing the last part of the timer to this:

IF counter < 2 THEN
day = day + 1
GOTOCARD 3
END IF

It just might fix it. Though the fight scene will end 1 second early.

It fixed it because day was declared before the GOTOCARD
« Last Edit: August 12, 2008, 08:55:55 PM by Tireas_Dragon »
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
Re: More help...
« Reply #7 on: August 12, 2008, 08:53:05 PM »
I'm not sure how it did, but it fixed it!

thx!
« Last Edit: August 12, 2008, 09:25:38 PM by Gnome_Again »
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: More help...
« Reply #8 on: August 13, 2008, 08:46:30 AM »
I strongly recommend tabbing conditions as well, as it makes code much easier to read. Also Gnome, when an IF THEN command only has 1 event under its condition, you can execute it in the same line like so:

IF day = 1 THEN GOTOCARD whatever
« Last Edit: August 13, 2008, 08:47:02 AM by Silverwind »
I survived the spammage of 2007

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: More help...
« Reply #9 on: August 13, 2008, 10:49:50 AM »
Quote
I strongly recommend tabbing conditions as well, as it makes code much easier to read. Also Gnome, when an IF THEN command only has 1 event under its condition, you can execute it in the same line like so:

IF day = 1 THEN GOTOCARD whatever
I was just about to post that, it saves a LOT of lines of code.  That's important for somebody working with the 15 line limit, like me.   :P

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: More help...
« Reply #10 on: August 16, 2008, 10:12:39 AM »
i could do that in one line

gotocard day