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 / MouseLook Turning object in 3d person?

Author
Message
Alien
21
Years of Service
User Offline
Joined: 14th Dec 2003
Location:
Posted: 16th Dec 2003 15:09
I want to make a 3rd person game.
I've managed to get an 3rd person view with the camera locked behind the object so that if my object turns, the camera turns with it.
I want the object to turn if i move my mouse to the right or left. And I want the camera to pitch up or down when I move my mouse to the front or the back.

I have a mouselook code:

But when i use this code my 3rd person view won't work :S
This is my 3rd person code:


Can some1 help me out?

Static-X!!
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 16th Dec 2003 15:12 Edited at: 16th Dec 2003 15:14
Here's my Third Person Mouselook function, works similar to Max Payne:



Usually you'd call it with something like this:



It also requires 2 global variables:



Just fiddle with the values until it loosk right with your character. The function parameters are: "Object Number, how high camera is above object, how far away from object camera is, how fast it pitches, how fast it rotates"

Btw, that's DBP code so I'm not sure if it will work in classic although logically it should.


"Computers are useless they can only give you answers."
Alien
21
Years of Service
User Offline
Joined: 14th Dec 2003
Location:
Posted: 16th Dec 2003 15:35
Tanx, but 1 problem.

When I use your code it gives the error: Syntax Error. Parameters Differ between fucntion call and declaration at line 116.

Line 116 =


Static-X!!
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 16th Dec 2003 15:43 Edited at: 16th Dec 2003 15:44
Try This for calling:



And this for the function:



If this doesn't work I may have to pull my DBC CD out of the closet.


"Computers are useless they can only give you answers."
Alien
21
Years of Service
User Offline
Joined: 14th Dec 2003
Location:
Posted: 16th Dec 2003 15:48
Error:
Function declaration has unknown parameter at line 66.

Line 66:


To bad Tanx voor trying tough

Static-X!!
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 16th Dec 2003 15:50
Sorry, I'll have to pull out DBC and give it a try tommorrow morning. It's too late here in Australia.


"Computers are useless they can only give you answers."
Alien
21
Years of Service
User Offline
Joined: 14th Dec 2003
Location:
Posted: 16th Dec 2003 15:51
Ok, Thanx

Static-X!!
Alien
21
Years of Service
User Offline
Joined: 14th Dec 2003
Location:
Posted: 16th Dec 2003 19:29
Never mind, I fixed it. I've tried some stuff and suddenly it worked :S

Tanx 4 your part of the code Exeat!

Static-X!!

Login to post a reply

Server time is: 2025-05-22 03:43:14
Your offset time is: 2025-05-22 03:43:14