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 / sliding collision

Author
Message
FiShFuN4eVeR
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Netherlands
Posted: 14th Jun 2003 20:23
Can enybody help me with a simple sliding collision? It has to work with a word made in MagicWorld.
If good programmer()=1 then print "Finaly I get to the top "
FiShFuN4eVeR
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Netherlands
Posted: 15th Jun 2003 16:31
Nobody? Isn't there a site or tutorial whitch explain how to do it?

If good programmer()=1 then print "Finaly I get to the top "
FiShFuN4eVeR
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Netherlands
Posted: 15th Jun 2003 23:21
Hey,

figured out how to do that

Now I use this code



and this in the loop



still there is a problem

It works fine on boxes and cubes, but when I have a tree, and even a building to walk in, you will get the collision of a box
Isn't there a way to reject this so that it will only do a collision when he hits the wall???

If good programmer()=1 then print "Finaly I get to the top "
Misanthrope
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location:
Posted: 15th Jun 2003 23:44
I'd use the static sliding collision and create static boxes for each wall.

Yes, the unfortunate side effect is that you're limited to 0-90-180-270 sliding collision, BUT it'll work.

For trees, you only want to encapsulate the trunk within the collision box and not the branches and leaves.

Now for some more helpful information...

What you want to do is to automate the process of building the static collision boxes. Ideally the source model isn't a single mesh, but a collection of separate meshes (called limbs in DB) that comprise a single object like a house.

If you build the house in such a manner that every wall and item of furniture strictly adheres to the 0-90-180-270 collision scheme, you can create a static collision box for each limb and expect it to behave sensibly. You can add this into the MagicLoad function yourself.

I know it's not as impressive as full polygonal sliding collision, but it's the simplest and fastest route to sliding collision.

-Misanthrope
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Jun 2003 04:17
For sliding collision you could use my functions I made in the code snippets section "Sliding Collision Made Easy" for like object collision. For the matrix, just do thi

Position Matrix num#,0,0,0
y#=get ground height(num#,x#,z#)
position object x#,y#,z#

Then just plug in your variables.

Num# is Matrix Number
X# is Object Position X(object number)
Z# is Object position Z(object number)
Y# is used as the objects Y position using the GET GROUND HEIGHT command.

Cheers

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
FiShFuN4eVeR
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Netherlands
Posted: 16th Jun 2003 13:07
Yes, but I defenetly don't want a bulding on 0,90,180,270
Besides, I don't think it would be easy to draw hunderts of collision boxes for a building
What about full polygonal sliding collision, will the speed drop down to far or something???
The only thing I want is a little help by a code whitch draws a collision box on every polygon or a collision whitch works on polygons! Isn't there a way to do that?

If good programmer()=1 then print "Finaly I get to the top "
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Jun 2003 18:15
With my function you can do this....

CollBox(object number, rotation flag)

Then to turn object collision on you just say

Slidecoll(Object number 1, object number 2 (can be set to 0))

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
FiShFuN4eVeR
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Netherlands
Posted: 16th Jun 2003 19:48
all righdy

If good programmer()=1 then print "Finaly I get to the top "
FiShFuN4eVeR
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: Netherlands
Posted: 17th Jun 2003 20:46
Hmmm,

little prob. It says in the collbox function: object doens't exist at the first line. but I already made the object, I only am testing how big the object is Suggestions?

I have an other idea. If I make a collision box for me like in the normal sliding collision, and around that a hided box witch moves along with me. Then, if the second box collides with any object, it will stop moving along with me, so that I can get a collision with it. In this way it will save me drawing all the collision boxes, it will hopefully save speed and it works at any angle x-d

I think I'm gonna do that. Can somebody help me with that, or is it a stupid idea????

If good programmer()=1 then print "Finaly I get to the top "
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 17th Jun 2003 21:38
The object should exist,,,,try

Make Object Cube 1,10
Collbox(1)

do
slidecoll(1)
loop

Or if your using classic

x#=1
Make object cube x#,10
Collbox(x#)

do
Slidecoll(x#)
loop


RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!

Login to post a reply

Server time is: 2024-11-24 18:49:04
Your offset time is: 2024-11-24 18:49:04