Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / A few questions regarding FPS

Author
Message
Mathew_wi
15
Years of Service
User Offline
Joined: 12th Jun 2009
Location: Idk.
Posted: 21st Jun 2009 06:22
Alright I have got collisions 3D Maps FPS Movement and gun.
now I need some help with the shooting The Ones that come with DBPro Don't Work >__> So how can I shoot at an object and it shows Text and goes bye bye.

Also where can I find some Gun directx meshes? .X to be exact
Thanks a bunch.

I am a beginner
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 21st Jun 2009 10:44
Ruccus's FPS tutorial will point you in the right direction.
http://forum.thegamecreators.com/?m=forum_view&t=56770&b=7

for the models, these are the ones i found with google, a searchengine. www.google.com

http://www.3dheaven.net/start.htm
click on modelle and then waffe
i think they are 3ds so you need to convert them with dbp or something.

http://www.baument.com/archives.html
all 3ds, so you'll have to convert them

Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 21st Jun 2009 19:46
I just got finished implementing aiming and shooting into my FPS game. I built it off Ruccus's tutorial that bobbel referenced. It's a good resource, but it does have a few issues that I had to modify the code to get rid of.

My FPS is using Dark Physics for collision detection, so I don't know how similar your code is, but for mine, I put a thin box on the floor and positioned the camera on that box, but about 100 units away in the Y direction.

So object 1 is my physics player box, and the code for the camera looks like this.

(inside the DO...LOOP commands)


I then made a small cube (object number 9998) and placed it exactly where the camera is:



I then have object 9998 rotate to match the rotation of the camera on both the X and Y axis.

Here's my mouse aiming code, with aiming constraints and the code to rotate object 9998.



Then you attach a limb to object 9998, and use raycasting to check for intersection.



Then, if there is an intersection, and the fire button is being pressed, you put in you killing code:



The reason I had to modify Ruccus's code like that, is because my physics player box can only rotate to the left and right, so I would only be able to aim straight ahead with the code he wrote. So I made another box exactly where the camera is and made it match the camera's rotation. I gave that object a limb, and since limbs match the movement and rotation of their parent object, and the parent object is always where the camera is, it essentially is a limb coming straight out of the camera.

Note: if you want to see that it works without having to code in an enemy to kill, change the offset limb from 500 to 50, and delete the hide limb command, you can now see the limb constantly 50 units in front of your camera.

I hope that helps you.

Mathew_wi
15
Years of Service
User Offline
Joined: 12th Jun 2009
Location: Idk.
Posted: 22nd Jun 2009 00:48
It sorta works. I put it in You can shoot the sky and it does it xD
But when you face another direction it doesn't :/

I am a beginner
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 22nd Jun 2009 04:23
I don't really understand. Either be a bit more descriptive, or post some example code.

Login to post a reply

Server time is: 2024-11-16 06:13:42
Your offset time is: 2024-11-16 06:13:42