Makkeonmies
Member
Recently i've imported an old GM8.0 first-person shooter game of mine into Studio 1.4. I got the project working fine after removing some obsolete functions and changing some scripts for textures, but the game still crashes oddly sometimes when a room changes, like when you just move to a next room. It doesnt give an error message, it's just the Windows's '<program> has stopped working.' I'm thinking it's got something to do with some old code, that's now gone obsolete, or maybe some string of code that is vital in Studio is missing from my old GM8-era-scripts. I just wanted to check a couple of codes, i think these might just be causing some issues, is there anything wrong with them for Studio 1.4.? Can it be when the game switches to a room with one of these, it crashes?
Draw event of a still object (an NPC):
{
var tex;
tex = sprite_get_texture(sprite_index,image_index);
d3d_draw_wall(x-6*global.camsin,y-6*global.camcos,z1,
x+6*global.camsin,y+6*global.camcos,z2,tex,1,1);
}
Said NPC-object's Collision event with obj_wall:
{
x = xprevious;
y = yprevious;
if (abs(hspeed) >= abs(vspeed) && not place_meeting(x+hspeed,y,obj_wall_basic))
{ x += hspeed; exit;}
if not place_meeting(x,y+vspeed,obj_wall_basic)
{ y += vspeed; exit;}
if not place_meeting(x+hspeed,y,obj_wall_basic)
{ x += hspeed; exit;}
}
I suspect these might just be causing the game to crash, if not, i've gotta see if it's something with the player object. Thanks beforehand (and sorry for long babble)
Edit: Just added one code from player object, i didn't use this back when i did the game in 8.0 and 8.1. I found use for it in Studio since there's some texture clipping errors, so this code i've put in obj_player's Draw event:
{
draw_set_alpha_test(true);
draw_set_alpha_test_ref_value(128);
}
Draw event of a still object (an NPC):
{
var tex;
tex = sprite_get_texture(sprite_index,image_index);
d3d_draw_wall(x-6*global.camsin,y-6*global.camcos,z1,
x+6*global.camsin,y+6*global.camcos,z2,tex,1,1);
}
Said NPC-object's Collision event with obj_wall:
{
x = xprevious;
y = yprevious;
if (abs(hspeed) >= abs(vspeed) && not place_meeting(x+hspeed,y,obj_wall_basic))
{ x += hspeed; exit;}
if not place_meeting(x,y+vspeed,obj_wall_basic)
{ y += vspeed; exit;}
if not place_meeting(x+hspeed,y,obj_wall_basic)
{ x += hspeed; exit;}
}
I suspect these might just be causing the game to crash, if not, i've gotta see if it's something with the player object. Thanks beforehand (and sorry for long babble)
Edit: Just added one code from player object, i didn't use this back when i did the game in 8.0 and 8.1. I found use for it in Studio since there's some texture clipping errors, so this code i've put in obj_player's Draw event:
{
draw_set_alpha_test(true);
draw_set_alpha_test_ref_value(128);
}
Last edited: