playMaker

Author Topic: How do you destroy/deacivate an object timed?  (Read 1692 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
How do you destroy/deacivate an object timed?
« on: December 22, 2014, 04:43:16 PM »
So I have an effect that runs, but after 5 seconds I want to deactivate the object.  the effect is over and no need to keep it active.  So I want to deactivate it so the next time it is activated it will run from the beginning again.  Is there an action or some easy way to do it?

An action called 'timed event' would be cool too.
« Last Edit: December 22, 2014, 04:44:47 PM by wheretheidivides »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do you destroy/deacivate an object timed?
« Reply #1 on: December 22, 2014, 04:51:53 PM »
Use the Wait action to transition to a state where you deactivate the object.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How do you destroy/deacivate an object timed?
« Reply #2 on: December 22, 2014, 06:13:59 PM »
Sorry, Lane.  My fault. 

Wait stays on that state until the time is over.  I needed the loop to continue while that object destroys itself.  My solution is to send and event to a effects manager that will activate the object, wait and deactivate it.  That way the loop continues working while the manager controls the effect.  I needed 1 FSM for each effect to each can turn on or off by themselves.



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do you destroy/deacivate an object timed?
« Reply #3 on: December 23, 2014, 01:40:25 AM »
Hi,

 You should have the wait on the object itself. Then your manager doesn't to get more complex. You can still have communication between the manager and the objects via global event, your manager would spawn and set an fsm variable "Manager" on the object ( where you expect an fsm to be), and then the object can send event to the manager back. It's very powerful this way. you give more responsability to the each object making less complicated logic within each fsm.

 
Bye,

 Jean