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 7:40 am

Hey D'Lanor, I just thought of something.

Would it be possible to have Python make the sound file play? What I'm getting at is this:

In my clickfile for the door, the door starts to move due to the OnNotify. Then the door get's moved along it's X coordinates, while the Y and Z stay the same. It knows when to stop because it checks the self.OpenState to see if it is >= to the place it needs to go. And vice versa for closing it.

Now, is there a way to have Python play the ogg sound file either because the button was clicked, or the door is moving?

Just curious. I don't think I've seen a python file for sound so far.
"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 7:46 am

Unfortunately there is no way to play a sound directly with Python. You still need a responder.
"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 8:12 am

Okay, did this because I got curious.

Oh, thanks then D'Lanor. Always good to know what I can and can't do with Python.

Okay, I took another crack at the scripting. This time I went in and made sure all indents were 4 spaces, and any indents with "-" were 2 spaces, and typed it out just like Nadnerb shows, replacing things like the door button name, and the name of the sound emitter.

It exported just fine! No errors!

I had also commented out the quickscript for moving the door, just to be on the safe side for now.

Exported, and linked in. Nope. No sound. But see, now I don't know if it's that scripting doesn't work, or if it's because I how I have the sound emitter.

Do I need to have a sound region for the sound emitter?
What flags should I set for the sound emitter?
Should the sound emitter scripting be before, or after the scripting that Nadnerb gave us?

So, yah, feels like flailing around in the dark, as I'm just not sure if I have one thing okay, but the other wrong. I'll keep trying I guess.

PS. Is there a log of some sort that we can look at like we do for Python scripting? That be REALLY useful to have, at least it would tell me where I'm screwing up.
"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 8:49 am

Good. Some progress. :)

You do not need a sound region since the clickable should activate the sound. As for the flags, keep it simple. I would use only the is3dsound flag.

I don't think the order of objects in alcscript matters. At least not that I have noticed.
"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 9:00 am

Okay, keeping it simple:

I've commented out all my other sounds, just to make sure.

Only flag I have for the emitter is the - is3dsound

So it's exporting with no errors. I link in, and when I walk up to the button, cursor goes hot. I click, but no sound.

