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 / Switching between 1st person and 3rd person veiws

Author
Message
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 2nd Feb 2003 05:54
To achieve this common goal, would this code, or a code similar in form to this, work to be able to hit a button and change the veiw from First Person Veiw to Third Person Veiw?

****This is only a small code for the switching of cameras, which can be added to the game****



x,y,z=the numbers to position the camera in 1st person view...

a,b,c=the numbers to position the camera in 3rd person view...

Would doing that work to achieve getting a 1st-3rd person veiw in a game?? Thanks!
AlamDV, NHL, NHL 2K3....... The best combination ever!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 2nd Feb 2003 06:14
have a keystate switch with a trapping method to stop rapid fire.

then inside this keystate switch,
change a variable like

camstate = 1
camstate = 0

then set a if condition

if camstate = 1
do code
endif

if camstate = 0
do code
endif

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 2nd Feb 2003 06:15
ah i forgot to mention that u could use the same camera code but altering the distance from the camera position would be one solution.

Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 2nd Feb 2003 18:15
K, thanks. So, what would I put inbetween ifcamstate=1 and endif? I am just learning this ahead of time, so when I get DarkBasic I can be ready to start coding...

AlamDV, NHL, NHL 2K3....... The best combination ever!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Feb 2003 18:24
I just go into a separate WHILE loop, within that you can look around etc. then press space to exit back into the game.

If it's for the whole game and not for a lookaround mode then something like this would suffice:



Visit [url]www.lightning-systems.co.uk[/url]
You are the th person to view this signature.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Feb 2003 18:24
Also, what indi said can be done. For example in a flight sim.

Visit [url]www.lightning-systems.co.uk[/url]
You are the th person to view this signature.
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 2nd Feb 2003 18:44
Thank you very much, David89...

But, i dont get it by "if mode = 1".. Wouldnt I still need to do something that would change the mode if you hit a button? I mean, I understand everything in that code, but where would I make the, for example, "pkey()=1", "if pkey()=1 then blah blah... Or would the code simply be like this?



Would something like that work? If things in that code need to be changed (and i really think they do) then please, change them for me so I learn what I need to do to get this to work correctly! thanks!

AlamDV, NHL, NHL 2K3....... The best combination ever!
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 2nd Feb 2003 18:46
Or would something as simple as this work?



Could something like that work? And then you would say what the v's stand for, or something?

AlamDV, NHL, NHL 2K3....... The best combination ever!
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 2nd Feb 2003 18:47
OOPs. thats one thing i hate about this forum.. No edit function. I mean "IF pkey()=1 then next v"...

AlamDV, NHL, NHL 2K3....... The best combination ever!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 2nd Feb 2003 22:40
I would also like to know how to do this, it would be of great help in my learning process of DB, & in the production of my game.

The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 3rd Feb 2003 00:22
This code works. It's a bit long winded however, but uses the spacekey() to change between two camera positions, with a repeat eliminator (keypressed#), and also has path smoothing, that's why I used so many variables.



The camera always moves smoothly towards cameradest, and is positioned at camerapos. The thing with keypressed# is that it waits until spacekey has been lifted before it allows the angle change to occur again.

Login to post a reply

Server time is: 2024-11-23 23:57:27
Your offset time is: 2024-11-23 23:57:27