Ok, here it is: KormanPuzzle01
an, uh, "official" puzzle sample Age.
This sample Age is a bit more detailed than the previous blends I've released in that it's, what I would consider, almost
worthy of being released as a standalone Age for people to play. The puzzle is quite real - it's integrated into the environment, and you get a reward for solving it. I hope everyone who decides to take a look will play the Age to completion before snooping in the blend file too much
. I'd recommend playing on Destiny - Mystler has already put the age and SDL files up on the server - because there are some bugs with the sound effects in PotS that I didn't feel like debugging. Those bugs make it difficult to know if you're completing the puzzle correctly.
Anyway, some detail on how the puzzle is set up... In the Age, there are five buttons that have to be pressed in a certain order to open the door. This is accomplished with two scripts
First, the new script that I wrote for this type of puzzle: xAgeSDLBoolActivatorComboSet.py
. You'll want to look at the node tree "PuzzleBrain" for this one. It needs three SDL variables in the age -- one to track if the puzzle is solved ("solvedVariableName"), one to track if a button is being pressed ("butsInUseVariableName"), and on to track the number of correct button presses ("numCorrectVariableName"). You have to supply the combination to the script as a comma separated list of buttons. Note that the buttons start at "0" and increase in order that you've hooked them up to "ID: 7 Act Buttons". Optionally, you can play a responder when a button has been pressed -- the script will run the state ID corresponding to the ID of the button that has been pressed.
The new script only handles interactions with the buttons and setting the solved/unsolved puzzle state. If you want to open a door, play a sound effect, or whatever... You'll need to use xAgeSDLBoolRespond.py
. The "solvedVariableName" will be set to true when the puzzle is solved and false when not solved. I did make a small edit to this script so that responders could be "fastforwarded" by other scripts. This is done in the node tree "PuzzleSolved". Also, you'll notice that the sound-based feedback is done in the "PuzzleFeedbackSfx" tree using the same script. There are only two forms of feedback, so I'm taking advantage of the fact that an integer (eg 0, 1, 2, etc) implicitly becomes the boolean "false" when the value is "0" and "true" when the value is not
"0". Meaning you get a nice rejection sound when pressing the wrong button. You could do a more precise feedback effect with something like xAgeSDLIntStateListResp.py.
If these scripts do what you need, I'll submit them to diafero for inclusion in the OfflineKI so everyone can use them more easily