playMaker

Author Topic: PoolManager Reset Object Issue  (Read 1758 times)

mweyna

  • Full Member
  • ***
  • Posts: 242
PoolManager Reset Object Issue
« on: June 26, 2015, 03:48:04 PM »
So I'm using PoolManager to handle my Dungeon Keeper-esc game. When you spawn an object or unit it loads that into a pool. However, when that unit dies it despawns it (making the object inactive in the pool). What I've found though is that spawning another object of the same type simply re-actives that despawned version, rather then create a new one.

This is problematic because of the complexity of FSMs involved, I need certain actions in certain orders, even with the FSMs themselves marked as "Reset on Disable" it does not appear to be functioning properly when the object and not the FSM specifically is disabled.

What is the best practice for using Pool Manager to spawn and re-spawn objects? Prior to de-spawning them do I need to disable and reset it to a "clean" state or is there something I'm not doing correctly in the spawn action to reset the object?

- Ian

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: PoolManager Reset Object Issue
« Reply #1 on: June 27, 2015, 04:33:49 AM »
To work with this limitation of pooling- I create my fsm's so that they are sent a global "death" event when they are despawned-

So just before running the despawn action I run some other actions to reset the object to its default/start state- reset health, move back to start pos/rot etc

So when it is respawned/reactivated everything works as if it was just created-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!