• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 apparent bugs in newest version

V

VampireJesus

Guest
So I downloaded the newest version last night, and have experienced a few bugs... IDE Version 2.0.2.44, Runtime 2.0.1.27

The first is with the debugger. All of my user defined variables are displaying as <unknown>
debugger.png
Built in variables display correctly. This makes tracking what's happening a little more difficult

Secondly, and I don't know if this is strictly with the newest version... I trying to find a problem in my code, and so I had commented out the statements in my draw event (since it was crashing there). I then set a break point in the create event of the same object. But when I tried to reset the program, it seemed to skip over the create event altogether. So, then I went back and put a break point in my controller object, which creates my other objects, so I could watch what was happening. When, and only when, I did this, I was able to see that it did go through the create event, but the source view in the debugger would show the draw event for that object. Meanwhile, I could see in the instance pane that variables were being set, but I couldn't follow along. So, as a test, I went and completely deleted the draw event (since I wasn't using it at the moment anyway, and it only had one statement). After that, I could properly watch the code progress through the create event.

Third, when I was having the problem of the variables not displaying properly in the debugger, I went back to a project I had started a few days ago, and hadn't touched to see if the problem existed there. And, the last time I had worked on this older project (which was before updating), it did not have any compile errors, but when I launched it today, it had issues.

So, this is a section of my controller object's create event:
Code:
global.grid2 = 16;	//tile size
global.grid1 = 8;	//subtile size

global.wrap_x = true;
global.wrap_y = true;

chunk_size = 8;	//number of tiles in a chunk
chunk_w	= room_width div (chunk_size * global.grid2);
chunk_h = room_height div (chunk_size * global.grid2);

if global.wrap_x chunk_w += 2;
if global.wrap_y chunk_h += 2;

load_radius = 1;

chunk_grid = ds_grid_create(chunk_w,chunk_h);
ds_grid_set_region(chunk_grid,0,0,chunk_w,chunk_h,noone);
And here's a section of the Step event:
Code:
chunk_x = obj_player.x div (chunk_size * global.grid2);
chunk_y = obj_player.y div (chunk_size * global.grid2);

if global.wrap_x chunk_x += 1;
if global.wrap_y chunk_y += 1;

for (j = chunk_y - (load_radius * (chunk_y > 0)); j <= chunk_y + (load_radius * ((chunk_y + load_radius) < chunk_h)); j++) {
	for (i = chunk_x - (load_radius * (chunk_x > 0)); i <= chunk_x + (load_radius * ((chunk_x + load_radius) < chunk_w)); i++) {
So, in the create event you can see I have a variable called load_radius. And, in the for loop in my step event, I refer to said variable. Only, suddenly, it's reading it like a local variable that hasn't been defined yet.

Now, in the Step event, you'll see I have chunk_x =... and chunk_y =...

So, later in the step event, I have:
Code:
with (obj_chunk) {
	var chunk_x = obj_controller.chunk_x;
	var chunk_y = obj_controller.chunk_y;
	var load_radius = obj_controller.load_radius;
And it's getting stuck on var chunk_x = obj_controller.chunk_x. So, I don't know if this one has to do with chunk_x being an event level variable instead of an object level variable, but in both of these cases, this project was compiling before the update. Now, if I define a load_radius variable before my for loop, and I comment out the whole with section, I don't get any more errors, so some of this might simply require re-thinking how it's coded (which would be nothing new for me), but the load_radius thing in particular seems odd.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You probably shouldn't be naming local variables with the same name as instance variables? That has always been something I considered a no-no... other than that feel free to file a bug (especially about the "unknown" variables in the debugger).
 
V

VampireJesus

Guest
Okay, I might do that tomorrow. As far as the instance vs local variable names, that makes sense in regards to the chunk variables, but doesn't explain why the step event couldn't see the load_radius variable declared in the create event...
 
A

Arjailer

Guest
I get the same in the debugger - all user-defined instance variables are listed as <unknown> in the debugger. Built-in variables and local variables (var) are fine.
The code seems to work okay, but it's making debugging all but impossible :-(
 
Last edited by a moderator:
Top