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 Discussion / Creating a single object from several

Author
Message
DARKHALO2K
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: UK
Posted: 9th Mar 2008 21:07 Edited at: 10th Mar 2008 11:56
Hi there. Whilst playing about with meshes I noticed that a few people have kicked up the desire to turn multiple objects in to one, for the sake of collision handling, or the like.

My simple work around is not to worry about meshes or limbs, but instead to use a variable with which to group the objects together.

This wont be new to a lot of people but in declaring a variable at the start of your game that includes all relevent object numbers you can simply state the variable name in place of any single object number during your functions.

In using a variable you can also change the numbers contained during play, which may be of a help in using dynamic objects in global functions.

Whilst simple, I hope that is of use to someone.
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 10th Mar 2008 03:17
Please post how you did it so that other people with the same problem can search for the thread and have the problem solved for them.

Seriously, how do you make the little blue text come up below your message?
DARKHALO2K
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: UK
Posted: 10th Mar 2008 11:41 Edited at: 10th Mar 2008 12:01
EDIT : My original post now shows my simple solution to not wanting to toy with meshes or limbs in creating a single object from multiple. I hope my rambling is a help to somebody!?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Mar 2008 20:27
@DARKHALO2K

I don't understand what you are saying. Please give an example. Thank you.

Enjoy your day.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Mar 2008 00:32
It sounds to me that you are using bit-like numbers to store the object numbers in one variable, but that seems pointless so I don't understand you either.

The way I'd do it is turn off collision for all the objects and make a box that surrounds all of them, hide it, and detect collisions on that.

You can add objects as limbs so they'd belong to the same root object.

Is someone thinking of making a kind of katamari game?

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Mar 2008 23:13
I thought about this a little and perhaps DARKHALO2K means this:
Since you can have 65535 different objects, we could assign a range of objects up to 100 for the terrain. The terrain itself, rocks, trees bushes, whatever. When we check for collision, with terrain, we check for a returned number that is <= the top limit of the collection of colidable objects for that group.

For example:


Enjoy your day.

Login to post a reply

Server time is: 2025-06-04 03:21:33
Your offset time is: 2025-06-04 03:21:33