playMaker

Author Topic: Mute or deactivate or passtrough State  (Read 470 times)

pietwelve

  • Junior Playmaker
  • **
  • Posts: 57
    • View Profile
Mute or deactivate or passtrough State
« on: December 18, 2017, 01:27:27 PM »
Hi,
Sometime i'd like to "switch off" a state instead of deleting it...
eg :
   - i've got a state, not connected with other state, but with a global transition
           Just making it "inactive" so i can activate it again if i want.
   - i've got a state, connected this time with other states
          Make it "inactive" like a passthrough
So in other words it would be great to be able to test a FSM with or without a state  :-)
Sorry if it does exist already and i don't know ...
Thanks

krmko

  • Hero Member
  • *****
  • Posts: 611
    • View Profile
    • Fat Pug Studio
Re: Mute or deactivate or passtrough State
« Reply #1 on: December 18, 2017, 02:49:54 PM »
Great idea, we definitely need more such things for workflow.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2868
    • View Profile
    • jinxtergames
Re: Mute or deactivate or passtrough State
« Reply #2 on: December 18, 2017, 03:33:02 PM »
Hi,
I usually use bools to 'skip' a state when needed
and globals to idle or activate parts in the fsm.

similar as i would in code like a
Code: [Select]
if(bool = true) do thisis if the bool is false it will be skipped.

But i understand what you are saying.
I think it is not easy to implement the ability to 'turn off' states.

krmko

  • Hero Member
  • *****
  • Posts: 611
    • View Profile
    • Fat Pug Studio
Re: Mute or deactivate or passtrough State
« Reply #3 on: December 19, 2017, 12:24:26 AM »
Why not, i think the state would only need to be visually represented different, something like this



And then the playmaker itself can disable all actions in the state and put next frame event/finished state. When you turn it off, it deletes it and enables everything else in the state.

pietwelve

  • Junior Playmaker
  • **
  • Posts: 57
    • View Profile
Re: Mute or deactivate or passtrough State
« Reply #4 on: December 19, 2017, 02:30:33 PM »
I'm glad to read all your inputs :-)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12831
  • Official Playmaker Support
    • View Profile
Re: Mute or deactivate or passtrough State
« Reply #5 on: December 19, 2017, 11:42:58 PM »
Hi,
 
 I agree it would be very convenient.

 Bye,
 
 Jean

pietwelve

  • Junior Playmaker
  • **
  • Posts: 57
    • View Profile
Re: Mute or deactivate or passtrough State
« Reply #6 on: December 20, 2017, 10:17:41 AM »
I'm so proud Jean agrees with me !

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2868
    • View Profile
    • jinxtergames
Re: Mute or deactivate or passtrough State
« Reply #7 on: December 20, 2017, 02:37:57 PM »
Hi.
@krmko
Visually it is easy to do so, but in coding i think its not that easy to implement, especially when you can enable/disable @runtime.

And i also do think that it is a good idea :)


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3269
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Mute or deactivate or passtrough State
« Reply #8 on: December 20, 2017, 05:40:55 PM »
The question is what state to transition to instead, if a state is disabled? Maybe just send the FINISHED event? So you can handle it however you want...?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2868
    • View Profile
    • jinxtergames
Re: Mute or deactivate or passtrough State
« Reply #9 on: December 21, 2017, 02:04:48 AM »
Hi.
Indeed, if there are multiple transitions, there needs to be a logic on how to continue.

If disabled by an action, you could define the transition to go to.
If there was no transition defined do FINISHED event
If there is no FINISHED event and no transition defined, do nothing.

On the last one i was thinking maybe to send the top transition but i do think it is better to do nothing so that you need to define a transition.
Maybe it can trigger an error event.