playMaker

Author Topic: Reusable Action Sets  (Read 4286 times)

FelixDraconis

  • Playmaker Newbie
  • *
  • Posts: 5
Reusable Action Sets
« on: September 29, 2011, 07:14:28 PM »
We'd like to be able to create floating script objects (states, to use your metaphor) which can be called and executed instantly.

The objective is to allow us to compose blocks of reusable actions without having to make custom actions.

Even better, I would love to be able to create FSM 'libraries' of scripts which exist globally and can be referenced from other FSMs. Pie-in-the-sky, probably.

Contrived Example in Pseudocode:

State WalkTo
  PlayAnimation   Walk
  SetFloat  Speed = 10
  RunState MoveToTarget

  Transition FINISHED -> DoneWalking

State RunTo
  PlayAnimation   Run
  SetFloat  Speed = 20
  RunState MoveToTarget

  Transition FINISHED -> DoneRunning

Task MoveToTarget
  GetProperty TargetObject TargetVector<Vector3>
  LookAtTween TargetVector
  MoveTo TargetVector Then FINISHED


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Reusable Action Sets
« Reply #1 on: September 30, 2011, 02:11:00 AM »
Hi,

 Yes, we mentioned that several times, it's something that is missing in my opinion too. I really would like to be able to define a process that I can reuse properly within other fsm.

 Bye,

 Jean