FANDOM



playMusic: ['songidMusic']Edit

DescriptionEdit

Starts playing specified music


UsageEdit

First you will need to load your music or sound file, just as you would your imageData.

configSettings: {
        sounds: {
              songtitleMusic: /happyMod/happyoggfile
          }
  }



Note: Unlike imageData, you will need to add `/` forward slash to the front of your mod folder name.

Note: the ogg extension is not required, it is assumed you are using an ogg file. (programs like Audacity cav save in ogg format)

Note: the word `Music` must be included in the songtitle id, or it won't play.


ExampleEdit

# /mods/happyMod/mod.hjson
#
# Rquires a happyoggfile.ogg in the /happyMod directory.
#
# To try this example, double click torch item in your inventory.

{
  modInfo:
  {
    id: happyMod
    name: Happy Mod
    authors: steam user name
    version: "0.1.0.0"
    enabled: true
    defaultLang: en
    languages: en
    description: "Happy Enhancements."
    preview: happyPreview
  }
  imageData:
  [
    {
      id: happyPreview
      file: happyMod/images/happyPreview.png
    }
   ]
  configSettings: {
        sounds: {
              happyMusic: /happyMod/happyoggfile
          }
  }

  modEntries: [
      {
       id: it-torch
       targetId: *it-torch
       useEvents: {
        playMusic: ['happyMusic']
       }
      }
   ]
}

ExampleEdit

   playMusic: ['thm_nature_mystic_1', 'thm_nature_mystic_2']

ParametersEdit

Parameter Description Notes
Community content is available under CC-BY-SA unless otherwise noted.