playMaker

Author Topic: Spaceship Controller  (Read 6170 times)

RowdyMrB

  • Playmaker Newbie
  • *
  • Posts: 6
Spaceship Controller
« on: July 06, 2013, 06:21:01 PM »
I have challenged myself to build a space shooter using playMaker and ran into a bit of a challenge when trying to build the player spaceship controller. No one seems to have done this yet and I could not figure out how to piece it together from the available actions.  So for my first custom playMaker action I thought I would give it a try.

For anyone interested what I did was modify the AddTorque action a bit to build a simple spaceship controller using mouse input.  To use the attached action just create an separate FSM for each axis (x,y,z) and make a start state (x Input, ...) and a movement state.  Add the Axis Event action to the start state and the attached action to the movement state and fill in the appropriate multiplier variable for each axis FSM.  I also added a Send Event action to the movement state back to the start.  Play with the multipliers and the Unity input manager settings to get different results.

Still have some work to do with it but it's a start.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Spaceship Controller
« Reply #1 on: July 09, 2013, 04:43:19 AM »
Hi,

 Good Start!

 Few things:

-- Expose the input references, so that we can decide what input axis to use, that will make the action a lot more flexible. And simply put as defaults the usuals.

-- multiplier should be set to the default value instead of using a variable , otherwise the action doesn't work if you simply drop it on a go.

-- also, you definitly can add the thrust input in this action, that will make it complete.

bye,

 Jean

RowdyMrB

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Spaceship Controller
« Reply #2 on: July 10, 2013, 06:09:25 PM »
Thanks for the feedback I will work on those items and resubmit.

RowdyMrB

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Spaceship Controller
« Reply #3 on: July 13, 2013, 11:42:54 PM »
Jean,
Attached is the current version of the Spaceship controller action.  I think this version is easier to use.  I did not add default multiplier values but added a tooltips comment instead.  The values really depend on what movements you are trying to achieve so it is good to experiment a little.  Likewise, I did not add a thruster input as I handle that in a separate set of FSMs.  I start with a Thruster Control FSM that takes key input and then use separate FSMs for each thruster game object that controls sound, particles, and force.

Thanks for your feedback it really made me rethink how I was doing this.

B

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Spaceship Controller
« Reply #4 on: July 15, 2013, 02:17:08 AM »
Hi,

 You totally got the spirit of playmaker actions here! you made it as a totally generic torque controller, so it can be applied to any situations, not just spaceship. Way to go.

Tho, now, it's actually the same as "Add torque" action really  :o


bye,

 Jean

RowdyMrB

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Spaceship Controller
« Reply #5 on: July 15, 2013, 12:01:51 PM »
Jean,
Definitely a modified add torque action adding rigidbody mass and GetAxis events to combine it all into a single action.

I took your advice from a previous post on a different thread and dug into the code of current actions to learn how to create my own when needed.

Thanks again,
B