playMaker

Author Topic: when is a template loaded, on object create or activate?  (Read 2297 times)

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
when is a template loaded, on object create or activate?
« on: January 28, 2014, 06:08:21 PM »
Hi I need to know when a template is loaded. seeing as the reset on deactivate is greyed out.. does this mean on activate the template is reloaded?

cheers
tomas

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: when is a template loaded, on object create or activate?
« Reply #1 on: January 30, 2014, 06:05:38 AM »
Hi,

 What do you mean loaded? is it on a prefab? or on a sub fsm?

 It's loaded before it's started. In what context do you use these templates?


 Jean

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: when is a template loaded, on object create or activate?
« Reply #2 on: January 30, 2014, 07:33:24 AM »
well I have issues with the a* playmaker integration, but kiriri is not working on  it for a while. 

Basically i'm pooling gameobjects, instead of creating from prefabs,  So the source object is in the scene being cloned for the pool on game load. 

Then I take the 0 child of the pool for use in the game, I activate it and init all the values.  This works well and has the least amount of overhead on spawning (so it seems, on mobile).

When the unit dies, I deactivate the game-object, reset the values, and return it to the pool.   

However when I then re-use a unit that was previously already used, the a* moveto action seems to remember something from its previous use, making experience a number of weird paths.  (depending if I use reset on disable etc etc).   but whatever combo of reset or deactivate I use it always retains one of the bugs.. (fix one, the other bug pops back up, so either it snaps to the old path start pos, or it moves to the old startpos, depending on if the gameobject was reset or not)..

So I'm looking for a way to manually remove the fsm pathfinding component and attach a new template , through run fsm for instance. in the hopes that it would completely wipe once and for all all the data for the pathfollowing in that unit. (as it would be a new component each time it spawns). 

But I can't find any remove fsmcomponent, or destroy fsm action, so the point is moot. 

But basically I'm stuck, and hit the wall of my own coding skills. I feel it's probably something really basic to fix in the a* wrapper, but it's beyond me..


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: when is a template loaded, on object create or activate?
« Reply #3 on: February 03, 2014, 03:25:48 AM »
Hi,

 Very odd. Can you make a short screencast of what you experience? that will help.

bye,

 Jean