playMaker

Author Topic: Custom system advice  (Read 714 times)

Solmas

  • Playmaker Newbie
  • *
  • Posts: 1
Custom system advice
« on: June 09, 2019, 09:42:08 AM »
Hi everyone!  I'm prototyping a game idea and need help getting PM to do what I need it to.  I'll try to be as succinct as possible:

I have a resource pool that generates/decays based on player movement.  My plan is to have an FSM on the player that broadcasts a global bool playerMovement.  On the UI, I have a bar with another FSM that receives playerMovement.  What I need that one to do is start a timer and stop listening to broadcast while timer is ticking, check playerMovement again at end of timer, then set generation/decay rate by .025.  If playerMovement check is the same at the end of the next timer, then I need to increment/decrement that value multiplied by 2.

As it is right now, I'm stacking get axis, set FSM bool, and send event on the player FSM -- it seems correct to me but it's obviously not working.  I've made it to tutorial 7 without much help so far but haven't found anything that helps me figure this out.  If anyone can point me to a specific tutorial or resource that can help me plan this, or offer any advice themselves on how to do it, I'd very much appreciate it!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Custom system advice
« Reply #1 on: June 13, 2019, 07:49:58 AM »
Hi,

 one quick way is to have a state with the global event as a transition ( below the state, not above), which means this fsm will only listen to that global event if it is in that state.

 so in that state you make a timer, and the fsm will only pick that event during the activate time of that state.

 Does that make sense?

 Bye,

 Jean