playMaker

Author Topic: Linear processing of action contents? [SOLVED]  (Read 3704 times)

kinetiknz

  • Junior Playmaker
  • **
  • Posts: 85
Linear processing of action contents? [SOLVED]
« on: October 13, 2011, 10:32:42 PM »
Hi there. I have used PM for a few quick jobs now and I do love it, but I am a little confused about how it processes the order of the content of the actions.

eg. if I wanted to have a camera that tween moves from 1 spot to another and fades in from black at the start and fades to black at the end. Is it possible to do in only 1 action?? Shouldn't the fade from black complete, then the tween, and wouldn't a fade at the end of the action start AFTER the tween? I find it a little confusing understanding the design behind it?
« Last Edit: November 05, 2011, 03:00:51 PM by alexchouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Linear processing of action contents?
« Reply #1 on: October 14, 2011, 01:11:43 AM »
Hi,


 Don't be afraid to cut the tasks in individual states.

fade -> move ->fade

so you have three states

if you need to fade AND start moving at the same time, you can combine in one state.

 for the end fade, yes you could run into problems with one state, one possible way would be to have two fsm one responsible for the tween and one for the fades. The tween state fires event to the fade fsm when it wants, so you can have concurrent behaviors ( remember, a given fsm can only have one active state at a time).

 Mess with this ( best way to learn :) ), if you have some trouble, let me know, I will make a working example.

 Bye,

 Jean

kinetiknz

  • Junior Playmaker
  • **
  • Posts: 85
Re: Linear processing of action contents?
« Reply #2 on: October 16, 2011, 11:15:50 PM »
Thanks Jean, you are right. I need to fumble around more.
I think, not grasping the idea behind the design is stopping me from being fluid with it.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Linear processing of action contents?
« Reply #3 on: October 17, 2011, 12:19:18 AM »
There's also a summary of the action execution order here:
https://hutonggames.fogbugz.com/default.asp?W174

In a sense Playmaker takes the Unity Inspector idea, which shows behaviors attached to a GameObject, and adapts it to show behaviors attached to a state; behaviors that are only active while a state is active. You could think of each state as having it's own Behavior Inspector. Maybe that will help you visualize the design...?

Of course Playmaker actions are more modular that the typical Unity Behavior, and are executed in order each frame, allowing you to pass variables between actions, but the idea was to build on the Unity Inspector convention.

Does that help?
« Last Edit: October 17, 2011, 12:21:22 AM by alexchouls »

kinetiknz

  • Junior Playmaker
  • **
  • Posts: 85
Re: Linear processing of action contents?
« Reply #4 on: October 17, 2011, 07:42:47 PM »
Thanks Alex, I'm reading it now.

Does make sense!

is this part an error?

"IMPORTANT: If an Action triggers a transition, the transition happens immediately and the Actions below it are not executed."

Is transition supposed to read - 'event'

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Linear processing of action contents?
« Reply #5 on: October 17, 2011, 08:38:18 PM »
Events trigger transitions. So the sentence could also read: If an Action sends an event that triggers a transition to another state, the transition happens immediately...

I just used the short hand of "triggers a transition."

Is that what you meant?

kinetiknz

  • Junior Playmaker
  • **
  • Posts: 85
Re: Linear processing of action contents?
« Reply #6 on: October 17, 2011, 08:41:16 PM »
Yeah I get ya, events are transitions.