|
Post by defchurch on Jun 30, 2016 7:40:06 GMT
I'm using PlayMaker(PM) with Core Game Kit and I'm trying to run all health and damage through playmaker. Basically the Enemy starts with an initial health of 30 from PM that I send to "Start hit points" I use a box collider that appears for .01s to trigger damage on collision.
Method 1
Using "Int Add" I deduct 10 from "the remaining hit points" but when "Core Game Kit Killable Attack Or Hit Points Mod" in PM hits 0 the enemy still has 10 health in "remaining hit points" in the Killable script. The enemy will play its death animation but will not be "killed" to go back into the pool.
Method 2
I used "Core Game Kit Killable Attack Or Hit Points Add" with -10 to decrease health but this caused the "remaining hit points" to lose 20 hp a hit! The strange thing is "Start hit points" only loses 10 hp a hit. The enemy would hit 0 in the killable script before hitting 0 in PM causing the enemy to vanish before it can play out its death animation. Even the log tells me 10pts of damage was given.
I also noticed objects with Killable script also do 2x damage to each other on touch if I have any "Start Attack Points". I feel like I'm probably doing something wrong but I can't figure it out. If anyone has had and found a solution for a similar issue using PM with CGK I'd appreciate any help! Thanks!
Here is how my FSM is setup
Start Setup state (start health of 30)>Listener state (waits for collision)>Hit!>Decrease health state(-10 on collision)>Health check state(did health hit 0)>No(back to Listener state)>Yes(play death animation)
|
|
|
Post by DarkTonic Dev on Jun 30, 2016 16:01:48 GMT
There's an easier and more consistent way to play your death animation. You use the KillablePlaymakerListener and use the Inspector to select which event to send to which FSM on Playmaker. That's guaranteed to work, whereas your method may occasionally miss the death event because the Killable is already dead and gone.
Do not use "Core Game Kit Killable Attack Or Hit Points Add", that is for changing the Hit Points or Attack Points (not the remaining HP). Is there a reason the box collider isn't a Killable itself so it can deal damage without needing a Custom Action to do so? If not, you should use "Core Game Kit Killable Take Damage" Custom Action for what you want.
|
|
|
Post by defchurch on Jul 5, 2016 7:32:06 GMT
Thanks for the help I got it to work with "Core Game Kit Killable Take Damage". The Playmaker health system was made a long time ago and I just started implementing CGK into it. My artist brain usually does things like this the most backwards way first before I figure out the most optimal way. I'll keep at it. Thanks!
|
|
|
Post by DarkTonic Dev on Jul 5, 2016 15:42:21 GMT
Cool and no problem!
|
|