Multibutton puzzle

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Re: Multibutton puzzle

Postby Justintime9 » Fri Mar 26, 2010 3:49 am

Awesome, it works! I guess I don't even need that reset button :D
Now I just need one thing to perfect it, here's the script for one of the "dummy" buttons (clickable but doesn't do anything)

Code: Select all
P1:
    physical:
        pinned: true
    quickscript:
        simpleclick:
            pythonfile: SparklingPalaceBookGUI
            region: FakeButtonsReg


How would I make it so that those buttons make the same sound as the working buttons? Since it doesn't really do anything I hope that doesn't make things too complicated...
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby D'Lanor » Fri Mar 26, 2010 5:25 am

Like this...
Code: Select all
P1:
    physical:
        pinned: true
    logic:
        modifiers:
          - name: P1_click
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: FakeButtonsReg
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
            actions:
              - type: responder
                ref: :P1_resp
        actions:
          - type: responder
            name: P1_resp
            responder:
                states:
                  - cmds:
                      - type: soundmsg
                        params:
                            receivers:
                              - 0011:SoundPush
                            cmds:
                              - play
                              - setvolume
                            volume: 1
                    nextstate: 0
                    waittocmd: 0
                curstate: 0
                flags:
                  - detecttrigger
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Multibutton puzzle

Postby Justintime9 » Tue Mar 30, 2010 12:22 pm

Ok, I added that for all of my paintings (changing the name for each button of course) and exported it. Strangely, while all the buttons are clickable, only some of them make the sound. Thinking perhaps my moving the sound emitter, and changing the volume to 2 would do something, I did so and exported.

This time only certain buttons make a sound, but they are different buttons. What's strange is it's in no definite pattern.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby D'Lanor » Tue Mar 30, 2010 12:41 pm

Justintime9 wrote:Ok, I added that for all of my paintings (changing the name for each button of course) and exported it. Strangely, while all the buttons are clickable, only some of them make the sound. Thinking perhaps my moving the sound emitter, and changing the volume to 2 would do something, I did so and exported.

This time only certain buttons make a sound, but they are different buttons. What's strange is it's in no definite pattern.

The volume range goes from 0 to 1. 2 is not a valid value.

Keep in mind that when you use a single emitter for multiple clickables your sound will not trigger a second time when it is already playing. So if you click in fast succession you are definitely going to miss sounds.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Multibutton puzzle

Postby Justintime9 » Tue Mar 30, 2010 2:25 pm

Well actually the first button I pressed didn't work so it's can't be that it was already playing. Also, what would you suggest I set the volume to so it can be heard through the whole room? Although if 1 is the maximum, and it was on 1, either that's not loud enough or volume isn't what's causing it. Any ideas?
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby D'Lanor » Wed Mar 31, 2010 4:38 am

You have to increase your minfdist and maxfdist settings. Your current settings (15 to 30) are for close range. It means that the sound starts fading out at 15 units away from the emitter and has completely faded out at 30 units.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: Multibutton puzzle

Postby Justintime9 » Thu Apr 01, 2010 7:46 pm

Awesome, that was it. Everything seems to be working now.
User avatar
Justintime9
 
Posts: 1188
Joined: Sat Sep 29, 2007 5:37 am

Re: Multibutton puzzle

Postby Grogyan » Fri Apr 02, 2010 10:00 pm

Justintime9 wrote:After perfecting Shinelight Manor, I'm finally ready to add a major puzzle. Here's the plan:

I'll have about 20 buttons, each of which is clickable. 10 to 5, if pressed in the correct order will open a door. There will also be a reset button for the puzzle, to close the door.

How exactly would I create a puzzle like this? I'm assuming there'll have to be a click region for each button, so it's clickable, that will point to a certain python file with the correct order the buttons have to be pushed in. Then of course the reset button will have to work in there somewhere.


Good on you for getting far enough to do it, my puzzle plans are on hold till clickable GUI's and animations are better implmented.
One puzzle idea uses a growing grid of binary digits that have to be toggled in a certain way to release a lock.

I'll keep an ear out to see how your going on this.
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Previous

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests