playMaker

Author Topic: Motion Controller issue  (Read 2181 times)

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
Motion Controller issue
« on: March 27, 2013, 01:46:31 PM »
Ive created a motion controller for a tank which works ok, but now i want to remove energy when the tank is in motion, i have the FSM for the remove energy working by alt clicking it, but my question is how to i send a get key down to two states at the same time.

I have two get key downs for up arrow, each going to different events, but the command only goes to the first one in the state.

Also how do I set this up to send the forward command to up arrow and forward on a game pad?


Thanks

Andy

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Motion Controller issue
« Reply #1 on: March 27, 2013, 02:12:35 PM »
You can put the energy removal in another FSM and use a send event to trigger it in and out of an idle state or do the removal in each forward/reverse thrusting state.

I recommend separating it to another FSM that just manages the fuel math/gui.

An FSM can only process one simultaneous state at once, if you need additional FSM's just add them and send events between each other to trigger things. Bool checks and switches are handy for this also.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Andys

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Motion Controller issue
« Reply #2 on: March 27, 2013, 05:35:38 PM »
Can you give me a bit more guidance please, I have the events being sent to new FSM and they are working ok, the countdown is a simple loop when started to -1 from the energy every second when moving, which is working, but this starts a loop i cant stop, can this be stoped with the key up event?

I am new to playmaker and not all the functions are clear to me yet

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Motion Controller issue
« Reply #3 on: March 27, 2013, 10:23:36 PM »
 You can stop the loop easily.

When you are subtracting the fuel every second anything else you order that fsm to do will interrupt it. You can tell it to send an event on get key up (on your controls fsm) and order the subtract fuel into an idle state.

All you need to do is change what it is currently doing by using send event. It can idle, or subtract fuel.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D