Author Topic: 2D Music Brick  (Read 2063 times)

I've been suggesting something like this on another suggestion topic but this thing itself deserves a topic for it, basicly it's a single music brick which it's music plays everywhere

Why use a music brick? Why not play music on all clients? As seen here.

Brick_2DMusic (Totally not an edit of Brick_LongRangeMusic)

See Chrono's working one below.
« Last Edit: December 04, 2013, 06:25:23 PM by Reinforcements »

Brick_2DMusic (Totally not an edit of Brick_LongRangeMusic)
Argh it turns every music into earrrape

Why use a music brick? Why not play music on all clients? As seen here.
Because he wants to change the music with events for his updated speedkarts gamemode. He wants every track to have different music.

Argh it turns every music into earrrape
Let me take a look at the file and see if I can fix it. I think range and volume are two different things. Then again, I could just have no idea what I'm talking about.

EDIT: Here's the problemo.
Code: [Select]
datablock AudioDescription(Rein2DMusicLooping3d : AudioMusicLooping3d)
{
maxDistance = 99999;
referenceDistance = 99999;
};

datablock fxDtsBrickData(brick2DMusicData : brickMusicData)
{
uiName = "Music 2D";
musicRange = 99999;
musicDescription = Rein2DMusicLooping3d;
};
He just made everything 99999.

Quote from: description.txt
Edited by Reinforcements because Filipe needed really long range music bricks.
That's not what 2D means.
« Last Edit: December 04, 2013, 03:24:57 PM by blueblur121 »

It seems like this will be more complicated than I thought.

It seems like this will be more complicated than I thought.
Or you could ask marble man. I'm pretty sure there's a good chance that he's god.

https://www.dropbox.com/s/8smpng38gsffasy/Brick_2dMusic.zip

Done.
Was easy.
Should work (in a kind of hacky way) with other range music bricks.

Tested, doesn't earrape.

https://www.dropbox.com/s/8smpng38gsffasy/Brick_2dMusic.zip

Done.
Was easy.
Should work (in a kind of hacky way) with other range music bricks.

Tested, doesn't earrape.
Thanks a bunch man, now I will try to see if it works
« Last Edit: December 04, 2013, 04:29:41 PM by Filipe »

Code: [Select]
{
maxDistance = 999999;
referenceDistance = 1;
is3D = 0;
};

datablock fxDtsBrickData(brickHalfMusicData : brickMusicData)
{
uiName = "Music (Server-Wide)";
musicRange = 999999;
musicDescription = AudioMusicLooping2d;
};
schedule(0,0,exec,"Add-ons/Brick_2dMusic/Support_CustomRangeMusic.cs");
Doesn't look a whole lot different to me. All I see that is different is referenceDistance = 1 and is3D = 0. is3D wasn't even in the other brick's code so I assume it's in the custom range support.

Anyway, not only is it a way to get server-wide music(almost) but it's a brick that can be inherited by a build save. This means every track can have its own music.

EDIT: I assume that referenceDistance is the volume because when it was 99999 it was ear-rape. This modified version only changes one thing: referenceDistance = 2. This one should be louder than when it was 1. Sorry, I can't test it to see if I'm wrong about the variable. I'm on my laptop. Once again, this is based on assumption. Don't expect it to work the first time. Here's the link: https://www.dropbox.com/s/ifrlpc9lziysk9z/Brick_2dMusic_fixed.zip
« Last Edit: December 04, 2013, 04:23:09 PM by blueblur121 »

Reference distance is the earrape distance. I'm not sure why 2d datablocks even need a reference distance. They shouldn't be falling off. Which is why you can still hear it no matter how far you go.

Also, the huge difference is that reference distance and the is3d values, the support script was modified to accept the is3d value instead of always assuming 1.

This is why I said "Done. Was easy." Because it really wasn't that difficult. Of course, because of other add-ons containing the same support script, I had to modify it and put it on a scheduled execute.


As for the volume, I'm not sure if I can do anything about that, I'll take a look at things.

If you make a stereo loop and start it through a dedicated server, not a regular server (select it but dont start the server), Blockland doesn't remove it, but the music wont change its volume no matter how close you get, it'll stay to how it was made.

-snip-
-snip
Well okay then Blockland. Apparently ReferenceDistance scales the volume.

I'll fix and re-upload so you don't have to deal with some awkward "fixed" in the add-on name but I'll still give credit.


Or you could ask marble man. I'm pretty sure there's a good chance that he's god.
rly