3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Putting OBJ_X in Arrays  (Read 1211 times)

« on: September 20, 2009, 07:24:25 AM »
I can create an array of OBJ_X like that:
int[]Array01={OBJ_0,OBJ_220};

But if I do:
int[]Array02(2);
Array02[0]=Array01[1];

The value of Array02[0] dont seem to correspond anymore to OBJ_220.

Is it normal or am I doing something wrong?
If it's normal would there be a way to change that?
« Reply #1 on: September 20, 2009, 07:58:53 AM »
My 3Drad may be corrupted, I have a lot of strange errors.
Going to chek that...
Thank you :)
« Reply #2 on: September 20, 2009, 11:42:58 AM »
Also lookup iObjectHandle() it's the default "array" of obj_'s

Like this would put all obj_'s in an array, but its not really needed since iObjectHandle() is the obj_ array itself

for (int i;i<iObjectHandle(-1);i++)
{
    Array[ i ] = iObjectHandle(i);
}
« Last Edit: September 20, 2009, 11:45:41 AM by shadmar »
« Reply #3 on: September 20, 2009, 12:34:16 PM »
So I just need to store the positions of the OBJ I need in iObjectHandle?
Something like this:
Code: [Select]
int[]Array01={0,3};
for (int i=0;i<Array01.length();i++)
{
iObjectHandle(Array01[i]); //-> My 2 objects are here
}
And if I have to change the order of the OBJ in the Array I just have to change the Array01 order.
Thank you I will test that tomorrow :)
« Last Edit: September 20, 2009, 02:16:49 PM by IronF »
« Reply #4 on: September 20, 2009, 01:30:08 PM »
It's more like iObjectHandle is the array of all your OBJ's

so if you have OBJ_0, OBJ_22, OBJ_44 .... OBJ_N

iObjectHandle(0) will be OBJ_0
iObjectHandle(1) will be OBJ_22

etc...

iObjectHandle(-1) returns is total OBJ's..
« Reply #5 on: September 20, 2009, 02:16:01 PM »
Oh, yes, I made a mistake in the previous post, just edited it :)
Thanks again :)
Pages: [1]