playMaker

Author Topic: Co Routine?  (Read 2442 times)

grimmy

  • Junior Playmaker
  • **
  • Posts: 70
Co Routine?
« on: April 28, 2014, 05:21:36 AM »
Hi, how do I have (for example) a constantly increasing float inside an FSM while other behaviour and logic is going on within that FSM?

There's a Float Add action of course, but if I set it too every frame, no other logic will ever be reached and there doesn't seem to be a way to have to concurrent event strands working at once within an FSM.

?

Cheers

Marsh

  • Full Member
  • ***
  • Posts: 227
  • Comfort the disturbed, disturb the comfortable
Re: Co Routine?
« Reply #1 on: May 07, 2014, 05:16:45 PM »
I always wondered if Coroutines were possible with PlayMaker. Any answer on this?

grimmy

  • Junior Playmaker
  • **
  • Posts: 70
Re: Co Routine?
« Reply #2 on: May 16, 2014, 09:26:43 AM »
I guess not. For now, I've just been creating a separate FSM in the same object which simply does the 'other thing' while the initial FSM doe it's own thing.

Maybe that's crazy, but who knows.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Co Routine?
« Reply #3 on: May 18, 2014, 10:01:22 AM »
Having separate FSMs to control parallel processes is a good strategy. Even if that separate FSM starts off super simple, it's surprising how often it grows as the game grows. If you jammed all of those processes into one FSM it would eventually become very hard to manage.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Co Routine?
« Reply #4 on: May 22, 2014, 03:22:07 AM »
Hi,

 also, you can use SubFsm to achieve complex behavior within one state, and create some coroutines this way.

Bye,

 Jean