• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help with "if instance is aligned with grid" function GM 1.4

B

BlackAxxe

Guest
Hi,

Thanks for taking the time to read this post. It is my first and I am just now starting my work on Gamemaker 1.4.

Firstly, I am trying to create a very basic Tetris clone to get to grips with the system. So far I have falling blocks that stop when touching the bottom or other blocks. Started trying to create a "Line Deleter" object for when all blocks are aligned on the grid in a line (you've played Tetris)

The object exists just outside of the playable room but when attempting to launch the game i get the following error,

"
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Other Event: Game Start
for object line_deleter_object:

local variable __b__(100001, -2147483648) not set before reading it.
at gml_Object_line_deleter_object_StartGameEvent_1 (line 7) - if __b__
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_line_deleter_object_StartGameEvent_1 (line 7)

"

For the object "line_deleter_object" I have set up a Step that has 21 lines of "if instance is aligned with grid" and the grid coordinates that the blocks fall into, along with 21 lines of "destroy instances at a position" of the block.

I have attached screenshots showing the object properties of the line deleter object, if anyone can give me any indication as to if I am using the correct "event" and if my actions are appropriate for what I am trying to achieve. I'm sure there would have been some simple code to greatly simplify what I am trying to achieve but I'm not a coder and want to get to grips with gamemakers drag and drop style.

Thanks very much in advance

LINKS TO IMAGES - https://imgur.com/a/sElVuVY
 

TheouAegis

Member
The error is in the Game Start event. It is saying you never set __b__ in the Create Event or that you declared __b__ as a temporary variable. You sure that was the right object you copied code from?

Tryclicking the dustpan icon at the top of GM, save yout project, close it, then reopen it.
 
B

BlackAxxe

Guest
The error is in the Game Start event. It is saying you never set __b__ in the Create Event or that you declared __b__ as a temporary variable. You sure that was the right object you copied code from?

Tryclicking the dustpan icon at the top of GM, save yout project, close it, then reopen it.
Hi TheouAegis, thanks for the reply. The code was copied from the error message when attempting to launch the project. Ill give your suggestion a go and report back, thanks!
 
Top