playMaker

Author Topic: [SOLVED] Need help with a bool test situation  (Read 2074 times)

part12studios

  • Playmaker Newbie
  • *
  • Posts: 41
[SOLVED] Need help with a bool test situation
« on: July 30, 2013, 02:33:16 PM »
Hi there,

Ok so I'm doing a pretty simple thing..  i have a box which i click which is my "on / off" object..   it is intended to control a light to make it toggle between red and green.. for off and on states..

1 - the cube itself works great.  i have it change color as well (blue and yellow) and i can see in the flow that it looks / works right.. 

2 - this switch box controls a global bool..  this bool is in the logic of the cube so i know that while it's changing from blue to yellow, it is also changing the state of the global bool value

3 - Here is where it seems to fail.  the light itself that is to change color has a "Test Bool" on it..  with two outcomes.. if it's true, make it green and go back to bool compare.. if it's false.. make it red and go back and compare..  every frame..   

yet what happens is that it goes red (because it is false by default) and does not toggle.. here is a screenshot to hopefully help.  It seems like I'm doing it right, but maybe there is something about bools or playmaker that i'm not aware of.

Thanks in advance for your help!

Sincerely,
Caleb
« Last Edit: July 31, 2013, 11:11:15 AM by part12studios »

part12studios

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Need help with a bool test situation
« Reply #1 on: July 30, 2013, 04:50:31 PM »
this is a better screenshot

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Need help with a bool test situation
« Reply #2 on: July 31, 2013, 02:46:27 AM »
Hi,

 Typically, you should instead declare two global events "LIGHT ON" and "LIGHT OFF", and broadcast them events from the place where you actually control this behavior, then all other fsm that needs to "react" on that simply have them global events as global transitions. This is a better approach then a global var that you watch.

bye,

 Jean

part12studios

  • Playmaker Newbie
  • *
  • Posts: 41
Re: Need help with a bool test situation
« Reply #3 on: July 31, 2013, 11:10:55 AM »
OK that did the trick! I understand now. Thanks a ton!  :)