D
dcamod
Guest
I am having an issue where I have drawn a path in the draw GUI event that does not display. I ran through the debugger and it appears as if there is no path index even though I have declared a path and set mp_grid_path in both the create event and the step event. I copied the exact code with the exact same objects and variable names into another project and it worked just fine which is why I am posting here. It seems strange. I have been using this project file for a long time to test various AI methods and I would hate to have to recreate it just to reference my old code. The project is not from an earlier version of GM:S so I have ruled that out. The room only has the controller object and the AI object in it. There is no creation code for the room and the objects are in the correct creation order (controller then AI). Is the project file corrupted?
Here is the code for both projects. I stripped the old project down to only this just to test it.
Here is the code for both projects. I stripped the old project down to only this just to test it.
Code:
///Grid and Display
global.grid = mp_grid_create(0,0,room_width/64+1,room_height/64+1,64,64);
mp_grid_add_instances(global.grid,obj_par_solid,true)
as = 0
display_set_gui_size(view_wport[0], view_hport[0]);
Code:
//Paths
path = path_add();
path_set_kind(path,1);
path_set_precision(path,8);
mp_grid_path(global.grid,path,x,y,x+256,y+256,true);
Code:
draw_path(path,x,y,1)