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 / Why don't my sliding doors work?

Author
Message
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 26th Aug 2005 03:03
I just started this game called Hall of Death but my sliding doors don't work. The right right hand door knocks the other one back! Help!

Nick Tsianos
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 26th Aug 2005 05:21
the source button on your post resulted in an error.

a good way to handle sliding doors is to know the players object number say 1
and the doors might be objects 2-10

this way you can perform a distance check, if the players object is within a certain
radial distance to the sliding door object then activate the door.

Distance Functions are everywhere in this forum, you will find many distance functions for 3d and 2d usage.

You can however use 2 dimensions of detection in a 3d space, so crimping a 3d distance function to only look across the X and Z dimensions helps to improve speed when distance checking with varied objects.

if that makes no sense just read it later after you have some distance functions to look at.

sliding of the door is to move the door in one of the dimensions and stop after a set distance

for example the doors size was 10x10x3

if the door was facing us so it slid across the X dimension (thats left to right) and we want to slide it to the right or positive X dimension space.

since we know the object is 10 units in the X dimension we could slide it 10
and it would slide exactly to the left one whole door unit.

im not on a pc at the moment, i had some examples of sliding doors at home, ill try and post them later, but it may be a few days before i get back there.

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself 
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 26th Aug 2005 13:17
Nick The Dude,

Here is some example code I wrote a while back for another thread. You will need to download the .x objects that I have attached to this post, in order to run the code.




+NanoBrain+

Attachments

Login to view attachments
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 26th Aug 2005 19:56
Here is my source code and 1 of my doors because i don't think you understand the problem.

Note the 2 doors are the same so just 180 it.

Nick Tsianos

Attachments

Login to view attachments
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 1st Sep 2005 04:42
Oh I got U. Thanks indi!

Mysteries Surround You

Login to post a reply

Server time is: 2024-09-24 03:19:29
Your offset time is: 2024-09-24 03:19:29