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.

DarkBASIC Discussion / FPS help!

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 10th Jan 2004 03:06
Hi

Sorry if this has been asked before (because I am sure ita has)but I dont want to search the forum. I am beginning a fps and am trying to work out the movement and camera first but I dont know how.
My original idea was to have an object (a cube) act as the player object then position the camera on it and when the mouse moves around it moves the player object in the same relations as the mouse and have the camera locked on to the object so it moves in the exact same manner. Then when you press the up key you move in the direction the camera is pointing. How do I do all of this?

Once again sorry if you have answered this one a million times before but this is all I need to get started I am pretty good at all the other object stuff (except A.I havent got to that one yet and am not looking forward to it )

thanks

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 10th Jan 2004 03:42
Here ya go, this will help you




Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 10th Jan 2004 03:52
Thanks alot!

But I still need to position the camera inside the square or near the front of it, for that FPS feel. I am a bit confused right now and dont know how to do that. Also I noticed that the camera could go below the plane or very very high obove it how can I make it so that the camera will be locked to the object so if the camera is looking around the block will do the same?

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 10th Jan 2004 04:31
Here's the code for a FPS:



to lock the camera in my first example, you could use:




Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 10th Jan 2004 05:08
You da man!!!!!!!!!!!! thanks alot dude I really appreciate it.

PS. how long did it take for you to get this good at making stuff in db?

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 10th Jan 2004 05:23 Edited at: 10th Jan 2004 05:24
You wont get anywhere if you use other peoples code Best to use theirs as a learning experience, and code your own. Its not your game if its a bunch of other peoples code copied + pasted in

I tend to explain in theory, thus making people code it on their own and making them better coders

RPGamer


We need help! Email us! [email protected]
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 10th Jan 2004 05:35
Im not giving him the extra's, just a basic movement/mouselook. He should code the rest


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 10th Jan 2004 06:09
Yeah I have done all the gun positioning and object placement already I just needed that camera and movement part to get me started.
Well I have encountered a problem that needs fixing I cant explain why it is doing this, I have the gun model with hands attached and when I load it it looks realy good everything is were it should be. But when I use the following command to lock it to the place I want it I get a weird result..

position object 2,0,-6,3
scale object 2,40,40,40
rotate object 2,90,0,180
set object pivot 2
lock object on 2

when I do that the hands that were once were they were supposed to be are now sticking through the gun making an ugly effect. Why is it doing this, I think it might be the lock object on 2 command but am unsure please help! The rest of the code is below in the source area.

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 11th Jan 2004 01:20
I dont know why but the lock object command seems to be messing up my object. It looks right except that the right hand which should be on the trigger is sticking out of the left side of the gun.

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 11th Jan 2004 05:13
Try Disable Object ZDepth(gun)

RPGamer


We need help! Email us! [email protected]
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 11th Jan 2004 05:53
I tried that and it did not work. It is definatly being caused by the lock object on command because when I turn that command off and look at the object it appears normal. I thought about making the object a limb but have no clue how to do that. Any more suggestions?

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 12th Jan 2004 00:13
This is the code dealing with the gun position onscreen


load object "M4 with hands.3ds",2
load bitmap "M4 with hands.bmp",31
get image 31,0,0,755,383
texture object 2,31
rotate object 2,90,0,180
fix object pivot 2
disable object zdepth 2
position object 2,0,-11,2
lock object on 2

It seems as thought it is showing the objects on the other side of the gun. The arm that should be invisibel on one side of the gun is sowing up. I have no Idea how to fix this and need yalls help.
Please help me! I have tried this with two gun models and get the same result so it is not just one model.

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 12th Jan 2004 04:55
Try Disable Object ZDepth(gun) like John said, and also, try Set Object gun,1,1,1

That'll stop it from drawing away facing polly's.

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 12th Jan 2004 05:03
No such luck it did not work this is what I have

load object "M4 with hands.3ds",2:set object 2,1,1,1
load bitmap "M4 with hands.bmp",31
get image 31,0,0,755,383
texture object 2,31
rotate object 2,90,0,180
fix object pivot 2
disable object zdepth 2
position object 2,0,-11,2
lock object on 2

Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 12th Jan 2004 13:53
why do you texture a 3ds object, just save it in 3ds format with textures (and put the textures in the same folder) that should do it


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"

Login to post a reply

Server time is: 2025-05-22 06:03:36
Your offset time is: 2025-05-22 06:03:36