First of all I am not sure If I should write it here. Seconadary, I am not sure if it's a bug, but it really seems to.The problem came after I tried to implement drawing order system like in the Friendly Cosmonaut Tutorial (
). But after I have finished nothing have happened. Of course it can be my mistake somewhere as my code differs a little in some places, but not in this particular. To be short I will send screenshots of My Debugger Working in the Script:
See, the debugger passes the whole script with 2 lines(I was pressing the simple one step button as always and it worked properly before). So really, the debugger starts on the first line of function and ends on the one before the last. So I ahve decided to check if it was my trouble and deleted "If statement". And I got Exactly the same situation. Then I have even added
If I run the game without debugger, it just doesn't draw anything, here is the drawing code (but I don't think the trouble is here, even if the mistake exists in this code):
I am really stuck! Help please and fix this bug if it is please.
Edit: the code from the screenshot also had one flow, which should have led to the error, but it didn't, after I have fixed it nothing have changed(The variable grid_height isn't set if the ds_grid doesn't exist)
See, the debugger passes the whole script with 2 lines(I was pressing the simple one step button as always and it worked properly before). So really, the debugger starts on the first line of function and ends on the one before the last. So I ahve decided to check if it was my trouble and deleted "If statement". And I got Exactly the same situation. Then I have even added
show_debug_message("!!!!!")
, and still, it didn't appear in the Log while the debugger was stopping every step on this script.If I run the game without debugger, it just doesn't draw anything, here is the drawing code (but I don't think the trouble is here, even if the mistake exists in this code):
GML:
//The Drawing Order Grid is created in the script I have attached
//On screenshot and that script takes place in the pre-draw event of all objects
if(ds_exists(drawing_order_grid,ds_type_grid))
{
//Sort Grid By Bbox Bottom
ds_grid_sort(drawing_order_grid,1,true);
for(var _id = 0; _id < ds_grid_height(drawing_order_grid); _id++)
{
var _toDraw = drawing_order_grid[# 0,_id];
draw_sprite(_toDraw.sprite_index,_toDraw.image_index,_toDraw.x,_toDraw.y);
}
ds_grid_destroy(drawing_order_grid);
}
Edit: the code from the screenshot also had one flow, which should have led to the error, but it didn't, after I have fixed it nothing have changed(The variable grid_height isn't set if the ds_grid doesn't exist)
Attachments
-
203.3 KB Views: 3
-
203.8 KB Views: 3
-
196.8 KB Views: 3
-
196.9 KB Views: 3
Last edited: