playMaker

Author Topic: Can more than 1 criteria be used to send an event? [SOLVED]  (Read 2029 times)

Stonebolt

  • Playmaker Newbie
  • *
  • Posts: 15
Can more than 1 criteria be used to send an event? [SOLVED]
« on: December 25, 2014, 01:25:38 PM »
I was just wondering if it was possible if a state could be set up to have two criteria that need to be met before sending a single event.

For example, I want both a button press to take place and a bool to say "true" before the event is sent to a state machine, but not send the event if both aren't true.

So if you press say "fire1" and a checked specified global bool is false, it still won't send the event. Likewise if the bool is true and you don't press "fire1", the event will also not send. This is the behavior I'm looking for.

Any info on this topic would be appreciated.

Thanks!
« Last Edit: December 28, 2014, 02:08:45 PM by Stonebolt »

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: Can more than 1 criteria be used to send an event?
« Reply #1 on: December 25, 2014, 10:39:09 PM »
well, yes.

set up 2 variables-bools
have a test for the 1st bool.  if true then test for the 2nd variable.  if true then do something.
state 1-test 1.  if true then goto state 2
state 2-test3  if true then goto state 3
state3-do something.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Can more than 1 criteria be used to send an event?
« Reply #2 on: December 26, 2014, 12:12:33 AM »
use a global bool on each button in their own fsm

then in the fsm to send a event us bool all true set bool variable to 2 add the 2 global bools into elements and set every frame

this way only when both bools are true it will trigger, regardless which bool was 1st set to true

Stonebolt

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Can more than 1 criteria be used to send an event?
« Reply #3 on: December 27, 2014, 12:55:53 PM »
Sweet. Very useful information. Thank you both!