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 / DBPro: Code Help

Author
Message
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 8th Dec 2004 03:47
I have this code.



it is code for walking across matrixes smoothly. It doesnt work though???

can someone help me. Its for a FPS game

Dark Basic Roxxs (when i dont get error... )
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 8th Dec 2004 03:51
ok 1st problem cx# isnt anything youd need to have, cx#=camera position x() etc etc, as your variables wont fill themselves , toher than that it should work


DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 8th Dec 2004 04:07
It doesnt though

Ive added this and it still doesnt work:


>_0
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 8th Dec 2004 06:19
This still dosnt work, its code for a camera walking over a matrix

>_0
lickuidstylz
20
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 8th Dec 2004 10:13
Hmmm...methinks I understand why...Ok I'm back and I'll try to take a whack at this. I'm on my sucky laptop so I can't test this before posting but here-goes....

I used to use the same type of code in similar tests...the x,z movement worked fine, but it was the y (elevation)movement that was really blocky right?(if I remember correctly)...you're gonna make me want to turn my pc back on...heheh.

Anyway, If this is the case, you'd want to make something like a motion buffer... that works like an invisible spring for the y axis...

so...in essense position camera cx#, cy#, cz#
whereas
if cy# > get ground height (1,cx#,cz#) then `*my syntax may be off `with the "then" in this case. I forget.
cy# = cy# - get ground height (1,cx#,cz#) * 0.9
endif
if cy# < get ground height (1,cx#,cz#) then
cy# = cy# + get ground height (1,cx#,cz#) * 0.9
endif

hope that works, play around with that "0.9" to tweak the smoothness. the lower the number the slower the graduation. and I SWEAR there's another way to do this but I don't remember. the Binary moon tutorial showed how. it was written for DBC, I have DBPro and the tut. code worked fine 4 me. But, I'm going to look this up...It's really nagging me.
Cheers..
Any more questions or whatever, email/im me. I'll respond.

The only limits we have are those we set.
lickuidstylz
20
Years of Service
User Offline
Joined: 13th Aug 2004
Location: MD in USA
Posted: 8th Dec 2004 10:19
by the way...



The only limits we have are those we set.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 8th Dec 2004 10:27
Here is a slightly modified code from the code snippets board. From Phaelax I believe. It allows the user to walk up and down the terrain at almost the same angle as the terrain. So you walk up hills slower than flat areas insted of the opposite


DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 9th Dec 2004 00:07
Thanks people. This is really appreciated

>_0

Login to post a reply

Server time is: 2024-09-23 06:25:17
Your offset time is: 2024-09-23 06:25:17