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 / opening doors

Author
Message
monkeyboy
19
Years of Service
User Offline
Joined: 24th Oct 2004
Location: England
Posted: 14th Dec 2004 02:12
I got a cube object wich i am using as a door and i want it to open when you are touching it and press space but at the moment you have to be running into it cause im using the object collision command. Is there another way so u dont have to hold down a key but u still have to press space?
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 14th Dec 2004 03:49
you could use a hidden box in front of the door to detect the collision instead, and then when the player collides with that box they can use space to open the door.Use the hide object comand to hide the object.



Part of solving the problem is actually noticing that the problem is there in the first place

monkeyboy
19
Years of Service
User Offline
Joined: 24th Oct 2004
Location: England
Posted: 14th Dec 2004 04:01
I tried this but to allow you to enter the box i needed to set collision of the box off and then i didnt detect the collision obviously lol
Clownpaint
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: England
Posted: 14th Dec 2004 07:45
Im a total noob but this makes sense to me, not tested, turning off object collision whenever they press space shouldnt have any effect unless they are near it. You could test for distance too if you have ai that you dont want walking through when you hold space but im not that good yet .



indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Dec 2004 19:13
the easiest door is the one you would think lives on a spacecraft or in a space station.




saloon doors are a little more tricky but if you added a collision cube either side of the door you would know what way to push the door, away from the player object.



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
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 16th Dec 2004 05:08
Quote: "I tried this but to allow you to enter the box i needed to set collision of the box off and then i didnt detect the collision obviously lol "


why not? dont use sliding collision with it, just use if object collision(a,b)=1 then...

btw indi, your second code snippet doesn't work.

Part of solving the problem is actually noticing that the problem is there in the first place

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 16th Dec 2004 09:47
works for me let me check it

...

still works fine here, what error do u get?

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
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Dec 2004 13:16 Edited at: 16th Dec 2004 13:21
They work here too. No errors. Just a little bug when you are on the line of opening and not opening (door jitters).

[edit] In this version


Walk slowly towards the door.

Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 18th Dec 2004 05:15
it compiles and runs, but I found that the doors only open one way (I was talking about method 3, but it was the second code you posted)

Part of solving the problem is actually noticing that the problem is there in the first place

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 18th Dec 2004 10:30
if you add two collision cubes and hide them or shape them like door mat sized objects you could achieve the opening and closing according to what direction the character was approaching.

I gave u a super head start, if you cant apply yourself and add extra features then think up your own method to achieve the result and show us what you came up with.

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
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 19th Dec 2004 04:14
mmm, i was just telling you that it didnt work properly. Personally, I dont have any use for that code at the moment, although I may use something similar in a future project. thanks anyway though.

Part of solving the problem is actually noticing that the problem is there in the first place

Login to post a reply

Server time is: 2024-09-23 07:34:06
Your offset time is: 2024-09-23 07:34:06