Curious Expedition Wiki
Advertisement

Let's create a mod that plays a custom sound effect.

Basic setup[]

First you should set up your new mod as described on the Getting Started page (everything up to the Adding a language file section).

Importing the sound asset[]

First make sure the sound file is in the correct format. Curious Expedition supports .ogg files and .mp4 files. If it's not in one of those formats, search online for a file converter.

If you don't have a sound, download this one.

Then, make a 'sfx' folder inside your mod folder, and put your sound file in there.

Finally, you need to tell the game to load your file and give it an ID that will be referenced later. You do this by adding a sounds section to the configSettings section, with one entry for each sound in the format "soundID: /path/to/sound", for example:

configSettings: {
  sounds: {
    test_cow_moo_sound: /sound_example/sfx/cow_moo
  }
},

Note that the path must be in this EXACT format, with the mod folder name first, and the filename last WITHOUT the file extension. For more information about this section, see Modding:config.

Playing the sound[]

To play the sound, use the PlaySound command inside an event. Add this test event to your mod's 'modEntries' section:

{
  id: evt-test-customSound
  showImage: {type: day}
  text: "I hear a cow??!?"
  playSound: test_cow_moo_sound
  actions: [
    {
      actionText: "Again!"
      events: evt-test-customSound
    }
    {
      actionText: "That's enough." 
    }
  ]
}

Note that the parameter for playSound should be the ID of the sound that you specified in the configSettings section.

Testing[]

Customsound.png
Great! Now we can already test our item. Start the game and make sure to activate your mod in the Mod Menu. Jump into a test game and use the debugBar to trigger the event by typing the name into the search bar. You should hear the sound every time the event is triggered.

You can download this mod as an example from the steam workshop .

Advertisement