playMaker

Author Topic: Noob asking for help to set up a small button puzzle  (Read 1614 times)

Xerilon

  • Playmaker Newbie
  • *
  • Posts: 11
Noob asking for help to set up a small button puzzle
« on: June 08, 2014, 05:12:10 PM »
Hello, I am new to Playmaker and coming from Blender BGE I have some difficulties wrapping my head around these new but powerful principles :)

I have a row of 36 individual buttons. Each of them have two states (on/off) to change material when clicked upon.

My idea is that the player would have to press certain individual buttons, for example button 2,6,7,23,25,32,33 to meet the requirements to turn on a light. If the player presses another combination of buttons, another light would turn on, and not the first one.

So far I have managed to have the buttons update an Int value on the light (the light has one Int variable for each button that should be linked to it) but I have not figured out how the light can "collect" or update which of its required buttons are "on" so that it can determine whether to turn on or off itself.

I am working with game objects here, not any kind of GUI..

Can someone point me in the right direction or guide me gently through this? I've been looking for suitable tutorials, yet found none so far..

1982

  • Junior Playmaker
  • **
  • Posts: 71
Re: Noob asking for help to set up a small button puzzle
« Reply #1 on: June 08, 2014, 05:44:19 PM »
Use Bools and "Bool All True" action for checking that correct buttons have been pressed. Together with that you can then use "Bool Any True" to check if only some of the correct buttons are pressed, and maybe also "Bool None True" if none of the correct buttons are pressed.

You can also use Int's so that you give correct buttons a value of "3", and incorrect buttons "1". Each button then adds its particular value to shared Int variable. Then you compare (Int Compare) if that variable is equal to the sum of the correct buttons. Make sure to remove that particular value from the shared variable when the button is de-pressed.


Xerilon

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Noob asking for help to set up a small button puzzle
« Reply #2 on: June 08, 2014, 07:17:09 PM »
Yes, 1982
"bool true" must be what I was looking for, I will try that!

And double thanks for the second possible solution ;)