Included Groups for Health Behavior

I want to modify the health behavior so that no damage is received if the actor collides with a certain actor. I can't just use the inflict damage behavior because that would effect the damage given to the asteroids that collide with one another. Basically if an asteroid collides with another asteroid no damage is received and they bounce off each other. That is what I want.

So how do I make it so the actor doesn't take damage when it collides with an actor of specific groups.

Epic428

  • Posts: 1118
I haven't played with the Health pack much, so there may be an easier way.

For now, the best way I could see this done is with the block under collisions [group for colliding shape]

check that and see if it is equal to the ship or asteroids group, and depending on which one, inflict damage or don't
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

Greg

  • *
  • Posts: 1259
You could add a check in the Health Behavior to look at the group of the Actor being collided with.  Compare it to the group of the Actor doing the check and then quit out if you don't want any damage applied.

Or we can add an enhancement to include a new List attribute that lets you specify any Actor groups that you don't want to apply damage.

edit: ninja'd

Greg

  • *
  • Posts: 1259
The best we can do is create List attribute in the Health behavior.  The user would have to type in the names of the Actor groups that they'd want to exclude. 

Or we could add the List attribute to the Inflict Damage behavior and have it exclude certain groups that way.

Epic428

  • Posts: 1118
Under Scene -> Actors there is a section called "Get actors in group" you want the blue block as that has the group names
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs

Greg

  • *
  • Posts: 1259
The best we can do is create List attribute in the Health behavior.  The user would have to type in the names of the Actor groups that they'd want to exclude. 

Or we could add the List attribute to the Inflict Damage behavior and have it exclude certain groups that way.

But how do I get the groups by name rather then by an group block or group attribute.

I'm not sure if I follow.  The group blocks return the same thing as the group name. 

Greg

  • *
  • Posts: 1259
Ok so now you're talking Actor Type instead of Actor Group?  I may need a more detailed explanation of what you're trying to do.

My understanding is this -

1) You have the Health behavior attached to an asteroid
2) You also have the Inflict Damage behavior attached to the asteroids
3) You don't want collisions between asteroids to inflict damage on each other

To do this, you can create an Actor Group type attribute.  In the "when collided" logic - check to see if the group of the last collided Actor (there's a block for that) matches the attribute that you created.  If so quit out.

If you didn't want to limit yourself to one Actor group, you would create a List attribute and populate in the names of the Actor Groups that you didn't want to inflict damage.  Then in the "when collided" logic, you'd loop through that list and check if the Actor Group of the last collision matches anything in your list. 

If you wanted this to check Actor Types instead, it would be the same logic - just replace the group blocks with the type blocks. 

It's possible that I'm completely misunderstanding what you're asking.  If so, could you outline exactly what you want to do?

Epic428

  • Posts: 1118
Here:

That kind of does the opposite, a few not equals or other mods will get the exact example discussed above

« Last Edit: April 25, 2011, 03:05:49 pm by Epic428 »
James Moore - Official Support & Documentation.
We cannot and will not respond to PM's asking questions. Please make a new thread in the forums if you have any questions, Thank you.
For better support and faster response times, please post your logs regarding any Stencyl related issues. Debug > Logs > Generate Logs