playMaker

Author Topic: Combining actions in one state  (Read 3739 times)

pandigital

  • Playmaker Newbie
  • *
  • Posts: 23
Combining actions in one state
« on: September 13, 2011, 01:52:02 PM »
Hi - new to playmaker - so this is a rudimentary question

Say I want to create / destroy a GameObject using one keypress to create and a different one to destroy and I want to limit the number created / destroyed to 0.
I can have a simple chain of 3 states - 1. look for keypress create , 2. Create and look for keypress destroy 3. Destroy and back to the beginning
But is there a way to do the same thing using on Keypress, test bool, if false then create else nothing.
And can this be done in just one state?

TIA

pandigital

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Combining actions in one state
« Reply #1 on: September 13, 2011, 03:39:00 PM »
Here's how I have done it this time.


Is this the most efficient way?

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: Combining actions in one state
« Reply #2 on: September 13, 2011, 04:15:40 PM »
There's a couple of different ways you can do it. It looks to me like you have a redundant set of states. If i was at home I'd show you other ways to do. If no one has replied I'll try to whip something up either tonight or tomorrow.

pandigital

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Combining actions in one state
« Reply #3 on: September 15, 2011, 02:41:43 AM »
Thanks tobbeo

That would be appreciated

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: Combining actions in one state
« Reply #4 on: September 15, 2011, 08:50:45 PM »
Ok, sorry. Working but I managed to take some snapshots of a simple repeating fire setup. In this setup, as long as you keep holding down space it will continue to keep shooting at an interval of 0.35 seconds. To do what you did, you can fit that into 2 states and hopefully that will make sense when you see mine. I'll try to show some more when I have more time.


tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: Combining actions in one state
« Reply #5 on: September 15, 2011, 08:51:06 PM »
step2.

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: Combining actions in one state
« Reply #6 on: September 15, 2011, 08:51:24 PM »
step 3.