wiki:SkillJumpState

Version 1 (modified by vmatare, 7 years ago) (diff)

--

A SkillJumpState is a state in which one more subskills are executed.

Superclass

JumpState?

Required Properties

  • skills: A 2-Dimensional table containing each subskill with its parameters
  • final_to: The state to enter when the subskill does not end in FAILED

Optional Properties

  • fail_to: The state to enter when the subskill ends in FAILED. Defaults to FAILED.

Example

fsm:define_states{ export_to=_M,
   {"SOME_SUBSKILL", SkillJumpState, skills={{search_and_destroy}}, final_to=FINAL}
}

function SOME_SUBSKILL:init()
   self.skills[1].target = "Kittens"
   self.skills[1].mode = "CUTENESS_OVERLOAD"
end

function FAILED:init()
   print("No Kittens in range.")
end