S
solarcrispz
Guest
**UPDATE : THIS IS AFTER A MONTH OF NO PROGRESS ON THE ISSUE AND NO WORD FROM YOYO**
Help! mp_grid_path works absolutely fine on the windows client version of my game. However, on HTML I frequently get this error:
Above happens when the player collides with a wall, presumably because the player clips into it a bit.
The collision code is simple; just a check to see if the player is place_meeting with the relevant collision objects ("wallmid1_object") and if not, it does your typical x/yadd stuff.
Additionally, I made a collision event where if the player is touching a wall, said wall turns temporarily solid (NOTE: I've disabled and enabled feature many times to get around this crash with no avail).
This is the line of code in question:
I've tried forming requisites like position checks with mx / my and collision objects (place_meeting and what not), have tried enabling precise hit boxes for the collision objects, have gone in and made sure that the collision objects match up with the 16x16 grid, have changes mx / my to various things like (nearestplayer.x div 16) * 16, have increased and decreased grid size. I've tried alot of things.
One thing I've noticed, though, that increasing the player size (scale) seems to mitigate the collision issue alluded to above where a crash occurs if the player touches / clips into the collision wall slightly. But the problem still persists.
Am I missing something? I know this is a complex issue, but I figure I'd see if it weren't something more systemic to HTML that I was unaware of that community might be aware of.
TLDR: mp_grid_path seems to not work on HTML, resulting in crashes every time my player slightly clips a wall. I've tried a lot of things. It works just fine on client version.
Help! mp_grid_path works absolutely fine on the windows client version of my game. However, on HTML I frequently get this error:
Above happens when the player collides with a wall, presumably because the player clips into it a bit.
The collision code is simple; just a check to see if the player is place_meeting with the relevant collision objects ("wallmid1_object") and if not, it does your typical x/yadd stuff.
Additionally, I made a collision event where if the player is touching a wall, said wall turns temporarily solid (NOTE: I've disabled and enabled feature many times to get around this crash with no avail).
This is the line of code in question:
GML:
var mx = (nearestplayer.x div 16) * 16 + 8;
var my = (nearestplayer.y div 16) * 16 + 8;
if path_exists(path){
path_delete(path);
}
path = path_add();
if mp_grid_path(global.grid, path, x, y, mx, my, 1){
path_start(path, pathspd, 0, false);
}
else{
path_destroy(path);
}
//This is the create event (in separate object obviously):
//Grid Create event
var cellwidth = 16;
var cellheight = 16;
var hcells = room_width div cellwidth;
var vcells = room_height div cellheight;
global.grid = mp_grid_create(0, 0, hcells, vcells, cellwidth, cellheight);
//Add the things to avoid
mp_grid_add_instances(global.grid, wallmid1_object, false);
I've tried forming requisites like position checks with mx / my and collision objects (place_meeting and what not), have tried enabling precise hit boxes for the collision objects, have gone in and made sure that the collision objects match up with the 16x16 grid, have changes mx / my to various things like (nearestplayer.x div 16) * 16, have increased and decreased grid size. I've tried alot of things.
One thing I've noticed, though, that increasing the player size (scale) seems to mitigate the collision issue alluded to above where a crash occurs if the player touches / clips into the collision wall slightly. But the problem still persists.
Am I missing something? I know this is a complex issue, but I figure I'd see if it weren't something more systemic to HTML that I was unaware of that community might be aware of.
TLDR: mp_grid_path seems to not work on HTML, resulting in crashes every time my player slightly clips a wall. I've tried a lot of things. It works just fine on client version.
Last edited by a moderator: