Topic:   Old glitch in GM resurfaced...   (Read 20766 times)


0 Members and 1 Guest are viewing this topic.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Old glitch in GM resurfaced...
« on: April 08, 2008, 04:35:27 AM »
Looks like the that glitch that hampered progress on Gridz has resurfaced. The command line under a repeat block doesn't get read if there's too much code in the card script. I've highlighted the line that doesn't get read:


CLEAR TEXT
PICT enemypict

'     Don't change this code. It only activates when the player enters this card from outside of battle.

IF battlelock = 0 THEN
 Â battlelock = 1
 Â MOVIE 0 0 Data:Encounter.wav
 Â SPRITE 17 -500 -500 Data:Enemy Attack Marker.gif
 Â SPRITE 16 -500 -500 Data:Enemy Attack Marker.gif
 Â markerX = 50
 Â markerY = 226
 Â selectedbutton = 1
 Â SPRITE 2 140 225 Buttons.gif
 Â SPRITE 1 markerX markerY Marker.gif
 Â BplayerY = 93
 Â BplayerX = -39
 Â BenemyY = 93
 Â BenemyX = 313
 Â SPRITE 15 BplayerX BplayerY $playersprite$$
 Â SPRITE 14 BenemyX BenemyY $NPCsprite$$
 Â REPEAT 33
 Â   BplayerX = BplayerX + 4
 Â   BenemyX = BenemyX - 4
 Â   SPRITE 15 BplayerX BplayerY
 Â   SPRITE 14 BenemyX BenemyY
 Â END REPEAT

 Â test = 0

 Â playerhitalert = 0
 Â playermissalert = 0
 Â healalert = 0
 Â nopotionsalert = 0
 Â escapealert = 0
 Â enemyhitalert = 0
 Â enemymissalert = 0
 Â IF bossbattle = 1 THEN
 Â   MOVIE 0 0 Data:Boss Battle Music.mp3
 Â   LOOP MOVIE
 Â ELSE
 Â   MOVIE 0 0 Data:Battle Music.mp3
 Â   LOOP MOVIE
 Â END IF
END IF
'------------------------------------------------------------------------------------------------
SPRITE 15 BplayerX BplayerY
SPRITE 14 BenemyX BenemyY
SPRITE 2 140 225
SPRITE 1 markerX markerY

CLEAR TEXT
PRINT $playername$$ HP: $playerHP$
PRINT $enemyname$$ HP: $enemyHP$
PRINT
IF playerhitalert = 1 THEN PRINT You hit the enemy for $playerhit$ damage!
IF playermissalert = 1 THEN PRINT Your attack misses the enemy.
IF healalert = 1 THEN PRINT You restore $healamount$ HP. You have $ITEMhealingpotion$ Potions left.
IF nopotionsalert = 1 THEN PRINT You don't have any Potions.
IF escapealert = 1 THEN PRINT You couldn't escape...
IF enemyhitalert = 1 THEN PRINT The enemy hits you for $enemyhit$ damage!
IF enemymissalert = 1 THEN PRINT The enemy's attack misses you.
PRINT

playerhitalert = 0
playermissalert = 0
healalert = 0
nopotionsalert = 0
escapealert = 0
enemyhitalert = 0
enemymissalert = 0

ON TIMER 25
 Â IF blinkmarker = 0 THEN
 Â   blinkmarker = 1
 Â   markerX = markerX + 10
 Â   SPRITE 1 markerX markerY
 Â ELSE
 Â   blinkmarker = 0
 Â   markerX = markerX - 10
 Â   SPRITE 1 markerX markerY
 Â END IF
END TIMER

ON KEYDOWN
 Â upmove = 0
 Â downmove = 0
 Â IF selectedbutton = 1 THEN upmove = 1
 Â IF selectedbutton = 3 THEN downmove = 1

 Â IF keydown$ = "UPARROW" THEN
 Â   IF upmove = 0 THEN
 Â     selectedbutton = selectedbutton - 1
 Â     IF selectedbutton < 1 THEN selectedbutton = 1
 Â     markerY = markerY - 29
 Â     SPRITE 1 markerX markerY
 Â   END IF
 Â END IF
 Â IF keydown$ = "DOWNARROW" THEN
 Â   IF downmove = 0 THEN
 Â     selectedbutton = selectedbutton + 1
 Â     IF selectedbutton > 3 THEN selectedbutton = 3
 Â     markerY = markerY + 29
 Â     SPRITE 1 markerX markerY
 Â   END IF
 Â END IF

 Â IF keydown$ = "a" THEN
 Â   IF selectedbutton = 1 THEN GOTOCARD 16
 Â   IF selectedbutton = 2 THEN GOTOCARD 15
 Â   IF selectedbutton = 3 THEN GOTOCARD 14
 Â END IF
END KEYDOWN


This is the card script of the player's turn in battle.

EDIT:

It's just occurred to me that the glitch may have returned due to a change Al made in 3.9.9a, which I don't think Al has released yet. Could someone test it in 3.9.9?
« Last Edit: April 08, 2008, 04:37:28 AM by Silverwind »
I survived the spammage of 2007

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: Old glitch in GM resurfaced...
« Reply #1 on: April 10, 2008, 10:47:01 AM »
I will look into this. It may be that a certain combination of IF THENs and ON event blocks still cause the bug. Thanks for letting me know.


Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: Old glitch in GM resurfaced...
« Reply #2 on: July 01, 2008, 02:23:23 PM »
I had some time to look at this some more. Even if there's only a simple REPEAT loop in the script and nothing else it still fails to run the line after END REPEAT. I'll try to see why this is happening and get it fixed. For now the easy work around is to leave a blank line after END REPEAT. This simple code shows the bug.

PRINT OK. Let's see what happens.
REPEAT 2
  PRINT In ;
  PRINT Repeat
END REPEAT
PRINT Should print this, but doesn't. Leave a blank line here.
PRINT This is 2nd line after END REPEAT.




Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Old glitch in GM resurfaced...
« Reply #3 on: July 01, 2008, 03:18:54 PM »
Thats what I was thinking just make a unimportant line of code that does nothing.
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.

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: Old glitch in GM resurfaced...
« Reply #4 on: August 22, 2008, 04:53:32 AM »
Fixed in 3.9.91