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 / I need help badly!!! working on FPS aiming system !

Author
Message
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 21st Feb 2004 03:05 Edited at: 21st Feb 2004 03:24
ok i just made another post because the other one had like 50 posts and i don't think anyone was reading it . So:

i am making an fps, with an aiming system like counterstrike/halflife/battlefield 1942. for any of u unfamiliar with that, what happens is there is a crosshair which stays in the middle of the screen, and you move the mouse to aim. the gun is always pointing at the crosshair. Mostly THanks to zircher, i have gone this far in making the aiming system (no sarcasm intended). now, the problem is, if i move the mouse too much to the left or too much to the right, u cant see the gun anymore! its still pointing at the crosshair, i know that, but u cant see it cuz its rotating! how do i fix this? i will attach my code and hopefully someone can just take a look at it and offer a suggestion to fix this . thanks in advance oh yeah and zircher, just keep on posting on that other thread so we can keep our discussion going....

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Feb 2004 03:24
without looking at your code, if you are using mousemove fps then you are actually aiming the camera when yhe mouse moves, so the gun barrel should be at some offset position in relation to the camera but it's angle should be equal to the camera angle as it changes. The gun should not have the appearance of pivoting independent of the camera.

-RUST-
"What the... Mooooooooooo!"
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 21st Feb 2004 04:19
ya...i just realized that like 5 secs after i posted...but how exactly do i do that, what u sed?
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Feb 2004 04:36
You can use Lock Object On to lock an object to the screen. This will make the object move with the camera, as you said with the gun.

"All programmers are playwrites and all computers are lousy actors" -Anon
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 21st Feb 2004 04:50
lock object on just makes my gun disappear... besides my code so far is BASED on the camera, not the gun... i know thats probably not the best idea but i dunno im just doing that for now
comando 300
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 21st Feb 2004 06:04
You have to adjust the Z coodinate of the gun until it appear, I think!

CURRENT PROJECT: RETRO PAC-MAN
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 21st Feb 2004 22:13
come on plz i still need help
Lord Helmet
21
Years of Service
User Offline
Joined: 30th May 2003
Location:
Posted: 22nd Feb 2004 02:57
Ok, position the gun in you're camera's view, lock it, and then do the loop.

locking an object causes it to be declared into 3d space in reference to the camera instead 0,0,0

Also if you use 2 if statments you can set limits to the up/down pitching of the camera. otherwise you do summersults.

If I remember right you could still use the move object commands(look them up under basic3d) to move the or bob the gun and it still will be attached to the camera.

If someone has dbpro handy, you could load up the FPS tutorial for him and copy the part out that moves the camera and gun object. The commands are the same. (move object moves it foward in pro rotate or pitch commands turn it) ref to prev. thread
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 22nd Feb 2004 08:04
ok the lock object command TOTALLY screws up my thing. here's my code... could someone just tell me what i should do ? by the way, i have one version of my game based on the camera (which zircher is helping me with), and this one, which i changed to the positions are based on the gun. ill just use whichever one works first

Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Feb 2004 15:27
turn off the gun collision, you don`t need it, if the gun is too close to the camera then it will get clipped, so set the camera range shorter with (ta da!)

set camera range how-close-before-clipping, maximum-range-you-see-objects

set the near value to something like 0.01, that way parts of the gun will not disapear until they are 0.01 world units away, if the gun is held slightly below the camera viewpoint then it will always get fully drawn since no part will get close enough to be clipped.

so once you have positioned your gun and then locked it to the screen make sure you disable the z depth (on the gun) so that when you walk up to a wall it doesn`t look as though you just embedded the gun into it, and that should be it, you won`t need collision set on the gun since the camera collision will be handling the collision for the player, cheers.

Mentor.

Get Pro sorted, I am a customer not a BETA tester.
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 23rd Feb 2004 06:18
ok so now this is what my code looks like


should work, right? but DBC doesnt like the set camera range thing - it gives me an error (and crashes my computer[!?!?]) saying 'start range must be between 1 and end range' - are you using DBpro? why doesnt this command w0rk?
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 24th Feb 2004 05:03
yo? anyone?
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 25th Feb 2004 01:42
come on. . . plz... mentor????

Login to post a reply

Server time is: 2024-11-26 05:48:23
Your offset time is: 2024-11-26 05:48:23