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 / Collisions and Gravity...Please help.

Author
Message
gbison
13
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 15th Dec 2010 18:34
Hello all,

I been using the Dark Basic Pro lang for a while now, I don't ever post on here because usually up until this point I can figure it out or get the information from the forum searches, but Im at wits end here and I really need some help.

I have started through text and 2D programming and feel fairly successful as I have written a couple of text games, a couple applications and some 2D shooters all from scratch just to use as learning tools so yep you guessed it, Im trying for 3D now and wow seems much more difficult...lol.

So to get to the root of it, heres what I have done. Rather than jump in trying to create a game I usually setup something as a learning base when im doing something new, so to start 3D what I did was basically pick a 3D character model from my dark matter pack and then i whipped up a make shift dungeon room from Cart Shop. I setup the code for these two models, loaded them into the world, programmed up some 3rd person camera tracking, setup animations on my model and placed the character inside the model for testing. All this worked well, no problems. So now I got my character walking around the room everything seems cool but two facts remain, I can walk right through the room and I have no sense of gravity, which brings me to my question...

How in the world do I get correct collision on my models so that my character can walk around in the room, yet not be able to walk outside of it. I have put collision on these models and the problem is, it wont activate until i move the character outside the room and then collision activates and wont let me pass back into the room??? I need it to work inside and out obviously. Secondly, what is a proper method of achieving some sort of gravity so that my chracter will fall when not on a model service or for something as simple as jumping??

Im sorry for the length here, just trying to explain myself the best I can. Hope someone can help, if you need more information please just let me know. Btw I have sparkys dll installed but again, Im not coming to grips with it in someway I suppose.

Thanks all!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Dec 2010 10:39
Using collision only 'detects' the collision. You then have to deal with the results.

The collision system in DBP is not great. I would seriously get sparky's collision dll (free) and try some of the demos that come with it. It will get you well and truly started in 3D.

There is an excellent resource here but do consider sparky's as a starting block for collision:
http://forum.thegamecreators.com/?m=forum_view&t=95770&b=7

gbison
13
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 16th Dec 2010 20:11
Thanks for the information, I actually got it to work yesterday evening. I think I have a better grasp on gravity as well. I just had to wrap my head around it.


Thanks again
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 17th Dec 2010 00:26
Glad you're getting it but seriously, sparky's is one of only three plugins I swear by for 3D.

Login to post a reply

Server time is: 2024-09-29 00:17:29
Your offset time is: 2024-09-29 00:17:29