Difference between revisions of "Template:InfoBox UOSound"
Line 1: | Line 1: | ||
− | <includeonly>{{UOSoundData}}{{#vardefine: soundId |{{#replace:{{PAGENAME}}|UO:Items that make sound |}} }}{{#vardefine: soundNum |{{#var:soundId}} + 1 }} | + | <includeonly>{{UOSoundData}}{{#vardefine: soundId |{{#replace:{{PAGENAME}}|UO:Items that make sound |}} }}{{#vardefine: soundNum |{{#expr: {{#var:soundId}} + 1 }}}} |
{| class=infobox style="margin-top: 5em;" | {| class=infobox style="margin-top: 5em;" | ||
|class=titlecell colspan="2"| Sound | |class=titlecell colspan="2"| Sound | ||
Line 11: | Line 11: | ||
{{!}}Length{{!!}}{{#arrayindex:sound{{#var:soundNum}}|1}} seconds | {{!}}Length{{!!}}{{#arrayindex:sound{{#var:soundNum}}|1}} seconds | ||
{{!}}- | {{!}}- | ||
− | {{!}}Number (decimal)*{{!!}} | + | {{!}}Number (decimal)*{{!!}}{{#var:soundId}} |
{{!}}- | {{!}}- | ||
− | {{!}}Number (hex)*{{!!}}{{#ifeq: {{#var:soundId}}|1|0x01|{{Dec2hex| | + | {{!}}Number (hex)*{{!!}}{{#ifeq: {{#var:soundId}}|1|0x01|{{Dec2hex|{{#var:soundId}}}}}} |
{{!}}- | {{!}}- | ||
{{!}} colspan=2 {{!}} <div>* Note that internally, a sound packet (packet 0x54) uses a<br> [[Wikipedia:Word_(computer_architecture)|word]]-sized index starting from 0, not 1. This means that<br>sound #1 internally has packet ID #0.<div> | {{!}} colspan=2 {{!}} <div>* Note that internally, a sound packet (packet 0x54) uses a<br> [[Wikipedia:Word_(computer_architecture)|word]]-sized index starting from 0, not 1. This means that<br>sound #1 internally has packet ID #0.<div> | ||
{{!}}}[[Category:UO Items Using Specific Sounds]]}}</includeonly> | {{!}}}[[Category:UO Items Using Specific Sounds]]}}</includeonly> |