Author Topic: How do I package Sounds that will override default ones?  (Read 773 times)

I have created a bunch of custom sounds that currently live in the ./base/data/sound folder and pretty much overlap the default sounds (jumping, brick placing hammering etc...)

I would like to know if there is a way to package these into a zip folder and distribute this as an add-on? or will people just have to take the sounds and overwrite the files?

If you can package it as an add-on, what checks does the .cs file have to have?

im feeling like unless you package every piece of code that runs functions that play those sounds, you can't release it as an addon in a zip. the easiest way is just to instruct users how to set up the files.

Just do it like this:
Code: [Select]
package replacedSounds
{
function JumpSound::onAdd(%this)
{
parent::onAdd(%this);

%this.fileName = "./jumpSound.wav";
}
};
activatePackage(replacedSounds);

Add more sounds to the package to replace more of them.

I don't believe you'd need to package that.

I don't believe you'd need to package that.
It's parenting
Code: [Select]
::onAdd(%this) so yes, you'd need to package that.

It's parenting
Code: [Select]
::onAdd(%this) so yes, you'd need to package that.
It's parenting ::onAdd on the object's name. If the entire function doesn't exist (JumpSound::onAdd), you don't package it. Packaging is only for already existing functions. Calling Parent on an unpackaged ObjectName::onAdd will properly call the ClassName::onAdd. While packing the nonexisting function will probably attempt to call the parent non-existing function.

i would also love to know this too

specifically just all sounds related to bricks