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 / Walking on a .X level

Author
Message
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 4th Sep 2004 07:41
Can someone help start me off walking on a .x level i can get the basics of it but my player keeps going from walking on the floor to walking ontop of a high building or something i want to keep my player on the ground but able to still walk up steps. can anyone help me out please?

Thanx Graham
Sir Spaghetti Code
20
Years of Service
User Offline
Joined: 12th Jul 2004
Location: Just left of Hell
Posted: 4th Sep 2004 08:05
Sounds like you need a collision system. Maybe a more experienced coder can help you more, but I suggest looking in the Code Base under 3-D>Collision, or get a 3rd party collision set, like Nuclear Glory's (which I use and love). Hope this helps!

Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 4th Sep 2004 21:47
Kensupen also offered some source code on how to do this, see the http://forum.thegamecreators.com/?m=forum_view&t=10315&b=6 thread. It uses the 'Intersect Object' command to detect collisions and although the source code is a little messy, it's still a great piece of coding to learn from.


"Computers are useless they can only give you answers."
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 6th Sep 2004 06:10
yeah i have already seen that code but it's a little difficult to understand anyone got any code thats a little simpler or easier to understand?
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 6th Sep 2004 06:35 Edited at: 6th Sep 2004 06:37
just hold the previous height and compare them each loop, if you suddeny jump up too far then you know your player is trying to stand on the roof or spring to the top ofa cliff, when that happens then position him back at the old position before the sync, something like....

if NewHi-OldHi>0.1
position camera OldX,OldHi,OldZ
endif
sync

in the loop should do the trick, just move your current position into a temporary store before the next change, change the values, and if the difference is too great then reset the values to the old position, this in effect just "takes back" any moves that would be silly, notice that in this code you can`t go UP by more than 0.1 per loop, but you can still go DOWN, if you want the player to fall then you can write a simular code but position the player at the old height minus a set amount, then just check for hitting the floor, if the player falls for too many game loops (use a counter) then kill him, or hurt him according to the counter value.

Mentor.

PC1: P4 3ghz, 1gig mem, 2x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
alpha zero revolutions
20
Years of Service
User Offline
Joined: 31st Aug 2004
Location:
Posted: 6th Sep 2004 06:56
try nuclear glorie's collision system cause it is superb
nuclear glory
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location:
Posted: 7th Sep 2004 00:52 Edited at: 7th Sep 2004 00:53
Link is:
http://www.nuclearglory.com/ngc.php

Demo version downloads at bottom of page

Lead Programmer/Director
Powerful Collision DLL for DBPro and DBC: http://www.nuclearglory.com
Lightwave Scene Exporter to .X also at: http://www.nuclearglory.com
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 7th Sep 2004 07:04
thanx guys i will give your ideas a try and mentor that sounds like it would work well in my program i will post again when i get some good results.

checking out nukes site now.
LoKiDeCaT
22
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United States
Posted: 8th Sep 2004 02:56
I second NG's collision DLL.

Even Kensupen uses it.

Loki D'Cat - Modeller, Composer, Animator
Nerdsoft Creations

Login to post a reply

Server time is: 2024-11-27 08:46:16
Your offset time is: 2024-11-27 08:46:16