v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Difference between revisions of "Template:Scriptdata/doc"
Jump to navigation
Jump to search
(Updated for new template features) |
m (Post lua release cleanup) |
||
Line 9: | Line 9: | ||
* ``|title=`` parameter functions in the same way [[Template:Gamedata]] does so. | * ``|title=`` parameter functions in the same way [[Template:Gamedata]] does so. | ||
− | *Automatically applies ``<syntaxhighlight lang="lua" | + | *Automatically applies ``<syntaxhighlight lang="lua">`` to entries. |
− | * ``|line=`` changes the starting line (defaults to 1). | + | <!--* ``|line=`` changes the starting line (defaults to 1).--> |
Example of a custom script that uses all parameters: | Example of a custom script that uses all parameters: | ||
Line 17: | Line 17: | ||
<nowiki>{{Scriptdata | <nowiki>{{Scriptdata | ||
|title=Identity language | |title=Identity language | ||
− | |||
|script= | |script= | ||
languages.GEN_IDENTITY=function() | languages.GEN_IDENTITY=function() | ||
Line 61: | Line 60: | ||
}} | }} | ||
− | + | Preliminary scripts have been provided by [[User:Putnam3145]]. |
Latest revision as of 02:03, 27 February 2025
Displays scripts from the Page name/script directory.
Derived from Template:Gamedata, with a few changes specific to displaying syntax highlighting.
Can be given a custom script to display instead:
|script=
defines the content of the custom entry.
|title=
parameter functions in the same way Template:Gamedata does so.
- Automatically applies
<syntaxhighlight lang="lua">
to entries.
Example of a custom script that uses all parameters:
{{Scriptdata |title=Identity language |script= languages.GEN_IDENTITY=function() -- just to demonstrate the absolute most basic method of generating one of these -- also so that you can just mod stuff to use GEN_IDENTITY local tbl={} local unempty = function(str1, str2) return str1=='' and str2 or str1 end for k,v in ipairs(world.language.word) do local str='' str=unempty(str,v.NOUN_SING) str=unempty(str,v.ADJ) str=unempty(str,v.VERB_FIRST_PRES) str=unempty(str,string.lower(v.token)) tbl[v.token]=str end return tbl end }}
[show][Select all] Identity language |
---|
Preliminary scripts have been provided by User:Putnam3145.