Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Special pages
Random page
Wiki Discord
Contents
Neighbors
Galaxy
> Hexia
> Norvan
> Pashah
> Taffeh
Creatures
> Insects
> Fishes
> Shore-Dwellers
Items
> Dishes
> Furniture
Game Systems
> Dress Up
> Luca Arbor
> Loomix Footprints
> Loomix Vehicle Services
> Loomix Homes
Search
Search
Appearance
Log in
Personal tools
Log in
Editing
Module
:
Shared VA
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- Source: https://honkai-star-rail.fandom.com/wiki/Module:Shared_VA local p = {} local Parse = require('Module:Parser').getTemplateArgs local lib = require('Module:Feature') local lang_dict = { ["EN"] = "English", ["CN"] = "Chinese", ["JP"] = "Japanese", ["KR"] = "Korean", } local games_dict = { ["pp"] = nil, ["hsr"] = "Honkai: Star Rail", ["hi3"] = "Honkai Impact 3rd", ["hg2"] = "Houkai Gakuen 2", ["hna"] = "Honkai: Nexus Anima", ["gi"] = "Genshin Impact", ["zzz"] = "Zenless Zone Zero", ["tot"] = "Tears of Themis", } local iw_links = { ["pp"] = "[https://petitplanet.wiki/%s %s]", ["hsr"] = "[[w:c:honkai-star-rail:%s|%s]]", ["hi3"] = "[[w:c:honkaiimpact3:%s|%s]]", ["hg2"] = "[[w:c:houkai2nd:%s|%s]]", ["hna"] = "[https://hna.wiki/%s %s]", ["gi"] = "[https://genshin-impact.fandom.com/%s %s]", ["zzz"] = "[[w:c:zenless-zone-zero:%s|%s]]", ["tot"] = "[https://tot.wiki/wiki/%s %s]", } local game_order = {'pp', 'hg2', 'hi3', 'tot', 'gi', 'hsr', 'zzz', 'hna'} local lang_order = {'EN', 'CN', 'JP', 'KR'} function p.main(frame) local args = require('Module:Arguments').getArgs(frame, { parentFirst = true }) if (lib.isEmpty(args['char'])) then args['char'] = mw.title.getCurrentTitle().rootText end return p._main(args, frame) end function p._main(args, frame) local VAs = {character = args['char']} local data = Parse(args['char'], {only='Neighbor Infobox'}) or {} local out = mw.html.create('ul') for _, lang in ipairs(lang_order) do -- Language's VA name local va = data['va'..lang] or '' VAs[lang] = { VA = args['va'..lang] or (lib.isNotEmpty(va) and frame:preprocess(lib.trim( VAs.character=='Trailblazer' --if we ever do have a voice actor for MC and (va:gsub('^.-F: (.-)<r?b?.-M: (.+)$', '%1 or %2'):gsub('%s*<ref.+$', '')) or (va:gsub('%s*<ref.+$', '')) )) ) or '<i>Unknown</i>', games = {} } -- Parse the characters from each game for _, game in ipairs(game_order) do local chars = lib.split(args[game .. lang] or '', ';', {removeEmpty = true}) if #chars>0 then table.insert(VAs[lang].games, game) VAs[lang][game] = VAs[lang][game] or mw.html.create() for i, ch in ipairs(chars) do if i > 1 and #chars > 2 then VAs[lang][game]:wikitext(', ') end if i > 1 and i==#chars then VAs[lang][game]:wikitext(' and ') end local characterName, note = ch:match('(.+)\\(.+)') VAs[lang][game]:wikitext(string.format(iw_links[game], mw.uri.encode(characterName or ch, 'WIKI'), characterName or ch)) if (lib.isNotEmpty(note)) then VAs[lang][game]:wikitext(" ''(", note, ")''") end end if games_dict[game] ~= nil then VAs[lang][game]:wikitext(' in '):tag('i'):wikitext(games_dict[game]) end end end if #VAs[lang].games>0 then local li = out:tag('li') li:wikitext(VAs.character, ' shares the same ', lang_dict[lang], ' voice actor, ', VAs[lang].VA, ', with') if #VAs[lang].games==1 then li :wikitext(' ') :node(VAs[lang][VAs[lang].games[1]]) :wikitext('.') else li:wikitext(':') local liul = li:tag('ul') -- Render the list for i, game in ipairs(game_order) do if VAs[lang][game] then liul:tag('li'):node(VAs[lang][game]) end end end end end return out end return p
Summary:
Please note that all contributions to The Petit Planet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
Petit Planet Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Below are commonly used wikitext from
MediaWiki:Edittools
. Click on any to insert them in the edit box.
File Pages
==Summary==
==Licensing==
{{Fairuse}}
{{File|}}
Dynamic Page List
¦
²
«
»
²{¦}²
«»
«/»
«!----»
Array in DPL
¹
^2{
}^2
^2{¹}^2
Parser Functions
{{#if:||}}
{{#if:<condition>|<result if true>|<result if false>}}
{{#ifeq:|||}}
{{#ifeq:<text1>|<text2>|<result if text1=text2>|<result if text1≠text2>}}
{{#expr:}}
{{#expr:<mathematical expression>}}
{{#switch:||#default=}}
{{#switch:<text1>|<text2>=<result if text1=text2>|<text3>=<result if text1=text3>|#default=<result if no valid match>}}
{{#replace:||}}
{{#replace:<text1>|<plain text to find in text1>|<plain text to insert in place of the text found>}}
{{#titleparts:}}
{{#replace:<page name>}}
{{#tag:|}}
{{#tag:<name of html tag>|<content inside html tag>}}
Markup
{{}}
|
[]
[[]]
[[Category:]]
#REDIRECT [[]] [[Category:Redirect Pages]]
<code></code>
<includeonly></includeonly>
<noinclude></noinclude>
<nowiki></nowiki>
<!---->
<br>
§
Notices
{{Stub|}}
{{Stub Dialogue}}
{{Upcoming}}
{{Under Construction}}
{{Placeholder|}}
Magic Words
{{!}}
{{formatnum:}}
{{lc:}}
{{uc:}}
{{PAGENAME}}
{{FULLPAGENAME}}
{{ROOTPAGENAME}}
{{BASEPAGENAME}}
{{SUBPAGENAME}}
{{DISPLAYTITLE:|noreplace}}
__TOC__
__NOTOC__
__EXPECTUNUSEDCATEGORY__
__HIDDENCAT__
HTML Entities
—
,
­
Pages included on this page:
Template:Documentation/Header
(
edit
)
Template:Documentation/styles.css
(
edit
)
Template:T
(
edit
)
Template:TOC Right
(
edit
)
Module:Arguments
(
edit
)
Module:Arguments/i18n
(
edit
)
Module:Common/i18n
(
edit
)
Module:Config
(
edit
)
Module:Documentation
(
edit
)
Module:Documentation/config
(
edit
)
Module:Documentation/i18n
(
edit
)
Module:Entrypoint
(
edit
)
Module:Exists
(
edit
)
Module:Fallbacklist
(
edit
)
Module:Feature
(
edit
)
Module:Formatting
(
edit
)
Module:I18n
(
edit
)
Module:Languages
(
edit
)
Module:Shared VA/doc
(
edit
)
Module:TableTools
(
edit
)
Module:Yesno
(
edit
)
This page is a member of 2 hidden categories:
Category:Pages using DynamicPageList4 parser function
Category:Pages using DynamicPageList4
Search
Search
Editing
Module
:
Shared VA
Add topic