Game Maker's Garage Forum
Game Creation => GameMaker => Topic started by: Silverwind 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?
-
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.
-
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.
-
Thats what I was thinking just make a unimportant line of code that does nothing.
-
Fixed in 3.9.91