×
Create a new article
Write your page title here:
We currently have 3,035 articles on YumeWiki. Type your article name above or click on one of the titles below and start writing!



YumeWiki
3,035Articles

Template:BGM: Difference between revisions

(Undo revision 493789 by ZASNK (talk))
Tag: Undo
(I need to learn lua)
Line 1: Line 1:
<includeonly><!--
<includeonly>{{#if:{{{filename|}}}|{{#ask: [[File:{{{filename}}}]]
--><li>{{#if:{{{title|}}}<!-- Check for title
|mainlabel=filename
-->| {{#if:{{{filename|}}}<!-- Check for filename
|?Title=title
  -->| {{#set: Has BGM={{{title}}};{{filepath:{{{filename}}}}};File:{{{filename}}};{{{label|}}};{{#invoke:SoundtrackTable|formatRecord|{{{soundroom|}}}}};{{{speed|}}};{{{author|}}} }}<!-- Create record
|?File author=author
      -->[[:File:{{{filename}}}|{{#tag:nowiki|{{{title}}}}}]]<!-- Link to file
|?Audio speed=speed
      -->{{#if: {{filepath:{{{filename}}} }}<!-- check if file is uploaded
|format=template
      -->|<!-- if uploaded, do nothing
|template=BGMFileData
      -->|[[Category:Missing BGM]]<!-- not uploaded, place category
|named args=1
      -->}}<!--
|link=none
  -->|{{#tag:nowiki|{{{title}}}}}<!-- No filename - title is still shown
|userparam={{{title}}};{{{filename}}};{{{label|}}};{{{soundroom|}}};{{{speed|}}};{{{author|}}}
  -->}}<!-- End filename check
}}
      -->{{#ifeq:{{{speed|}}}|100<!-- Is speed 100
|<span tabindex="0" style="font-size:125%; line-height:1em;" title="{{#if:{{{author|}}}|By {{{author}}} –&#32;}}Plays at {{{speed|unknown}}}% speed">🔇 </span>{{{title}}}
      -->|<!-- If 100 - nothing
}} {{#if:{{{label|}}}|{{{label}}}&#32;}}{{#if:{{{soundroom|}}}|<span style="white-space:nowrap;">(No. {{#arraymap:{{{soundroom|}}}|,|$|$|&comma;\s|and}})</span>}}<br></includeonly><noinclude>
      -->|<!-- If not 100
        -->&nbsp;{{#if:{{{speed|}}}<!-- Check if empty
        -->|<span style="font-size:85%">({{{speed|}}}%)</span><!-- Not empty
        -->|<span style="font-size:85%;" class="explain" tabindex="0" title="Speed unspecified">(??%)</span><!-- Empty
        -->}}<!-- End speed empty check
      -->}}<!-- End speed equality check
  -->{{#if:{{{soundroom|}}}<!-- Soundroom number check
  -->|<!--
      -->{{#ifeq:{{{soundroom|}}}|None<!--
      -->|<!-- If it equals None, put nothing
      -->|&#32;<span style="white-space:nowrap;">(No.&nbsp;<!-- Beginning part
      -->{{#arraymap:{{{soundroom|}}}|,|x|x|&comma;\s|and}}<!-- List of numbers
      -->)</span><!-- end part
      -->}}<!-- equals None
  -->}}<!-- End soundroom check
  -->{{#if:{{{author|}}}<!-- Check for author
  -->|&#32;by&nbsp;{{{author}}}<!--
  -->}}<!-- End author check
  -->{{#if:{{{label|}}}<!-- Check for label
  -->|<nowiki />: {{{label}}}<!-- Add label
  -->}}<!-- End label check
-->|Please specify the BGM's title.<!-- If no title - output error
-->}}<!-- End title check
-->{{#ifexpr: {{NAMESPACENUMBER}} = 3018<!-- Limit to CoUn
-->|  {{#if: {{{author|}}}<!-- Check if author has any value
  -->|<!-- nothing if author is specified
  -->|[[Category:Missing BGM author]]<!-- If empty add category
  -->}}<!-- End author check
-->}}<!-- End namespace check
--></li><!-- close item --></includeonly><noinclude>
{{Documentation}}
{{Documentation}}
</noinclude>
</noinclude>

Revision as of 21:02, 26 September 2024

Documentation (for the above template, sometimes hidden or invisible)

Description

Renders a link (if provided) to an area's BGM, and sets a record that can be queried.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Titletitle

The BGM's title to be displayed. This could either be an official title, or the original filename exclusive of extension.

Example
いかる ひのやま
Stringrequired
Filenamefilename

The audio's filename, pointing to the file as uploaded. If left blank, no link will be displayed.

Example
CU maple-clicking 60.ogg
Stringsuggested
Labellabel

A label describing where or when the BGM would play. This could be a sub-area, an event, or the area under different conditions.

Example
FC Overworld
Stringoptional
Sound Room IDsoundroom

If the BGM is featured in a Sound Room like in Yume 2kki, provide the ID as seen in the Sound Room.

Example
307C
Stringoptional
Speedspeed

The speed at which the track is set to play in-game.

Example
60
Numberrequired
Authorauthor

Credit the track's composer/author. Usually only applicable to collaborative games.

Example
MadameMimic
Stringoptional

Semantic properties

This template exposes the following semantic properties.

Property name Description Data type Cardinality
Has BGM The main record that holds all the other properties. Record Single
BGM/Title The title of the BGM, either official or from the game files. Text Single
Has media path The path leading to the audio file on the wiki. URL Single
BGM/Audio The wiki page of the audio file. Page Single
BGM/Label A label describing the BGM, usually where it plays in the location. Text Single
BGM/Soundroom The ID of the track in the game's Sound Room or equivalent feature, if one is present in the game. Text Multiple
BGM/Speed The speed at which the BGM is set to play in the location. This should correspond to the audio file on the wiki. Number Single
BGM/Author The author(s) who created the BGM. Usually only applicable to collaborative games. Text Multiple

Syntax

{{BGM|title= |filename= |label= |speed= |soundroom= |author= }}

Sample

The following input:

{{BGM|title = tonny31.6|filename = Tonny31.6 (284D).ogg|label = Budding Life World|soundroom = 248D}}

Produces:

tonny31.6 (??%) (No. 248D): Budding Life World

Note: This sample uses {{BGMDisplay}} to avoid creating a record property.

Visit Template:BGM/doc to edit this text! (How does this work?)