Jump to content


Darksoul

Member Since 30 Aug 2006
Offline Last Active Aug 11 2007 06:51 PM

Topics I've Started

Overlay Problem

09 January 2007 - 05:43 PM

Ok Im making a FPS with a gun and a small cross to show where your going to shoot I want the cross to turn red when you look at the enemy so I made one sprite with two subimages number 0 is the normal one and number 1 is the red one since overlays cant have collosions I was trying to make it that if the camera was pointing in the direction of the target the sprite turns red so I found a 3D point direction script on the forums here it is
//d3d_point_direction_z(x,y,z,x2,y2,z2);
//Remember to replace this in this way to get a full working function...
//x = argument0
//y = argument1
//z = argument2
//x2= argument3
//y2= argument4
//z2= argument5
//This returns the drection on the second direction...

return (point_direction (0,argument2,point_distance(argument0,argument1,
argument3,argument4),argument5));

So I used this in the step event
if d3d_point_direction_z(objTarget.x,objTarget.y,objTarget.z,x,y,pitch)
objFPS.Subimage=1 else objFPS.Subimage=0

Heres the cameras draw event
bearing -= (display_mouse_get_x() -display_get_width()/2)/10;
pitch += (display_mouse_get_y() -display_get_height()/2)/10;
pitch = max(min(pitch,80),-80); //this limits camera pitch -is up, + is down
ss = sin(degtorad(bearing));cc = cos(degtorad(bearing));
vector_x=cc*cos(degtorad(-pitch));
vector_y=ss*-cos(degtorad(-pitch));
vector_z=sin(degtorad(-pitch));

BobAngle=(BobAngle+360+speed *2 ) mod 360
BobZ=(zfrom+lengthdir_x(0.1,BobAngle))+120

d3d_set_projection_ext(x,y,BobZ,x+vector_x,y+vector_y,BobZ+vector_z,0
,0,1,45,1.33,1,32000)
draw_set_color(c_white);
display_mouse_set(display_get_width()/2,display_get_height()/2);

The result was kind of weird as the cross turns red at random times and thats not what its supposed to do so some please help me if you need anymore information please tell me and I know TGG has an example on Shooting Bullets which is kind of similar to this but his code doesnt work in my game cause its coded differently
NOTE:MOST OF THE CODES ARE FROM XYGTHOP3
Thanks

Gun Movement

29 December 2006 - 07:18 AM

Ok I got my gun in the view but Im having a bit of a problem....
when I look up the gun goes out of the veiw when I look down and turn left
or right it goes out of the view also if the gun goes on the terrain it goes
out of the veiw I dont know what to do I've tried the following things:

1-Drawing the gun in the camera's draw event it gave me nasty results because
the gun stayed in the middle and it still goes out of the view when I move

2-limiting the direction and the Zdirection...it worked but you couldnt move back so moving was REALLY
limited so it didnt work the gun stayed in the veiw though

and thats about it....I know I havnt posted any code because Im posting the GM6
LINK TO GM6
I know there is an example
Thanks Everyone

Level Design Or Story ?

14 December 2006 - 03:29 PM

Ok I've been wondering what makes you come to the second version of someone’s game? I mean take Crash Bandicoot for example....what makes you come back to number 2 and number 3 they are all the same you jump on boxes and kill monsters so this is the question What makes you come back ? the story or the level design? or the sounds :huh:
or anything else
Post your thoughts and why you picked that
Thanks

Fps

02 December 2006 - 09:25 AM

Well Im making a FPS and I was wondering what type of guns would you want to see in a FPS I have no idea what I should use
heres a VERY SMALL description of the game: your traped in a virtual world
heres the choices I made of what guns I should use
Choice A:
Real guns like pistols, SMGs,Rifles and genades etc
OR
Choice B:
Unrealstic guns lets say Halo style like ray guns or solar bombs etc (My game isnt a Halo fan game that was just an example)
OR
Choice C:
What you suggest like, if you dont like the above just give me your idea...

now what do you think ?

Explaination Needed

01 December 2006 - 11:25 AM

Well I read the manuel but it doesnt explain it in detail could someone please tell me what these functions do...d3d_set_hidden() and d3d_set_depth()
thanks... oh yeah I've seen the word z-buffer alot these days could someone please tell me what the means too
thanks