playMaker

Author Topic: conections between FSMs  (Read 1744 times)

Practical

  • Playmaker Newbie
  • *
  • Posts: 8
conections between FSMs
« on: January 31, 2018, 04:03:45 PM »
Mouse down on OBJ1  causing changing of material on OBJ2 (with every new click on OBJ1- a new material resides at OBJ2 (from material 1 to 2,3,4,5,6 etc, and back to 1).

On the other side, one event is ready to be fired up from OBJ3 FSM, but it could be accomplished and fired up only if exact material (say material 3) is residing on OBJ2.
So, clicking on OBJ3 is useless unless material 3 is activated on OBJ2.

Tried with compare tags, setting tag on material, and then if material with no tag on it , go back - something, but I couldn't connect variables - they are too confusing - impossible.

Hard to find any help in general regarding connecting variables- Its a pattern, and once explained properly, you can implemented anywhere in any situation. But connecting, open close, choosing - that's still unexplained, from anyone on the internet, any document or tutorial. I guess I'm stuck until someone make a proper explanation of "how to make a hook , rope and stick" and not "how to catch a fish for you".
:(

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: conections between FSMs
« Reply #1 on: February 01, 2018, 12:54:48 AM »
Hi,

 sorry, kind of a cryptic message here :) I am not sure I fully understand what youa re after...

- mouse down doesn't change material, so something in your scene is doing that, or do you mean you have an FSM that does change the material if you click on it?

- Materials are shared, so if you have 2 GameObject with the same material, they will both be affected. If they are not shared, then you need to chekc where exactly obj2 material is being set or modified)

- Can you explain in details what variable you are trying to connect? by connect I am not sure what you mean, do you want them to have the same values always?  PlayMaker doesn't do that, the closest thing you can do is using actions like FsmGetString or FsmGetInt and get the value of a variable on another fsm and store that value in a variable of the fsm using that action.

- what do you mean by "Connecting, open. close, choosing" ?

- what is a hook, a rope and a stick? you will need to carefully describe what you mean by that, and what is their purpose and behaviour, it could range from a crane hook to captain hook and a rope for secondary animation with no interaction with the player to rope that the player can interact and climb or control, same with stick.

- is "Catch a fish" a saying? what does this means?

 also, it's best I think if you make several posts each targeting a particular and precise topic.


 Bye,

 Jean

Practical

  • Playmaker Newbie
  • *
  • Posts: 8
Re: conections between FSMs
« Reply #2 on: February 01, 2018, 05:57:28 AM »
Hi Jean,
Thanks for reply. You made me LOL   :D Of course that "catch a fish" is a saying. I was frustrate not knowing where to go further in my game, and why tutorials and manuals are lack of that ability- to teach you How to use variables, not Where to use them (but forget about that, ok).
I found a "way around solution"for the problem above - I pooled a powerful action called Enable FSM which makes things go simpler and faster. I had this mouseDown establishment in my game (with a combination to click in a raw on 4 object as a condition to fire-up next event), and I made to do that, but then I decided to add a an extra condition - that last click needs something more - that some 5th object has to be in a state of a certain material (5th object was able to change his own material each time you click on it). And then finally the task is complete-next event fired-up! First part I did with Mouse Manager on Camera raycast - but then I was stack on this 5th  object - how to implement.
To each state in changing material FSM (5th object FSM) I simply added the Enable FSM (applies to Mouse manager FSM) and turn it OFF except for one material of my choice. Result was - Mouse manager was stopped until the 5th element reaches the right material. Simple as that !
This simple Enable FSM action opened a whole new world of possibilities for me in a further development of my game, which means that a bunch of actions from the Playmaker`s action browser are practically useless and just makes things complicated.  8)
Thanks!

« Last Edit: February 01, 2018, 05:59:47 AM by Practical »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: conections between FSMs
« Reply #3 on: February 07, 2018, 04:29:58 AM »
Hi,

 ok :)

 Each actions indeed have its own usage, I practically never disable components or gameobject myself, so Actions are here to accommodate any type of design patterns, if you find power in disabling/enabling components, then go for it! but others actions should not be seen as useless as a result, or you will prevent yourself from building more complex features.

 Bye,

 Jean