Exploding Actor Resource Pack

coleislazy

  • *
  • Posts: 2607
I've uploaded my Exploding Actor behavior as the Exploding Actor Resource Pack on StencylForge!

All you need to make it work is the Gib actor and the Explode Actor behavior attached to the actor you want to slice up! Just use a messaging block to call "explode" in behavior "Explode Actor" to do the deed.

It supports different gib sizes, plus you can add your own, if you add an appropriately sized and named animation to the Gib actor (check the description on SF for more information on this).

All of the Gibs support full physics, as they are all actors themselves. If you do allow them to be affected by physics, however, it can put a serious strain on your frame rate!

Also included is a behavior for your gibs to make them fade out and recycle after the specified time.

Check out the example game attached to the resource pack on SF, or go here: http://www.stencyl.com/game/play/6670

Enjoy!

joelbelo

  • Posts: 45
That is fantastic.
Congratulations!
But one thing i saw is that the frame rate drops a lot when the derbis appear

coleislazy

  • *
  • Posts: 2607
Yes, that is true. I would severely limit the use of this effect, and I would strongly recommend disabling collisions. That being said, it is a lot more fun with physics!

ArtemisFowl2nd

  • Posts: 2
 :'( I can't get this to work? What exactly, step by step, do you do?  :'(

I'm distressed here, and I am really frustrated. Lets say my actor looks like a blue block. How to I get it to explode on contact with another actor?

coleislazy

  • *
  • Posts: 2607
You could set it up like in the following screen shot. The only really important thing is the messaging block. You can use whatever logic you want to determine if it should explode or not. Beyond that, make sure you've attached the Explode Actor behavior to the actor you want to explode, and make sure you've set up the attributes on the Behaviors tab of that actor.

ArtemisFowl2nd

  • Posts: 2
If you made the example that you made into a downloadable game, and not just a resource pack, then I could see how you did it and thereby understand better. Or show me where I can do that.

coleislazy

  • *
  • Posts: 2607
Ok, the game is up as Explode Actor.

sgtgutbuster

  • *
  • Posts: 10
[SSSS]

kcorb

  • Posts: 5
This is a really neat effect.

I tried using it as a death effect, but sometimes it doesn't work. The actor will just disappear without breaking up into gibs, but other times it works, and I've tried different gib sizes and velocities but it still does the same.

Also, when it does work and the actor breaks up, the gibs collide with tiles and other actors (who are in the same collision group, but aren't set to collide with themselves). It actually triggers the other actors to 'die' also. But the gibs will go right through the player actor.
I was wondering where the gibs get their collision information? I tried putting the "Gib" actor in it's own collision group with no collisions set, but that didn't change anything.

Thanks for any help!

Pic is of how the explode is triggered.


coleislazy

  • *
  • Posts: 2607
The collisions are handled just like any other actor. I think the Gib is part of the Actors collision group, but I'm not certain. You should be able to change it to whatever group you want. Just remember to set the collisions properly for that group.

Also, I'm not sure why it wouldn't be exploding. It my tests it has always worked. Is it possible that something is killing the actor before it gets a chance to hear the explode message?

kcorb

  • Posts: 5
I'm using the "Explode Actor" to kill the actor.

I tested it a bit more and the gibs are taking on the properties of the player's projectile actor, thus hitting the wall and killing other enemies.

coleislazy

  • *
  • Posts: 2607
I don't think that is because of my behavior. I just double-checked the code, and nothing about collisions is set. The Gib is part of the Actors collision group by default. You may want to consider creating its own collision group so you can control what it collides with. To do that, go to Game Center->Collision Groups and create a group then select the other groups you want it to collide with. Then open up the Gib actor and go to the Properties page and change its group.

kcorb

  • Posts: 5
As I said before I already tried putting the gibs actor in its own collision group, but that didn't change anything. But now I don't think it has anything to do with collisions, the gibs are taking on the properties of another actor, not just collisons, taking behaviors as well, just still looking like gibs. I might mess around with your behavior later in another test game.

Thanks for looking and helping anyway!

coleislazy

  • *
  • Posts: 2607
But now I don't think it has anything to do with collisions, the gibs are taking on the properties of another actor, not just collisons, taking behaviors as well, just still looking like gibs.

Not to sound like a jerk, but I don't see how that would be possible. If that is happening, it would be a major bug with StencylWorks itself. Would you be able to provide a copy of your game so I can check it out? You could upload it to StencylForge and make it public, or zip it and attach it here. If you do not want the public to be able to see it, though, contact me with a private message and I'll give you my email address. Thanks!

kcorb

  • Posts: 5
Haha, ok. I uploaded "Explode Test" to the 'Forge.

I just took the shooter kit, threw in the explode actor pack.