playMaker

Author Topic: Simple 2.5D Flightsimulator Problems  (Read 2007 times)

red2blue

  • Playmaker Newbie
  • *
  • Posts: 3
Simple 2.5D Flightsimulator Problems
« on: February 14, 2014, 02:54:12 PM »
Hello, I am quite new to playmaker and got some questions. I want to make a simple 2.5D Flight game. You can throttle up and down, fly up and down. Thats it so far.

Now I got the problem, that I would like to handle this with only one FSM, because I want to avoid global variables (If i have multipe planes from this one prefab the global variables will disturb each other).
The real problem is the input. If I accelerate and want to go up, the FSM hangs in the state which com first.


I will explane the FSM shortly:
The FSM stayes in the listerner event, until a key is pressed.
For every key I have a bool variable. If the key is hit, the bool goes true and the an event is called (Throttle up/ down, Nose up/down). These events change variables which are executed in the thrust event, which is the last state. After this it goes back to the listener event. If I want to hit two keys it doesn't work because the fist bool compare of the keys will always take action. The following bools are ignored.

Hope you guys know what I mean. Does anybody has a tip for me?
That would be so cool!

Thanks a lot!

Edit: Since it is only 2.5D, means X-/ Y-Axis movment but 3D objects should I maybe use the 2D actions?
« Last Edit: February 14, 2014, 03:05:11 PM by red2blue »

1982

  • Junior Playmaker
  • **
  • Posts: 71
Re: Simple 2.5D Flightsimulator Problems
« Reply #1 on: February 14, 2014, 03:59:11 PM »
I have usually done these things so that every control/button action has it's own FSM. So they can run simultaneously and you can press all the buttons at once.

There might be other options too but at least that does function well.

red2blue

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Simple 2.5D Flightsimulator Problems
« Reply #2 on: February 14, 2014, 04:51:22 PM »
I have usually done these things so that every control/button action has it's own FSM. So they can run simultaneously and you can press all the buttons at once.

There might be other options too but at least that does function well.

Thanks for your answere! But then I need global variables for the access from outside. This will cause some problems if i habe multiple planes, or am i wrong?

1982

  • Junior Playmaker
  • **
  • Posts: 71
Re: Simple 2.5D Flightsimulator Problems
« Reply #3 on: February 14, 2014, 07:13:15 PM »
I don't know what kind of variable structure and usage you have, but you could try to look at "Set FSM..." and "Get FSM..." actions. You can send variable data between different FSM's and gameobjects, without needing to use global variables.

red2blue

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Simple 2.5D Flightsimulator Problems
« Reply #4 on: February 15, 2014, 06:29:10 AM »
I don't know what kind of variable structure and usage you have, but you could try to look at "Set FSM..." and "Get FSM..." actions. You can send variable data between different FSM's and gameobjects, without needing to use global variables.

Thanks again for the hint. I will give it a try today!