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.

DarkBASIC Professional Discussion / Sparky's Collision help?

Author
Message
3than
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 13th Oct 2011 06:17
Hi.
I just got Sparky's Collision for Dark Basic Pro. For some reason, the command "sc_objectcollision( object1, object2 )" isn't working. It appears in blue in my IDE, but when I compile it, it says "Compilation Failed. Could not understand command at line 23." If this command isn't working, I can't use Sparky's collision at all Can someone please help?
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 13th Oct 2011 06:59
Make sure you put the .dll in your "Dark Basic Pro\Compiler\plugins-user\" folder.
3than
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 13th Oct 2011 09:57
It's in that folder. All the other commands are working except this one.
Daniel wright 2311
User Banned
Posted: 13th Oct 2011 10:24 Edited at: 13th Oct 2011 10:26
I dont use the sparkys ,sc_objectcollision( object1, object2 )" command,for some reason it does not work all the time. I use the dark basic command instead.

if object collision( object1, object2 )=1 then something happens

my signature keeps being erased by a mod So this is my new signature.
3than
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 13th Oct 2011 10:37
Thanks!!! That worked! I never knew Dark Basic Pro had that command! I don't need Sparky's Collision anymore XD
thanks again
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Oct 2011 14:47
Quote: "I never knew Dark Basic Pro had that command! I don't need Sparky's Collision anymore XD"

Don't rule sparky's out just yet. It's far more accurate and flexible. If you have any accuracy problems you may end up returning to sparky's and once you get it running you'll never look back.

My 2c...

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 13th Oct 2011 15:11 Edited at: 13th Oct 2011 15:13
Sparkys collision is more than handy when it comes to grouping objects together (ie lots of object to make up a level).



There are lots of examples like this with proper example code. Also for checking whether a bullet hits, you can use a RayCast which will also give you the coords of the collision and the direction of the objects face. This can then be used for decals.

It may sound complex but a little experimentation will get you there. Programming itself is all about experimenting.

I also believe there's an example in the Code Snippets someone put there recently.

EDIT: Before you use the sc_objectcollision() function, you will need to setup the objects so that Sparkys knows what type of collision to check with. ie sc_SetupObject()

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Daniel wright 2311
User Banned
Posted: 13th Oct 2011 19:38
I did not show you the default command to tell you not to use sparkys,I was trying to show you that you can use sparkys with defult commands at the same time. If I was you I would learn how to use sparkys dll,its much faster and easyer to use with perfect sliding collition.

my signature keeps being erased by a mod So this is my new signature.
3than
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 14th Oct 2011 10:28
Ok, I won't give up Sparky's. But I've been trying to make a FPS level with Sparky's Collision for a while, but nothing seems to be colliding with each other :/ Can someone tell me what's wrong with my code? Here it is:



All the media is attached in a .ZIP archive.

I'm not giving up Sparky's just yet. If it turns out to be good, I'll keep using it
3than
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 14th Oct 2011 10:29
Here's my media:
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Oct 2011 11:05
A couple of things. First you were updating your 'static' world which is not necessary unless you move it. Secondly you don't actually need to turn your camera 'dummy object' into a sparky's object. Just use the spheresliding commands as I have done below in your example to test for collisions between the start position and end position of your camera each loop.


Hope that helps!

3than
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 16th Oct 2011 06:19
Thanks! It does help! I understand it all
Just one problem.
I have stairs in my map, and I can't go up them
I don't know why. It might be because of the jumping height, or something to do with the collision code. I don't know. Have you tested it out for yourself? Try it...

Login to post a reply

Server time is: 2026-07-11 09:49:13
Your offset time is: 2026-07-11 09:49:13