- Game Maker Community
- → Viewing Profile: Topics: kdixon24
kdixon24
Member Since 05 Oct 2009Offline Last Active May 23 2012 11:39 AM
Community Stats
- Group New Member
- Active Posts 82
- Profile Views 814
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Male
0
none
Topics I've Started
Command prompt
23 May 2012 - 12:42 AM
So I have a script that essentially breaks a chunk of text into two parts, and I want it so that I can type in "x=1234" and x will actually become 1234. Is there any way I can do this? I can't seem to make it work. I can give more details when I get home, I don't have the code in front of me right now.
GUI drawing... poorly
22 May 2012 - 10:19 PM
So in my game I have a script scr_draw_gui that, well, draws a GUI overlay on the screen.
The problem is, if I look up it draws perfectly, but when I turn down it gradually disappears behind the floor or trees. It seems to be a 3d object with it's own depth rather than an overlay.
Is there any way to fix this?
GM8 pro, very experienced with normal, some experience with 3d functions.
Depth of the object that draws the gui is 100, depth of the object that draws the world is 0.
Any help is greatly appreciated.
draw_text_transformed_color(5,display_get_height()/2-25,"zfloor"+string(global.zfloor),1,-1,0,c_black,c_black,c_black,c_black,1) draw_text_transformed_color(5,display_get_height()/2-50,"zdir"+string(obj_player.zdirection),1,-1,0,c_black,c_black,c_black,c_black,1) draw_text_transformed_color(5,display_get_height()/2-75,"zspeed"+string(obj_player.zspeed),1,-1,0,c_black,c_black,c_black,c_black,1) draw_text_transformed_color(5,display_get_height()/2-125,"x"+string(obj_player.x),1,-1,0,c_black,c_black,c_black,c_black,1) draw_text_transformed_color(5,display_get_height()/2-150,"y"+string(obj_player.y),1,-1,0,c_black,c_black,c_black,c_black,1) draw_text_transformed_color(5,display_get_height()/2-175,"z"+string(obj_player.z),1,-1,0,c_black,c_black,c_black,c_black,1) draw_text_transformed_color(5,display_get_height()/2-200,"dir"+string(obj_player.direction),1,-1,0,c_black,c_black,c_black,c_black,1) draw_set_alpha(0.4); draw_healthbar(5,display_get_height()/2-10,100,display_get_height()/2-20,health,c_black,c_red,c_lime,0,true,true); draw_set_alpha(1);
The problem is, if I look up it draws perfectly, but when I turn down it gradually disappears behind the floor or trees. It seems to be a 3d object with it's own depth rather than an overlay.
Is there any way to fix this?
GM8 pro, very experienced with normal, some experience with 3d functions.
Depth of the object that draws the gui is 100, depth of the object that draws the world is 0.
Any help is greatly appreciated.
Drawing a first person arm/gun at an angle
16 May 2012 - 09:33 PM
I'm fairly new to 3d game maker but I'm pretty experienced with Game maker in general as well as other languages, and I have adequate Trig knowledge, but I've been working on this for 6 days or so now and I have no clue how to accomplish this. My math teacher's help has been somewhat... unhelpful, at least for the code aspect.
I have a first person 3d game in which your arm is drawn in front of you, holding whatever item you have (still working on that bit, but that's not important). The problem is that you can look in any direction. If you just look left/right, the arm turns with you, but it doesn't follow your view on the z axis.
The code (omitting unrelated bits) is:
ax=(36*cos(zdirection)) //vector x
ay=(36*sin(zdirection)) //vector y
d3d_transform_set_identity() //I'm unclear as to what this does, but it's necessary
d3d_transform_add_rotation_z(direction) //this makes the arm turn left to right
d3d_transform_add_translation(obj_player.x,obj_player.y,obj_player.z) //makes the arm follow the player
d3d_draw_block(0,8,-8, 36,16,8, background_get_texture(tex_tree_trunk), 1,1)//,1,24) //draws the arm
d3d_transform_set_identity() //again? still confused on this
I know that the 'origin point' for the arm is (0,8,-8), and the point I'm drawing to is (36,16,8), so that the dimensions of the arm are (36,8,16)
And the vector my teacher gave me is (36*cos(zdirection),36*sin(zdirection))
But I don't know how/where I implement that vector, or even really what a vector is for that matter.
How would I go about making the arm rotate to end at that point?
Any help is greatly appreciated.
I have a first person 3d game in which your arm is drawn in front of you, holding whatever item you have (still working on that bit, but that's not important). The problem is that you can look in any direction. If you just look left/right, the arm turns with you, but it doesn't follow your view on the z axis.
The code (omitting unrelated bits) is:
ax=(36*cos(zdirection)) //vector x
ay=(36*sin(zdirection)) //vector y
d3d_transform_set_identity() //I'm unclear as to what this does, but it's necessary
d3d_transform_add_rotation_z(direction) //this makes the arm turn left to right
d3d_transform_add_translation(obj_player.x,obj_player.y,obj_player.z) //makes the arm follow the player
d3d_draw_block(0,8,-8, 36,16,8, background_get_texture(tex_tree_trunk), 1,1)//,1,24) //draws the arm
d3d_transform_set_identity() //again? still confused on this
I know that the 'origin point' for the arm is (0,8,-8), and the point I'm drawing to is (36,16,8), so that the dimensions of the arm are (36,8,16)
And the vector my teacher gave me is (36*cos(zdirection),36*sin(zdirection))
But I don't know how/where I implement that vector, or even really what a vector is for that matter.
How would I go about making the arm rotate to end at that point?
Any help is greatly appreciated.
ds_grid_get problems.
25 July 2011 - 12:27 PM
So I've got a little random name generator going on:
In obj_spawn(basically a control object) Create:
//initialize namegen
ar_town=ds_grid_create(2,3)
ds_grid_add(ar_town,0,0,"Lakeside")
ds_grid_add(ar_town,0,1,0)
ds_grid_add(ar_town,1,0,"Greensville")
ds_grid_add(ar_town,1,1,0)
ds_grid_add(ar_town,2,0,"Cliffport")
ds_grid_add(ar_town,2,1,0)
It's called in obj_town create:
grid=obj_spawn.ar_town
text=ds_grid_get(grid,round(random(ds_grid_height(grid)-1)),0)
The system works fine for Lakeside and Greensville, but where cliffport would show up, it just says "0".
I've been up half the night trying to figure this out, with no success. I'm sure it's just me being stupid again.
Any help is appreciated.
In obj_spawn(basically a control object) Create:
//initialize namegen
ar_town=ds_grid_create(2,3)
ds_grid_add(ar_town,0,0,"Lakeside")
ds_grid_add(ar_town,0,1,0)
ds_grid_add(ar_town,1,0,"Greensville")
ds_grid_add(ar_town,1,1,0)
ds_grid_add(ar_town,2,0,"Cliffport")
ds_grid_add(ar_town,2,1,0)
It's called in obj_town create:
grid=obj_spawn.ar_town
text=ds_grid_get(grid,round(random(ds_grid_height(grid)-1)),0)
The system works fine for Lakeside and Greensville, but where cliffport would show up, it just says "0".
I've been up half the night trying to figure this out, with no success. I'm sure it's just me being stupid again.
Any help is appreciated.
Dungeon generator
08 January 2011 - 07:48 AM
I'm making a dungeon generator, here is the code I used:
The problem is, it doesn't always use all the tiles it's supposed to. That is; global.tilenumber is 6 (not always, but it's an example). The generator doesn't always make 6 tiles, and I can't figure it out. Please help.
Thanks in advance.
if createtile=true
and not global.roomnumber <1 //number of rooms to make, not important to this.
and not global.tilenumber <1 // number of tiles to draw in this room
{
switch choose(1,2,3,4)
{
case 1://up
if place_free(x+8,y+8)
{
i=instance_create(x,y+16,obj_floor)
}
;;break;
case 2://right
if place_free(x+16,y-8)
{
i=instance_create(x+16,y,obj_floor)
}
;;break;
case 3://down
if place_free(x+8,y-24)
{
i=instance_create(x,y-16,obj_floor)
}
;;break;
case 4://left
if place_free(x-8,y-8)
{
instance_create(x-16,y,obj_floor)
}
;;break;
}
createtile=false
}
The problem is, it doesn't always use all the tiles it's supposed to. That is; global.tilenumber is 6 (not always, but it's an example). The generator doesn't always make 6 tiles, and I can't figure it out. Please help.
Thanks in advance.
- Game Maker Community
- → Viewing Profile: Topics: kdixon24
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content