Music modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search
This page deals with music used in mods. For the music in the game, see soundtrack.

Requirements[edit]

First, a modder needs a music file to add to Europa Universalis 4. This may be acquired from other mods, the modder's own personal music library or from other Paradox titles. Adding music to Europa Universalis 4 won't change its checksum, so it's still possible to play on Iron-Man Mode.

The music file must be in the .ogg format, otherwise it won't be played.

If you want to make your Music Mod work with other Music Mods and the Vanilla Music you need to make a Unique name for Both the .asset and the .txt files.

Music folder and .txt file[edit]

In the case it's for a standalone mod, the modder must create a folder name "music" or, in case it's for the vanilla game, the modder must go to the music folder instead.

Add a music file to the folder, then, open your preferred text editor and write following this style (anything inside the # is just to point out what everything means, you don't need to write that):

song = {
 name = "nameofyourmusic.ogg" #nameofyourmusic stands for the name of your music file. The name cannot contain special characters, like accents, comas, spaces or parenthesis. 

 chance = { #Here is the "chance" for the music be played on EU4, let's use, as an example, music you want to be played more to some culture group in-game.
  modifier = {
   factor = 1 #0 would mean it would never be played, 1 means it'll always play to anyone, this is a must to the file, unless you want it to be exclusive to any of the examples below.
  }

  #totally optional from here
  modifier = { #Music will never play to a nation whose culture isn't in the British culture group.
   factor = 0
   NOT = { culture_group = british } 
  }

  modifier = { #Music will play more often for nations whose culture is in the British culture group.
   factor = 2
   culture_group = british 
  }

  modifier = { #Music will play more often after 1500.
   factor = 1.5
   is_year = 1500
  }

  modifier = { #Music won't be played while at war.
   factor = 0
   is_at_war = yes
  }
  #End of options
 } 
} #Remember to check if you closed your brackets, otherwise it won't work.

Add the name of each music added to the file, then name it as you like, as long as it isn't called songs.txt, as that is the vanilla game's music file (unless you want to overwrite it, just make sure it's a .txt file when you save it.

When you're finished, your music folder should have all the music you wanted to add, an unique music.asset file, and an unique .txt file with each song written there.

Known triggers to work[edit]

As shown on the example above, you can add some modifiers for the music chance, here's a brief list of triggers that can be added:

It isn't known which triggers will or will not work with music, this is just a list of triggers known to work.
  • culture
  • culture_group
  • religion_group
  • is_year
  • is_at_war
  • is_part_of_hre
  • num_of_colonists
  • real_month_of_year (0 to 11, 0 being January) Refers to real-life time, not game time. In vanilla this is used for the Christmas music DLC.
  • has_country_modifier
  • has_regency
  • any_owned_province
    • is_overseas
  • government
  • tag
  • war_with
  • owns
  • technology_group
  • capital_scope
    • region
    • continent
Documentation EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localization
Scripting AdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEstatesEventsFactionsGovernmentGreat projectsHistoryIdea groupsInstitutionsMissionsModifiersNation designerPoliciesReligionRebel typesSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe Validator
Guides Adding a province