collision array?

Posted By: oronll

collision array? - 01/07/07 08:38

Is there a way to make the collision detection follow a array instead the set modes?

or maybe not even an array . just a variable will do .
Posted By: HeelX

Re: collision array? - 01/07/07 09:49

I dont know what you exactly mean when you talk about arrays 2D collision detection comes into my mind and when you talk about variables I think about something like

var colisionMode;
collisionMode = IGNORE_ME + IGNORE_MODELS + GLIDE;

if its the second option, just do it like that. Combine all collision modes in one variable and use 'collisionMode' in your c_move or c_trace instruction as you like.
Posted By: oronll

Re: collision array? - 01/07/07 10:24

I meant more like .. If i could tag all these entities here my.skill2 = 2; .. and all these entities over here my.skill2 = 3;

and then somehow tell the entity you have c_move on to ignore all entities with skill2 = 2;
Posted By: HeelX

Re: collision array? - 01/07/07 12:58

So that entities tagged with 2 overrun the entities tagged with 3? Easy! Just have a look of the meaning of "push" for the c_move instruction. By this you can define different push values for "groups" in an array and you link entities via a skill to the appropriate array field, e.g.

my.skill2 = 10; //group10

var pushArray[100]; //for hundred groups

pushArray[10]=2; //group 10 has now the push value 2

in the entity's while loop:

my.push = pushArray[my.skill2]; //update push value

and you use then in c_move IGNORE_PUSH to overrun all entities with a lower push value. So, if you assign one group the push value 1 or -10 or such group10-entities will overrun these.
Posted By: oronll

Re: collision array? - 01/07/07 20:07

I have tried that but there is one major flaw .. if they both have to use collision detection PUSH will not work since one is always higher than the other .

They should have made entities with equal push NOT collide .


anyway push doesn't work for this case .
Posted By: oronll

Re: collision array? - 01/07/07 21:07

Here is exactly what I need ..

I need a way for everything to be passable but still trigger a hit detection .. that would solve my problem .
Posted By: Scorpion

Re: collision array? - 01/07/07 22:18

you can use enable_entity then the push must be lower...
Posted By: oronll

Re: collision array? - 01/07/07 23:56

i am telling you push does not work the same way ...

ok lets put it this way ..

You have entity A and entity B ..

Entity A has

my.push = 10 ;

my.enable entity = on;

VAR SP[3] 12,0,0;

c_move (my,nullvector,sh, IGNORE_PUSH );



Entity A has

my.push = 5 ;

my.enable entity = on;

VAR SP[3] 12,0,0;

c_move (my,nullvector,sh, IGNORE_PUSH );




these 2 entities will never pass through each other because both are using thier own collision . but both have to .
© 2024 lite-C Forums