playMaker

Author Topic: Run Fsm logic  (Read 222 times)

puddlepouncer

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Run Fsm logic
« on: April 06, 2020, 04:09:23 AM »
Hi,

I am new to using templates and the Run FSM action but it seems like a great feature. I however don't seem to get it to work and wonder if i'm using it in a wrong way or for the wrong purpose.

So I have a game object (pickupData) that holds data in hashtables for objects that can and/or has been picked up. I query pickData from my player for various purposes and thought it be nifty to let a template manage this for me.

The template doesn't seem to get a response from the pickupData GO though. It seems like pickupData cant pass the data back to the template. Is it the case that only the HOST can communicate with the SUB fsm/template and that's where the problem lies?

I've added images for clarification

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4968
    • View Profile
    • jinxtergames
Re: Run Fsm logic
« Reply #1 on: April 06, 2020, 05:39:45 AM »
Hi.
The current run fsm, you can only input data.

To output data use 'Set Fsm' actions inside the run fsm.
to target certain object/fsm/variable you can use the input to direct it

puddlepouncer

  • Playmaker Newbie
  • *
  • Posts: 12
    • View Profile
Re: Run Fsm logic
« Reply #2 on: April 06, 2020, 06:12:43 AM »
Thanks,

Though set event properties seems to work from within the sub fsm to external GO (pickupData). The problem seem to be for the external GO to send an event back to the Sub fsm. Which Game object and which fsm Name should I target from pickupData to reach the subfsm?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4968
    • View Profile
    • jinxtergames
Re: Run Fsm logic
« Reply #3 on: April 06, 2020, 12:55:16 PM »
Hi.
Sorry, yes Set event properties works as well, but sending a event to the run fsm will not work (possibly broadcast event could work but not good to use performance wise.)

Something you could do is use is 'Get fsm bool' (called RESPONSE for example)
and a bool test (there is also a custom action 'Fsm Bool Test' on the Ecosystem
and check every frame.

and instead of sending even set that bool to 'true'

I use 'Fsm Bool Test' a lot in run fsm for enemy behaviors.

Filto

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Run Fsm logic
« Reply #4 on: April 07, 2020, 06:22:40 AM »
Thanks,

I'll try the Fsm bool test approach. Seems like a great action for listening to other Fsm:s in general

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4968
    • View Profile
    • jinxtergames
Re: Run Fsm logic
« Reply #5 on: April 07, 2020, 12:15:04 PM »
Hi.
Yes, you can find several other action on the ecosystem, like for example 'Fsm Int Add' is 1 that i use a lot.

Broken Stylus

  • Sr. Member
  • ****
  • Posts: 363
    • View Profile
Re: Run Fsm logic
« Reply #6 on: April 10, 2020, 03:15:25 AM »
Thanks,

I'll try the Fsm bool test approach. Seems like a great action for listening to other Fsm:s in general

You can also try the "is in state" action. In a way, it's a bit more "meta" since it does not wait for the observed FSM to fiddle with bools. It's more like a Sauron's Eye function.