on collision -> any actor BUT not event actor?? possible?

Game Editor comments and discussion.

on collision -> any actor BUT not event actor?? possible?

Postby sonicfire » Sat Jun 30, 2007 5:41 pm

Hi there!

I hope the topic title isn´t confusing, what i want to have/achieve is:

I have a bullet, whenever it hits anything it should just destroy itself. That works fine using collision with "Any Actor". My problem: Of course now, when this bullet hits itself (when two bullets collide) they destroy each other!

Is there a way to avoid this? Something like "On Collision with Any actor but not with itself" :oops: ?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Postby d-soldier » Sat Jun 30, 2007 7:19 pm

I have never been able to use the "anyactor" because the background (sky) is an actor too... So I would suggest spelling it out, add a collision event for each object you want it to collide with.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby sonicfire » Sat Jun 30, 2007 8:46 pm

thanks, d-soldier! :)
yes, i guess that´s still the best way to do it - i was just curious!
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Postby Fuzzy » Sat Jun 30, 2007 10:28 pm

d-soldier wrote:I have never been able to use the "anyactor" because the background (sky) is an actor too...


Do you ever want to collide with the sky? if not.. in sky's create actor event, do the collision state action and set it to FALSE.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby d-soldier » Sat Jun 30, 2007 10:44 pm

Didn't think of doing that before.... nice way to think outside the box.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Kodo » Sat Jun 30, 2007 11:01 pm

Fuzzy wrote:
d-soldier wrote:I have never been able to use the "anyactor" because the background (sky) is an actor too...


Do you ever want to collide with the sky? if not.. in sky's create actor event, do the collision state action and set it to FALSE.


I tend to do this on any objects that will never need to receive collisions, including interface objects and backgrounds. I'm not certain but it must help keep the frame rate up in a complex game if it's not having to check so many actors for collision. Especially when I work mainly on Pocket PC and GP2X where you don’t have the raw power found in the desktop systems to throw at a game, I figure every little saving helps :)
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby Fuzzy » Sat Jun 30, 2007 11:12 pm

Kodo, You would have to ask Makslane to confirm that, but I suspect you are right. GE would compile several lists of actors(collide, no collide, out of view, not created,....) and check collisions(and other things like draw) against only some of those.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Sgt. Sparky » Mon Jul 02, 2007 4:27 pm

I made a Demo on how to do this a different way so certain actors can still have collision events:
...Argh I can't find it.....
just make a variable called value and make it an actor variable,
and on the create actor events of the actors you want your player to collide with use,

Code: Select all
value = 1;


and on collision on any actor,

Code: Select all
if(value == 1)
{
    //...code here...
}

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron