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 / .dbo collisions upon game loading

Author
Message
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 16th Apr 2012 19:12
I have created a level using T.Ed and exported it as a .dbo with alpha and then loaded it into my game. I turned on global collisions as there are 50 some objects and then used Object hit (object number, 0) to detect collisions between an object that is following my camera and any of these .dbo objects. However, as soon as the cammera moves it registers a collision even if the camera is no where near the object but only when it is above the object. Any ideas on what is going on?
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 16th Apr 2012 22:27
Hi CmdrDoughnut

If you post some code, I or someone else will look at it and probably be able to figure out what's going on. Without any code it's impossible to say.

If you don't know (I'm going by your "joined date here"), to post code so it's in a code box:



paste your code into the message box, highlight it then press the "code" button at the top right of the message window.
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 16th Apr 2012 23:34
Thanks.

This is the code to load the objects.



And this is my collision testing where spherenumber is the object number of a sphere that is following the camera.

29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 18th Apr 2012 00:08
I don't think there is a problem with the collision code. It seems straight forward enough. I think the sphere is actually colliding with the map.

When you load the objects, try setting the object collision to polygons using the SET OBJECT COLLISION TO POLYGONS command. It may be that your map objects are defaulting to box collision (I had this problem with my recent 20 line challenge).

Or

When you're running the program, I'm guessing that you can't see the sphere that's following the camera as it's behind the camera, is this correct? If so the only thing I can think of is that the sphere is not where you think it should be, which would explain why it's colliding with the map when you think it should be no where near the map.

Try the first idea and if that doesn't work have a look at the code controlling the sphere position to see if it's doing something unexpected or post it if you can't find anything.
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 18th Apr 2012 22:18
That fixed the instant crash but now only sometimes the objects register a hit. It's like the there is a timing issue that doesn't always catch the collision as sometimes I go through and sometimes it works right off the bat. If I go through I stop and sit around and sooner or later it will register. I find this odd as there are only 500 or so lines of code. If I run strait into an object it doesn't register the hit but if you fly at an angle and hit it it will. Would a bigger sphere help this?
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 23rd Apr 2012 11:49
If you only have 500 lines of code then you might as well post the whole lot. However, it may be the models themselves so you might as well just post the whole lot, dba and project files and all the media and I'll have a look if you want.

Or you you can try converting the models to .x format. I've never had a problem with these.
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 23rd Apr 2012 22:37
I think I have the collisions working now. I just did try loading a .x file containing props from ted and now there are black squares around the props. Do I have to chromakey these out?

29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 2nd May 2012 00:25
I've not used T.Ed so I don't know what's going on with it. I make everything in Blender (which I'm still getting to grips with) but I've never had a problem getting it to work with Sparky's.

Sorry I can be of more help but you've now gone beyond my knowledge of 3D models / modelling, I don't even know what "Do I have to chromakey these out?" means

I hope you got it all or are getting it sorted out.
CmdrDoughnut
12
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 4th May 2012 07:44
Chromakey is telling the computer to make a certain color transparent so you can see through areas of objects that are of the color you set. I believe the command is "set colorkey" or something along those lines.

Login to post a reply

Server time is: 2024-11-21 23:36:51
Your offset time is: 2024-11-21 23:36:51