Sound Flags

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: Sound Flags

Postby andylegate » Wed Mar 26, 2008 11:55 am

Nope.....nothing happens when I click. Like I said, I'm getting the hot spot to click, just nothing is happening.

Looked at the audio log, same as what I posted above.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby D'Lanor » Wed Mar 26, 2008 11:57 am

Not me. I quit. This is just too messed up.
"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: Sound Flags

Postby Nadnerb » Wed Mar 26, 2008 11:59 am

Just as a note: I have tested this alcscript by modifying BoxAge with the following script:
Code: Select all
OrganKeys:
    logic:
        modifiers:
          - cursor: poised
            flags:
             - localelement
            activators:
             - type: objectinvolume
               remote: OrganClickRgn
               triggers:
                - any
            conditions:
             - type: activator
               activators:
                - type: picking
             - type: objectinbox
               satisfied: true
            actions:
             - type: responder
               ref: $SoundResp
        actions:
          - type: responder
            tag: SoundResp
            responder:
               states:
                - cmds:
                   - type: soundmsg
                     params:
                        receivers:
                         - 0011:3DSoundEmitter
                        cmds:
                         - play
                         - setvolume
                        volume: 1
                     waiton: -1
                  nextstate: 0
                  waittocmd: 0
               curstate: 0
               flags:
                - detect_trigger

It worked perfectly, so if this is done right, it should work for you.

Edit: oh dear, it looks like it didn't work for you. Ok, time for the questions.
a) could you post the exact script you used in a screenshot that includes the regions and clickables
b) does your click region encompass the right area, does it have scaling on it? (I don't know if that's actually still an issue, but good to check)
c) check all the names, capitalization, etc. (I know you've probably done this)

I'll post a pic of what I did as an example:
Show Spoiler
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Sound Flags

Postby andylegate » Wed Mar 26, 2008 12:07 pm

give me a few minutes and I'll post that.

On a side note, i just took a look at the export log.

It's not showing any logic help or modifiers for the door sound emitter. It's showing the stuff for the doorbutton, but not for the sound emitter, like you see for other sounds.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby Nadnerb » Wed Mar 26, 2008 12:12 pm

I just noticed something. In your script, you have a space in the "0011:emitterName" string, so that it looks like this: "0011: emitterName". the ref parser may be treating that space as the first character of the object name, since the "0011:emitterName" is a ref string, one single lump, not a dict or value read by alcscript... (the 0011 part means it's looking for a sound interface with the name:this)
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Sound Flags

Postby andylegate » Wed Mar 26, 2008 12:20 pm

ooo.....I'll change that and see what happens. In the mean time, here's a pic of the region, and then a pic of the script, including the emitter part.

This is actually pretty big. The doors are almost 10 feet high.
Show Spoiler


Show Spoiler
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby andylegate » Wed Mar 26, 2008 12:28 pm

I'LL BE A SOB! IT WORKED! IT WORKED!!!!! Not just once, but everytime I click the button!

Whew!

Okay, now after all that, comes the next question, one that D'Lanor brought up. Will a quickscript on the same door button work for opening the door? I've got it commented out right now, as when I added the script for the sound, my door stopped working.

Off to see what happens. I'll post the results. here.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby D'Lanor » Wed Mar 26, 2008 12:28 pm

Well, as you could see it did work in a way but the sound got attached to a totally different sound emitter and replaced its original sound, which is odd because that emitter is even in a different prp file.

The script did add a responder to the correct prp file though. I can see a pretty little responder called SoundResp in PRP Explorer. It just doesn't play the sound. Not even when I tickle it manually with Python code.

What most likely messed it up for me was the fact that I left the quickscript for the button active as well. I did ask about that a few posts back. But then that quickscript is the main thing. The clicksound would just be a little extra which I don't really need. Besides, the sound would be out of sync with the avatar due to the seektime for the animation. All in all it is just too much trouble for something so small.

Edit: Ok, I will try removing that space which I have as well (who would have thought about such an exception).
"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: Sound Flags

Postby andylegate » Wed Mar 26, 2008 12:40 pm

Alas, no. My door no longer works. I mean the sound keeps working, but now it will no longer move.

Do I put the quickscript stuff for moving the door somewhere inside the sound script? I'm betting so. Off to look.

Oh, yah, I noticed that Trylon had a selfanimation in his functest age, but nothing happens for me. Do we have Avatar animations?

*yes Andy* is the most likely answer *but you're being greedy. Crack open a beer and celebrate having a clickable sound now and worry about the other later.*
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Sound Flags

Postby Nadnerb » Wed Mar 26, 2008 12:54 pm

Ok, what's probably happening is that it is creating two picking detector/modifier/things with the same name, the first one for the quickscript, and the second one for the sound, which is overwriting the first.

The plus side is that you don't have to do much to add additional actions to your existing click alcscript. Drop the quickscript entirely and put in this instead:
Code: Select all
doorbutton:
    logic:
        modifiers:
          - cursor: poised
            flags:
             - localelement
            activators:
             - type: objectinvolume
               remote: doorclick
               triggers:
                - any
            conditions:
             - type: activator
               activators:
                - type: picking
             - type: objectinbox
               satisfied: true
            actions:
             - type: responder
               ref: $SoundResp
             - type: pythonfile
               ref: $DoorOpen
        actions:
          - type: pythonfile
            tag: DoorOpen
            pythonfile:
               file: <python file name>
               parameters:
                - type: activator
                  ref: logicmod:$DoorOpen
                - type: string
                  value: doorbutton
          - type: responder
            tag: SoundResp
            responder:
               states:
                - cmds:
                   - type: soundmsg
                     params:
                        receivers:
                         - 0011:zcdoorsnd1
                        cmds:
                         - play
                         - setvolume
                        volume: 1
                     waiton: -1
                  nextstate: 0
                  waittocmd: 0
               curstate: 0
               flags:
                - detect_trigger

this should be the same as your script, with a ref to a pythonfilemod added in the modifier actions, and a pythonfile action (with the same tag) added in the actions.

Also, it is definitely possible to tie an avatar animation to this as well. The quickscript does it by passing the oneshot to the python file and having it activate it, (this is probably why it's not working for you, because you're supposed to add some extra python to make the animation actually run. :P) but you can just as easily add the oneshot to your responder. The only tricky bit would be synchronizing it.. you'd either have a delay in they python to wait for the seek time of one second, or you'd wait for a callback from the seek and animation in your behavior.. that, however, is untested, and I don't know if that's implemented.
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests