|
Post by lifevirus on Oct 9, 2015 21:20:07 GMT
I'm trying to create a composite killable that dies when all the child killables are killed off. I have it set up as a listener that activates a playmaker FSM event that deal damage when a child dies. My problem is that for some reason it worked before but after a recent update it no longer take the damage but the event is activating. I'm using the Core Game Kit Killable Take Damage using the owner (parent killable) as the only script item. Am I doing something wrong with the listeners or does having invulnerability prevent scripts from dealing damage in any form? Hopefuly this diagram helps: - Parent Killable (Has Killable Playmaker Listener Script attached)
Hookup: Destroying Killable (Damage event, deals 1 damage to parent via playmaker script)
- Child Killable
Listener is Parent Killable
|
|
|
Post by DarkTonic Dev on Oct 10, 2015 0:52:59 GMT
Being invincible still deals damage, it only prevents being damaged. i.e. the parent can never be damaged if a child exists if you set it up that way.
The child Killables (all of them) should have the FSM, not the parent.
|
|
|
Post by lifevirus on Oct 10, 2015 5:39:28 GMT
But why? Doesn't the FSM need to be on/with the Killable Playmaker Listener to even work? If the FSM is on the children it does nothing as the way I see the listeners working is the parent listens to the children and (when done right) once a child dies, the listening parent notices it and activates the "destroyed killable" FSM event which causes damage. I had this working on a build prior with invuln on and I don't get why it stopped working now.
The read me doesn't really go much beyond "Put listener script on X and then put X as the 'listener' on what you want it to listen to" so baring a issue with bypassing invulnerability I don't get what I'm doing wrong.
|
|
|
Post by DarkTonic Dev on Oct 10, 2015 19:03:46 GMT
The parent doesn't "listen" to the child at all. It just checks if children exist when it takes damage, when using the setting "invincible while children alive" which you should have turned on for what you want. That part has nothing to do with the Listeners concept in CGK.
You should use the Destroyed event on each child with the Killable Playmaker Listener and tell the parent to take damage (and obviously hook up the Listener field of the child Killables to the Playmaker Listener so the Listener will be active). The parent won't actually take damage until you destroy the final child though, due to the setting above.
|
|
|
Post by lifevirus on Oct 13, 2015 23:43:06 GMT
Sorry for the late reply but I got it to work and thank you for the assistance but I'm still confused as to why that is the case.
What is the difference between having the parent listen to the children and damage itself when they die versus having the children listen to themselves and tell the parent to damage itself when they die?
To me it's the same thing both accomplish the goal but either i'm missing the point of the "listener" part of the killable or how the actual listener script works.
|
|
|
Post by DarkTonic Dev on Oct 14, 2015 15:24:09 GMT
You could just as well put a single Listener script on the parent if you drag it in to the Listener field on each child. That's fine. If that's what you meant...
|
|