playMaker

Author Topic: If statements without a state change?  (Read 1680 times)

Red

  • Hero Member
  • *****
  • Posts: 563
If statements without a state change?
« on: July 24, 2014, 01:54:55 PM »
Is it possible to do if statements (and adding in a "do this if successful") to a state without exiting the state itself or is this a fundamental limitation of FSM systems as is?

I'd like to know because I'm staring down a system that is pretty hefty in the actions it has to complete and being able to insert a little "if" statement without exiting the action would be nice (and it'd also preserve the order of the actions being fired off.)

Or do you think this is where the template action sets would come in handy?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: If statements without a state change?
« Reply #1 on: July 24, 2014, 02:39:19 PM »
It's kind of the fundamental way you would want an FSM to work, I think.

'do this if..' is basically done by firing an event off and leaving the state. You can always just manipulate some data and stay in the same state, or fire an event that just loops back into itself.

You could code custom actions to change some variables rather than firing events or you could have a background FSM basically do processes, then mirror that data over to an FSM that executes and changes based on that data, kind of like modularizing how things work.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D