Modding:MusicConfig Property Type: Difference between revisions

From Vintage Story Wiki
(Created page with "<languages/> <translate> Test </translate> {{jsonnavboxes|audio=0}}")
 
m (Creation of MusicConfigProperty Page)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
Test
 
=== Usage ===
The '''MusicConfig''' property type is a '''content-type''' used to add new music tracks to Vintage Story. Any number of mods can add new tracks, however the ''properties'' element will only load from one mod. Because of this, it is not recommended to add the ''properties'' element to your mod.
 
MusicConfig files must be created as "''music/musicconfig.json''" in a mod's domain folder for them to be loaded.
 
The script for MusicConfig is currently not available on GitHub.
 
=== Property Reference ===
{| class="wikitable sortable mw-collapsible mw-collapsed"
!Property ID
!Type
!Description
|-
|Properties
|{{Proptype|MusicConfigProperties}}
|Defines some properties for controlling the music engine. It is recommended to not include this in a mod.
|-
|Tracks
|{{Proptype|Array}} ({{Proptype|SurfaceMusicTrack}} or {{Proptype|CaveMusicTrack}})
|A list of music track properties, one entry per track.
|}
 
=== Example ===
{| class="wikitable mw-collapsible mw-collapsed"
!survival/music/musicconfig.json
|-
|<syntaxhighlight lang="json">
{
"properties": {
"mindelay": 4,
"maxdelay": 8
},
"tracks": [
{
"$type": "Vintagestory.API.Client.SurfaceMusicTrack, VintagestoryAPI",
"file": "night-to-day",
"name": "Night To Day",
"onPlayList": "survival|creative",
"minhour": 3,
"maxhour": 5
},
{
"$type": "Vintagestory.API.Client.SurfaceMusicTrack, VintagestoryAPI",
"file": "setting-sun",
"name": "The Setting Sun",
"onPlayList": "survival|creative",
"minhour": 3.25,
"maxhour": 5.25
},
...
    ]
}
   
</syntaxhighlight>
|}
</translate>
</translate>
{{jsonnavboxes|audio=0}}
{{jsonnavboxes|audio=0}}