Barotrauma

Barotrauma

Jukebox music
BossatronTimothy LEAD  [developer] 10 Jul, 2022 @ 9:20pm
how to add your own songs (Jukebox music)
The song NEEDS TO BE A OGG NOT A MP3
How to make songs

I like using https://jsonformatter.org/xml-formatter

here an example of what it should look like

I like using https://jsonformatter.org/xml-formatter

https://drive.google.com/drive/folders/1Jw9n-RUxr0czxFVfzEGPB9yUthxG-mj1?usp=sharing

just name the xml files filelist and items

make a folder in Barotrauma\LocalMods


use run and search "Appdata"
To make your own music you need to go to AppData\Local\Daedalic Entertainment GmbH\Barotrauma\WorkshopMods\Installed\2831597994\How to make music
Then when you see "filelist Example" open it up and copy the code and change the MM_Song to your songs name
and change <Other file="%ModDir%/Song.ogg"/> to the name of the OGG file then save it to filelist

filelist.xml

<contentpackage name="MM_Song" corepackage="false" modversion="1.0.2" gameversion="0.18.12.0">
<Item file="%ModDir%/items.xml"/>
<Other file="%ModDir%/Song.ogg"/>
</contentpackage>


The song NEEDS TO BE A OGG NOT A MP3

and now for the "items Example" you only in to change song to the name of your song

items.xml

<Items>
<!-- Change name and identifier of the new disc here -->
<Item name="Music Disc: song" identifier="MM_song" category="Misc" maxstacksize="8" Tags="smallitem,m_disc" canbepicked="true" description="" cargocontaineridentifier="metalcrate" scale="0.5" impactsoundtag="impact_metal_light">
<ItemComponent characterusable="false">
<StatusEffect type="OnUse" target="This">
<!-- Change path to the new audio file here -->
<sound file="%ModDir%/song.ogg" type="OnUse" range="2000.0" loop="true" volume="1.0"/>
</StatusEffect>
</ItemComponent>
<Price baseprice="10" soldeverywhere="false">
<Price locationtype="outpost" multiplier="1.3" minavailable="1"/>
<Price locationtype="city" multiplier="1.25" minavailable="1"/>
<Price locationtype="research" multiplier="1.1" sold="false"/>
<Price locationtype="military" multiplier="1.1" sold="false"/>
<Price locationtype="mine" multiplier="0.8" sold="false"/>
</Price>
<Deconstruct time="5">
<Item identifier="steel" amount="4"/>
<Item identifier="plastic" amount="4"/>
</Deconstruct>
<Fabricate suitablefabricators="fabricator" requiredtime="10">
<RequiredSkill identifier="mechanical" level="10"/>
<RequiredItem identifier="steel" amount="2"/>
<RequiredItem identifier="plastic" amount="2"/>
</Fabricate>
<Sprite texture="%ModDir:Jukebox music%/disc.png" sourcerect="0,0,64,64" depth="0.55" origin="0.5,0.5"/>
<Body width="45" height="30" density="50"/>
<Holdable slots="Any,RightHand,LeftHand" handle1="0,0" msg="ItemMsgPickUpSelect">
<StatusEffect type="OnBroken" target="This">
<Remove/>
</StatusEffect>
</Holdable>
</Item>
</Items>

and save it and name it to items
The song NEEDS TO BE A OGG NOT A MP3
Last edited by BossatronTimothy LEAD; 25 May, 2023 @ 8:43pm
< >
Showing 1-4 of 4 comments
BossatronTimothy LEAD  [developer] 31 Aug, 2022 @ 8:54pm 
sometimes the ogg doesn't work
BossatronTimothy LEAD  [developer] 24 Oct, 2022 @ 8:40am 
here an example of what it should look like

I like using https://jsonformatter.org/xml-formatter

https://drive.google.com/drive/folders/1Jw9n-RUxr0czxFVfzEGPB9yUthxG-mj1?usp=sharing

just name the xml files filelist and items
Vomitus 27 Jun, 2024 @ 9:20pm 
try including '.ogg' to 'Viva_Victoria' in the filelist.xml and the correct file path.

<Other file="%ModDir%/Viva_Victoria.ogg" />

and in the items.xml you need to include the same file path

<sound file="%ModDir%/Viva_Victoria.ogg" type="OnUse" range="2000.0" loop="true" volume="1.0" />
Yourmedic 27 Jun, 2024 @ 9:28pm 
Originally posted by Vomitus:
try including '.ogg' to 'Viva_Victoria' in the filelist.xml and the correct file path.

<Other file="%ModDir%/Viva_Victoria.ogg" />

and in the items.xml you need to include the same file path

<sound file="%ModDir%/Viva_Victoria.ogg" type="OnUse" range="2000.0" loop="true" volume="1.0" />


you just saved me a whole week of work
< >
Showing 1-4 of 4 comments
Per page: 1530 50