Page 1 of 1

Clickable sound not in sync

PostPosted: Mon Dec 28, 2009 1:37 pm
by wodan944
Hi, I have this problem, when i click with my mouse on a button, you hear the sound i've made for it, but then the avatar pushes the button.
Is there a script for making the sound and the pushing of the Avatar in sync?
Hope someone can help me.

Greetz Wodan944

Re: Clickable sound not in sync

PostPosted: Mon Dec 28, 2009 4:47 pm
by D'Lanor
Yes, there is. Take a look at the wiki section here about adding a callback to your oneshot message.

Re: Clickable sound not in sync

PostPosted: Tue Dec 29, 2009 4:31 am
by wodan944
Thank you for your reply, D'Lanor,
I assume the script on the Wiki is for buttons, but were do i put the callback etc in my Button script.
The script below is part of a puzzle in my new Age and so it's a little different as shown at the Wiki

Code: Select all
SWDoor_1Button:
    animations:
        - name: SWdoor_1buttonclick
          autostart: 0
          loop: 0
   logic:
        modifiers:
          - tag: AutoClick
            cursor: poised
            flags:
              - localelement
            activators:
              - type: objectinvolume
                remote: Door_1ButtonRgn
                triggers:
                  - any
            conditions:
              - type: activator
                activators:
                  - type: picking
              - type: objectinbox
                satisfied: true
            actions:
              - type: pythonfile
                ref: $BoolToggle
        actions:
          - type: pythonfile
            tag: BoolToggle
            pythonfile:
                file: xAgeSDLBoolToggle
                parameters:
                  - type: activator
                    ref: logicmod:$AutoClick
                  - type: string
                    value: Ashream_3ingang
                  - type: skip
                  - type: skip
                  - type: string
                    value: Ashream_3ingang
          - type: pythonfile
            tag: BoolRespond
            pythonfile:
                file: ashAgeSDLBoolRespondReset
                parameters:
                  - type: string
                    value: Ashream_3ingang
                  - type: responder
                    ref: :Door_1Open
                  - type: responder
                    ref: :Door_1Close
                  - type: bool
                    value: false
                  - type: bool
                    value: true



Wodan944

Re: Clickable sound not in sync

PostPosted: Tue Dec 29, 2009 6:35 am
by D'Lanor
It would be part of your responder scripts. Door_1Open and Door_1Close.

Re: Clickable sound not in sync

PostPosted: Tue Dec 29, 2009 1:30 pm
by wodan944
Thank you, D'Lanor
Its now working fine.

Wodan944