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 / Collision between two .x objects

Author
Message
midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 4th Feb 2011 00:19
Is there a way to handle collision between a level mess .x and a model .x ? Tried sparky collision but it crashes my program.I already copied the dll in the compiler\plugins-user.
SH4773R
14
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 4th Feb 2011 09:28
You need the keywords file 2, read and follow the instructions for install closely and it should work, or use the search bar and type collision
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Feb 2011 11:22
Yes, sparky's is more than capable of doing this. Check you have put the "ini" file in the "keywords" folder and the "dll" in "plugins user" folder.

I would use sc_setupcomplexobject as suggested in the help file for the level.

midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 5th Feb 2011 02:24
I thought the ini was optional.Anyway this is not the problem cause the examples are running fine.Its my code.I was putting a setupcomblexobject command to see if the program compiles.But only this command crashes the program i think.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 5th Feb 2011 05:06 Edited at: 5th Feb 2011 05:06
Quote: "I thought the ini was optional."

It is, but it's very helpful because it makes the commands highlight (turn blue) in the editor.

Could we see what code you are using to set up your world? Have you included a memblock command in your code? (I'm not sure if this is necessary in more recent versions of Sparky's).


Guns, cinematics, stealth, items and more!
midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 5th Feb 2011 18:08
I am trying to do a simple thing cause i am learing dbp.So as you can see i want some simple collision between these .x models.Tried the builtin collision(as polygons) but its giving me collision only when i move the round object to the center of the level.

kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 5th Feb 2011 18:45 Edited at: 5th Feb 2011 18:46
By the way, you don't need sparky's. You can use built-in DBPro collision. Like that:



Actually both can be polygons-collisions, but then the collision check will be slower

In progress of making Archery Simulator... Or maybe not simulator x]?

@There'll be a sig @
midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 5th Feb 2011 19:58
I attached the screenshot.So the "level" is this .x rectangle .I only get collision when i am outside this area and hit the wall.When i am inside i dont get any collision while hitting the wall.Thats weird.

I thought i would export the rectangle in pieces and reassemble it in my game.1 ground and 4 walls and apply box collision to them.That will work i guess.But what if i had a much more complicated level.I cant export a map piece by piece.

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 5th Feb 2011 22:53
I remember, that i had the same problem. Did you do exactly:



and nothing else like

set global collision on?

If yes, then try setting both object collisions to polygons.

In progress of making Archery Simulator... Or maybe not simulator x]?

@There'll be a sig @
midgr
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 6th Feb 2011 19:40
I tried with both polygon collision but i got the same result.It only collides outside the level.I didnt tried to set global collision on cause there are 2 objects only and ive already gave them polugon collision.

For the moment i made 4 invisible walls and checking collision against them and its working.

Login to post a reply

Server time is: 2024-09-29 00:23:42
Your offset time is: 2024-09-29 00:23:42