So, I'm thinking, if it's giving me a click hot spot, and letting me click, at least we know that the first part of the script is working (meaning that I didn't screw it up typing it in.).

Okay, so here is how the script looks that I typed in (I thought it would be a good idea to use a screen shot, as 1, it shows exactly how I typed it in, indents and all, and 2, it shows my stuff with it.)

Image

Now, that "ref: :SoundResp" was bugging me. I left the colon in, and it exported fine this time. As a last resort, I tried taking the : out, still exported fine, but still no sound.

I don't know what else to mess with......I'm clueless as they say..... :D

Plus I've got to run into town and won't be back until about 2pm my time (couple of hours from now).
"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 9:13 am

Sorry for the double post, but I just had to tell you all this.

One of the people on my team, had a unique idea about making this work. In theory it should work just fine. Practicality leaves a lot to be desired, but hey, if you can't get to the mountain.....make it come to you. Here's his idea:

"Since you can move the door, can you also make it to where the sound region moves? Make it move so that it's triggered by the avie, and the sound plays."

I don't know if using python to move the region through the avatar will still make the region trigger the sound, but if I don't get anywhere else with this, you have to admit it's a very original idea to make a triggered sound work. :D
"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:13 am

andylegate wrote:PS. Is there a log of some sort that we can look at like we do for Python scripting? That be REALLY useful to have, at least it would tell me where I'm screwing up.

Yes, audio.0.elf. Here is mine from a failed test. And it looks like my clicksound pradRingClick is first attached to the correct emitter RingClickEmit, but then gets attached to another sound emitter...

Code: Select all
   Ensuring file pradRingClick.ogg is loadable (RingClickEmit)
   Readied file pradRingClick.ogg for streaming (RingClickEmit)
-0.303550, -0.831778, 3.500000
ASYS: Registering soft sound: RingClickEmit
   Ensuring file pradRingClick.ogg is loadable (ExitMusicEmit)
   Readied file pradRingClick.ogg for streaming (ExitMusicEmit)
   File xLink.ogg allocated in a hardware static voice (0 msec). (cSfxLink01)
Queue: cSfxLink01
ASYS: Registering soft sound: ExitMusicEmit
FTSP: Switching to surface - Dirt
ASYS: -- Initing listener --
-0.303550, 14.168222, 12.925244
ASYS: -- Sending delayed activate --
Starting Fade 65.881640
Playing: cSfxLink01
Stopping Fade 68.903742
FTSP: Switching to surface - (none)
   File xLink.ogg allocated in a hardware static voice (0 msec). (cSfxLink01)
ASYS: Muting audio system
   Ensuring file pradStarMusic.ogg is loadable (StarMusicEmit)
   Readied file pradStarMusic.ogg for streaming (StarMusicEmit)
ASYS: Registering soft sound: StarMusicEmit
   Streaming pradStarMusic.ogg via a hardware dynamic voice. (StarMusicEmit)
ASYS: Un-muting audio system
   File xLink.ogg allocated in a hardware static voice (0 msec). (cSfxLink01)
   File xLink.ogg allocated in a hardware static voice (0 msec). (cSfxLink01)
ASYS: Muting audio system
   Ensuring file pradRingClick.ogg is loadable (ExitMusicEmit)
   Readied file pradRingClick.ogg for streaming (ExitMusicEmit)
STOPPING sound due to deactivate (StarMusicEmit)
ASYS: Registering soft sound: ExitMusicEmit
ASYS: Un-muting audio system
   File xLink.ogg allocated in a hardware static voice (0 msec). (cSfxLink01)
ASYS: -- Sending deactivate/destroy messages --
ASYS: -- Shutdown --
ASYS: Muting audio system
ASYS: Muting audio system


And as you can see my age messes pretty heavily with the sound system so it may not be a good testcase.
"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 11:39 am

Here's my audio log, just the last part, as I simply linked in and gave the button a try. It says it's loading the sound, but that's about all it says:

STOPPING sound due to deactivate (cSfxWaterfall_Branch03)
Ensuring file dooropen.ogg is loadable (zcdoorsnd1)
Readied file dooropen.ogg for streaming (zcdoorsnd1)
337.462555, 292.161682, 15.071585
ASYS: Registering soft sound: zcdoorsnd1
File xLink.ogg allocated in a software static voice (0 msec). (cSfxLink01)
Queue: cSfxLink01
FTSP: Switching to surface - Dirt
FTSP: Switching to surface - Dirt
ASYS: -- Initing listener --
337.462555, 292.161682, 20.217491
ASYS: -- Sending delayed activate --
FTSP: Switching to surface - Dirt
Starting Fade 66.840021
Playing: cSfxLink01
Stopping Fade 69.845567
FTSP: Switching to surface - Dirt
FTSP: Switching to surface - Stone
ASYS: -- Sending deactivate/destroy messages --
ASYS: -- Shutdown --
ASYS: Muting audio system
ASYS: Muting audio system


I'm back to looking at the scripting......comparing it to things that are in the plugin python.

you know, where it says:

Code: Select all
actions:
  - type: responder
    name: SoundResp


In the plugin scripts I don't see name, what I see is tag:

Code: Select all
actions:
  -type: responder
   tag: SoundResp


like that.

Also, I'm wondering if I'm suppose to actually use SoundResp, or if that is suppose to be something that I have in blender. Mainly because I can't find SoundResp anywhere in the plugin script.

still working on it.
"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 11:42 am

Ok, a few things.

The "extra" colon was in fact intentional, and signifies that the following string is a straight name, rather than the $ which is used when referencing responders by tag. In case you might be having a name conflict, try replacing the "ref: :SoundResp" line with "ref: $SoundResp" and replacing the "name: SoundResp" below with "tag: SoundResp".

"SoundResp" is just an arbitrary name or tag used to reference that responder, the symbols determine how it finds the responder during export. If you say "ref: :SoundResp" it will look for a responder named "SoundResp" (ie, it has a "name: SoundResp" field) whereas if you say "ref: $SoundResp" it will look for a responder named "<object name>_SoundResp" where <object name> is the name of the object the alcscript is attached to. (and giving responders a "tag" rather than a "name" will prefix the object name in the same way)
Last edited by Nadnerb on Wed Mar 26, 2008 11:48 am, edited 1 time in total.
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 11:48 am

Okay, give me 5 minutes.

Then we'll see if the puppy works.
"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

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 1 guest

cron