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 / Third Person Noob :(

Author
Message
Game Master1330
17
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 7th Nov 2012 19:53
Hey,
I'm trying to make a third person movement game but i just cant figure it out! I've coded it in a way that works theoretically, but in practice the camera doesn't work when turning, and for some reason it doesn't move the player

I would be very grateful if someone could download it and take a look :\ You'll understand what i'm trying to make when you open it

Thanks,
Matt

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 7th Nov 2012 21:42
Tagging in for now, I have done 3rd person cameras before, But always good to see new ways... I strongly advise you got the Hands On books 1 and 2, specifically 2 for this task, as it is covered therein

I will hopefully chase this up later, just clearing my RSS feeds for now... hopefully someone [TheComet / Phaelax etc] will come along and spill some / along the way

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 8th Nov 2012 00:58 Edited at: 8th Nov 2012 01:06
first, please don't make us download a file when it's only ~20 lines of code (downloads are usually attached if you think an exe is running improperly and would like others to test on their systems, there is media essential to the app, or there is enough code to justify it (yeah, that's relative/a judgement call, but it's somewhere way above ~20 lines of code) instead (your code):



2nd, you're moving the object at the value of speed, not speed#. you're setting speed# but since you never set speed, it will remain 0. it's a typo, i'm sure, but know there's a difference in the 2 variables which is the root of your movement issue.

3rd, i'd avoid the 'automatic' commands as they'll rarely do precisely what you're looking for, and some of them are buggy.

in this case, set camera to follow is doing what it's intended to do but not what you'd expect from a more-familiar 3rd-person perspective/camera.

and, the use of turn commands should be avoided as un-reliable in dbpro (the combination of both, in your code, is causing the bug in turn to appear)

instead, take conrol of player controls and the camera by modifying your code similar to:



this doesn't include the inherent smooth and collision functionality of the autocam set camera to follow-options but you can add those yourself in the same 'take control of everything' fashion.

(frankly, most don't use the auto-collision commands so you'd probably go a different route there, anyway, at some point, soon).

the above is offered as a starting point to build upon (and i'm pretty sure there is some more-exhaustive camera code out there if you search for it a bit).

come back with any other questions, and good luck

add: you'll notice that i only move the cube when up/down is pressed. since, in your code, you never set speed/speed# to zero, the cube moves constantly (once either up or down is pressed). i didn't know if that was intentional so i went with what my personal habit and instinct

Virtual Nomad @ California, USA . DBPro V7.7
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
Game Master1330
17
Years of Service
User Offline
Joined: 19th Oct 2007
Location: (GetReaderXYZ() * 42 ) / 0
Posted: 8th Nov 2012 19:57
thanks a lot

Position Object Game Master1330, Object Position X(Reader), Object Position Y(Reader), Object Position Z(Reader) - 5

Hide Object Game Master1330

Login to post a reply

Server time is: 2024-11-21 19:05:05
Your offset time is: 2024-11-21 19:05:05