Creating Sound Packs - Archomeda/csl-ambient-sounds-tuner GitHub Wiki
Creating a sound pack is fairly easy. Just follow the following steps.
Please note that this feature is still in beta. Although it's unlikely, it's possible that the steps to create a sound pack might change over time and require you to adopt these changes in your sound pack in order for it to work again.
-
You have to create a custom mod first. You only have to read the overview and the part on how to start a mod in order to get familiar with the folder and file structure.
-
You only have to create a bare class that implements IUserMod. If you've done that, the file should look something like this (of course, names can differ):
using ICities;
namespace YourSoundPack
{
public class YourSoundPackMod : IUserMod
{
public string Name
{
get { return "YourSoundPack"; }
}
public string Description
{
get { return "This is the description of your sound pack"; }
}
}
}That's all you have to do. You don't even have to have Visual Studio installed. You can put this file in the Source folder in the root folder of your mod (if you've read the Cities Skylines wiki you know what I'm referring to). Just don't forget the file should have the extension .cs, and not .txt.
The mod is not finished yet! You have to define which sounds should have which audio files that you include in your sound pack mod. You have two options, you can create an XML file, or a YAML file. Both provide the same features and only differ in syntax. You can choose whatever you prefer. If you provide both files, only the YAML file is used. For more advanced configuration, please check the documentation.
An example XML file can be found [here](Example XML file structure).
- Create and open the XML file
AmbientSoundsTuner.SoundPacks.xmlin the root folder of your mod, and add the following structure:
<?xml version="1.0" encoding="utf-8"?>
<SoundPacksFile version="2">
<SoundPacks>
<SoundPack name="YourSoundPackName">
<Ambients>
</Ambients>
<AmbientsNight>
</AmbientsNight>
<Animals>
</Animals>
<Buildings>
</Buildings>
<Vehicles>
</Vehicles>
<Miscs>
</Miscs>
</SoundPack>
</SoundPacks>
</SoundPacksFile>Please do not change the version declaration in the SoundPacksFile element, do this only when there's a newer version and you want to upgrade. This is for internal use only to check for different version structures, just in case if the XML file structure changes at some point. The current version is 2.
- As you can see, there are six categories, and it's clear what those categories are. You can also have more than one sound pack by adding another
SoundPackelement withinSoundPacks. In this tutorial, we want to add a custom sound for cows. Since the cow is an animal, this should be declared in theAnimalssection. For that, we add the following inAnimals:
<Animal type="Cow" name="Cow says moooooooooo">
<AudioInfo>
<Clip>Sounds/NotTotalyMoooooo.ogg</Clip>
<Volume>1</Volume>
<MaxVolume>2</MaxVolume>
<Pitch>1</Pitch>
<FadeLength>0.1</FadeLength>
<IsLoop>false</IsLoop>
<Is3D>true</Is3D>
<IsRandomTime>false</IsRandomTime>
</AudioInfo>
</Animal>Most options should have a clear meaning. Keep in mind that if you do not explicitly declare an element, it will have a default value. For numbers, this is 0. For booleans, this is false. For lists, this is an empty list. Etc.
An example YAML file can be found [here](Example YAML file structure).
- Create and open the YAML file
AmbientSoundsTuner.SoundPacks.ymlin the root folder of your mod, and add the following structure:
ConfigVersion: 2
SoundPacks:
- Name: YourSoundPackName
Ambients:
AmbientsNight:
Animals:
Buildings:
Vehicles:
Miscs:Please do not change ConfigVersion, do this only when there's a newer version and you want to upgrade. This is for internal use only to check for different version structures, just in case if the YAML file structure changes at some point. The current version is 2.
- As you can see, there are six categories, and it's clear what those categories are. You can also have more than one sound pack by adding another element to
SoundPacks. In this tutorial, we want to add a custom sound for cows. Since the cow is an animal, this should be declared in theAnimalssection. For that, we add the following inAnimals(note that YAML files use spaces as whitespace indentation, tabs are not allowed):
- Type: Cow
Name: Cow says moooooooooo
AudioInfo:
Clip: Sounds/NotTotalyMoooooo.ogg
Volume: 1
MaxVolume: 2
Pitch: 1
FadeLength: 0.1
IsLoop: false
Is3D: true
IsRandomTime: falseMost options should have a clear meaning. Keep in mind that if you do not explicitly declare an element, it will have a default value. For numbers, this is 0. For booleans, this is false. For lists, this is an empty list. Etc.
-
First of all: You must own copyright of the audio files or have explicit authorization of the original copyright holder to share it on the Steam Workshop. If you fail to do so, it's your own fault if it gets reported and removed from the Steam Workshop.
-
If you are all clear, copy the files to whatever location you have defined in the XML file, as long as it's a relative path to the root folder of your mod.
After you've done all this, you should end up with the folder structure that is similar to the following:
Sound Pack root folder/
├── AmbientSoundsTuner.SoundPacks.xml or AmbientSoundsTuner.SoundPacks.yml
├── <Mod_Name>.dll (replace <Mod_Name> with your filename, this file is automatically generated by the game)
├── Source/
│ └── <Mod_Name>.cs (replace <Mod_Name> with your filename)
└── Sounds/
└── Your sounds
Note that it's not required to have the sounds in a dedicated folder. You can place them wherever you want, as long as they are inside the root folder. If everything is fine, you can upload it to the Steam Workshop. The process on how to do this will not be explained. Don't forget to add Ambient Sounds Tuner as a dependency of your mod.