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 / What MAKE STATIC COLLISION BOX () does?

Author
Message
Bulleyes
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 12th Dec 2002 18:01
Can anybody teach me what MAKE STATIC COLLISION BOX() does? Initially I thought it creates a invisible box in the world for collision detection. Then, I realize there can be only one static collision box in the world. Now I am puzzzle.

I would really appreciate if someone can give me a quick walkthrough about the collision detection mechanism in DBpro, perhaps by illustrating each command by their use cases. I had gone throught the examples and help files, but I still don't quite get it.

Thanks a lot! I hoped I didn't bother you guys much.
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 14th Dec 2002 15:38
Make Static Collision Box() is a command used for making invisible collision boxes for your environment. Basically you want to put in all six coordinates for your box into then brackets. So if you wanted to make one at coordinates (x,y,z) and with the dimensions (dx,dy,dz) then you would write:

Make Static Collision Box(x-dx/2,y-dy/2,z-z/2,x+dx/2,y+dy/2,z+z/2)

Here is an example of static sliding collision:

s#=20

Rem Get old positions of character
ox#=x#
oy#=y#
oz#=z#
Rem Here you would put the code for moving your character
Rem Detect for static collision
if get static collision hit(ox#-s#,oy#-s#,oz#-s#,ox#+s#,oy#+s#,oz#+s#,x#-s#,y#-s#,z#-s#,x#+s#,y#+s#,z#+s#)
dec x#,get static collision x()
dec y#,get static collision y()
dec z#,get static collision z()
endif

Basically what your doing is defining the area which you want to be colliding with the static collision boxes, you need the old position and the current position to detect for sliding collision. The first six variables define the old position and the last six define the new position. If the statement tests true then the program decreases the character position by however much it needs to to create sliding collision, I think that the program just used the last area defined in the "get static collision hit()" command for the sliding collision commands (get static collision x(), etc).

And you can make as many static collision boxes as you want, not just one. If you use the "make static object()" command then you can make static objects (objects that cannot be altered during the game) to go with your static collision boxes. You have to make an object (for example object "1") first and then just type "make static object(1).

Hope this helped.

Bulleyes
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 15th Dec 2002 08:29
Thanks Hamish. You are da best!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Bulleyes
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 15th Dec 2002 08:33
Oh... BTW, meaning that once a static collision box is created, it can't be altered or removed from the world? What if I want to reinitialze the world?

Thank again!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 15th Dec 2002 15:37
I think it is kind of like a big collision box that you just keep adding to so the only way to delete static objects is to use the "delete static objects" command but this deletes the whole of the static objects but I dont know whether it deletes all of the collision boxes too, youll have to try that for yourself. Although there is a command to make a temporary static object - "attach object to static" but I havent tried it yet. The is also one to make temporary static objects into normal objects again - "dettach static object". Glad to be of service.

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 15th Dec 2002 15:38
oh yeah, im using the normal db, so you may have to alter a few things for it to work,sorry.

Login to post a reply

Server time is: 2024-04-18 03:26:34
Your offset time is: 2024-04-18 03:26:34