Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

Trying to add new weapons. I see your logic in the script init_weapons. However, where are you declaring the "wp_UNARMED" or "wp_PISTOL"? I can clearly see how you added items, just can't get those wp_ declared to allow more than the two weapons you have in the example. 

Using GMS2 FYI

They're defined in the default compatibility location, scripts --> macros. (Lines 22-25). There's a machine gun example weapon as well, but it's sort of hidden so it's easy to miss.

(+1)

Thanks Yal, great engine!

Hey Yal, nearly got it all figured out. I was trying to make some of the walls more rectangular and less squared. I used the below to do so in the draw event and it looks perfect. However, the collision box is still the full square. I made sure to also change the tops and bottoms.


draw_set_color(c_gray)
d3d_draw_floor(x   ,y+32 ,     zbottom+0.01,x + sprite_width,y + sprite_height,zbottom+0.01,my_fex,image_xscale,image_yscale)//Floor
draw_set_color(c_white)
d3d_draw_floor(x    ,y+32,     ztop-0.01   ,x + sprite_width,y + sprite_height,ztop-0.01,my_fex,image_xscale,image_yscale)//Ceiling
d3d_draw_wall(x ,y+32  ,zbottom+0.01,x + sprite_width,y+32     ,ztop-0.01,my_wex,image_xscale,1)//Back wall
d3d_draw_wall(x   ,y   + sprite_height,zbottom+0.01,x    ,y+32,ztop-0.01,my_wex,image_yscale,1)//Left
d3d_draw_wall(x + sprite_width,y+32,zbottom+0.01,x + sprite_width,y  + sprite_height,ztop-0.01,my_wex,image_yscale,1)//Right
d3d_draw_wall(x + sprite_width   ,y + sprite_height,zbottom+0.01,x,y + sprite_height,ztop-0.01,my_wex,image_xscale,1)//Front?

(+1)

Yeah, the collision code first does a standard Game Maker collision and then does a Z collision check (using a per-instance collision function to allow for things like slopes) to see if the overlapping objects are colliding vertically as well... so the collision mask of the terrain object's sprite is used for the XY collision check regardless of what you draw. If you make the walls more narrow than the sprite, you should change the collision mask to match this (either by giving the walls a new sprite, or changing the existing sprite's collision mask to not cover the entire sprite).

(+1)

Perfect, thank you!