Author Topic: 2D Sound?  (Read 661 times)

So we all know about Chrono's 2D Music system that plays music to the client through events.

What about 2D sounds? The music system only shows the music files in the music folder. I have music files that are > 1 MB, so I made this nice script that allowed me to use them as sound effects:

Code: [Select]
datablock AudioProfile(Music_1_Sound)
{
filename = "./Music_1.ogg";
description = AudioClose3D;
preload = false;
};

datablock AudioProfile(Music_2_Sound : Music_1_Sound)
{
filename = "./Music_2.ogg";
};

datablock...etc.

Now that I have that, how would I play it to the client? (I want it to loop, too. When I changed the description to AudioCloseLooping3D, the music didn't show up in the playSound list.)

You can do %client.play2D(%musicDatablock); I think.

I wasn't really expecting it to be that easy, but I guess I can try it....

EDIT: I typed this into the console:

Code: [Select]
findclientbyname(Legojak).client.play2D(%Music_1_Sound);
and got:

Code: [Select]
Unable to find object: '' attempting to call function 'play2D'
« Last Edit: March 05, 2013, 01:00:01 PM by Legojak »

I wasn't really expecting it to be that easy, but I guess I can try it....

EDIT: I typed this into the console:

Code: [Select]
findclientbyname(Legojak).client.play2D(%Music_1_Sound);
and got:

Code: [Select]
Unable to find object: '' attempting to call function 'play2D'
findClientByName returns the client. So findClientByName("jes00").client makes no sense.

Works perfectly! Now how do you loop it?

It's something along the lines of "description = "AudioClosestLooping3D";" but that might not be exactly right.

EDIT: Yep, checked against the Star Trek weapon mod I made that one time. It's AudioClosestLooping3D.

It's something along the lines of "description = "AudioClosestLooping3D";" but that might not be exactly right.

EDIT: Yep, checked against the Star Trek weapon mod I made that one time. It's AudioClosestLooping3D.

But that says 3D... Isn't there something for 2D?

But that says 3D... Isn't there something for 2D?

Replace "3D" with "2D"

But that says 3D... Isn't there something for 2D?

Even if there wasn't, couldn't you just make your own AudioDescription?