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.

Author
Message
The Great Poe
User Deleted
Posted: 4th Aug 2004 15:48
DBPro

Okay. I'm trying to either make it so when you get close enough to a door, it opens, or make it so when you get close enough, you can press space bar and it opens. How would I do that?

I had one worked out, but it kept crashing the game.
The Great Poe
User Deleted
Posted: 4th Aug 2004 15:50
I'm sorry. I forgot to mention. The source code I included was changed from the original, cause I was trying to JUST test the distance (which still crashed the game).
AsriCE
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 4th Aug 2004 20:28
Halo, I think what crashes your game is this line:

Quote: "
`tests if door will activate
if len# < 40 `and doorup(obj) = 0 <-----"


Solution? You need to separate the lines using the semi-colon symbol as follows:



An alternative way to check if your player is close to a door is to use something which I call "Zone Check". What it does is that it checks to see whether A Coordinate is inside the defined rectangular zone. Here is the function:



I believe the function is self-explanatory. To see if the player is close to a door, check the player against the doorstep-zone. If it's at the doorstep, then it will return a value of 1.

AsriCE Crew,
- Adi

There's only one hope.
The Great Poe
User Deleted
Posted: 13th Sep 2004 05:27
Sorry. I forgot about this topic too.

But thanks. That's gonna be really helpful.

I HAVE DARKBASIC PROFESSIONAL!!!!!!!

www.parallelpark.tk

Login to post a reply

Server time is: 2024-09-23 00:23:30
Your offset time is: 2024-09-23 00:23:30