Changes

Jump to navigation Jump to search
create page based on Modding:SMAPI compatibility/entry (only author is Pathoschild)
==Examples==
===Compatible mod===
<pre>
{{#invoke:SMAPI compatibility|entry
|name = Lookup Anything
|author = Pathoschild
|id = Pathoschild.LookupAnything
|nexus id = 541
|github = Pathoschild/StardewMods
}}
</pre>

{{#invoke:SMAPI compatibility|header}}
{{#invoke:SMAPI compatibility|entry
|name = Lookup Anything
|author = Pathoschild
|id = Pathoschild.LookupAnything
|nexus id = 541
|github = Pathoschild/StardewMods
}}
{{#invoke:SMAPI compatibility|footer}}

===Broken mod===
<pre>
{{#invoke:SMAPI compatibility|entry
|name = Lookup Anything
|author = Pathoschild
|id = Pathoschild.LookupAnything
|nexus id = 541
|github = Pathoschild/StardewMods
|summary =
|broke in = Stardew Valley 1.2
}}
</pre>
{{#invoke:SMAPI compatibility|header}}
{{#invoke:SMAPI compatibility|entry
|name = Lookup Anything
|author = Pathoschild
|id = Pathoschild.LookupAnything
|nexus id = 541
|github = Pathoschild/StardewMods
|summary =
|broke in = Stardew Valley 1.2
}}
{{#invoke:SMAPI compatibility|footer}}

===Unofficial update===
For an unofficial update, use the broken-mod template and add these under the other fields:
<pre>
|unofficial url = https://community.playstarbound.com/attachments/201345000
|unofficial version = 1.18.2-unofficial.1-example
</pre>
{{#invoke:SMAPI compatibility|header}}
{{#invoke:SMAPI compatibility|entry
|name = Lookup Anything
|author = Pathoschild
|id = Pathoschild.LookupAnything
|nexus id = 541
|github = Pathoschild/StardewMods
|summary =
|broke in = Stardew Valley 1.2
|unofficial url = https://community.playstarbound.com/attachments/201345000
|unofficial version = 1.18.2-unofficial.1-example
}}
{{#invoke:SMAPI compatibility|footer}}

==Usage==
===Main fields (shown above)===
{| class="wikitable"
|-
! field
! purpose
|-
| <code>name</code>
| The normalised display name for the mod. Combine with <code>name2</code> (see below) to add alternate names.
|-
| <code>author</code>
| The name of the author, as shown on Nexus or in its <tt>manifest.json</tt> file. Combine with <code>author2</code> (see below) to add alternate names.
|-
| <code>id</code>
| The latest unique mod ID, as listed in its <tt>manifest.json</tt> file. In rare cases where there are parallel current releases with different IDs, this can be comma-delimited. For very old mods with no ID, use <tt>none</tt> to disable validation checks.
|-
| <code>nexus id</code>
| The mod's unique ID on Nexus (if any). This is the number in the mod page's URL.
|-
| <code>github</code>
| The mod's GitHub repository in the form <tt>owner/repo</tt>.
|-
| <code>summary</code>
| Specify custom notes or instructions about the mod's compatibility. Should usually be blank.
|-
| <code>broke in</code>
| The SMAPI or Stardew Valley update which broke this mod (if applicable).
|}

===Other fields===
{| class="wikitable"
|-
! field
! purpose
|-
| <code>status</code>
| Whether the mod is compatible with the latest versions of Stardew Valley and SMAPI (see [[#Valid statuses]]). If not specified, it defaults to <code>unofficial</code> if an unofficial URL is given, else <code>broken</code> if <code>broke in</code> is specified, else <code>ok</code>.
|-
| <code>unofficial url</code>
| A page URL where the player can download an unofficial update, if any.
|-
| <code>unofficial version</code>
| The unofficial update's version number, if any.
|-
| <code>old ids</code>
| IDs which identify older versions of this mod.
|-
| <code>cf id</code>
| The mod's ID in the Chucklefish mod repository.
|-
| <code>url</code>
| The arbitrary mod URL, if not on Nexus or Chucklefish. Avoid if possible, since this makes crossreferencing more difficult.
|-
| <code>source</code>
| An arbitrary source code URL, if not on GitHub. Avoid if possible, since this makes crossreferencing more difficult.
|-
| <code>name2</code><br /><code>author2</code>
| Adds alternate mod and author names.
|-
| <code>hide-url</code>
| Use this instead of (<code>url</code>) to move it into a superscript link. Mainly useful for broken mods with a workaround, so players don't automatically click through to the old mod.
|-
| <code>links</code>
| A comma-delimited list of URLs to add as superscript links. Mainly useful for linking to pull requests.
|-
| <code>warnings</code>
| Text explaining additional compatibility warnings about the mod (e.g. not compatible with Linux/Mac).
|}

===Beta fields===
When there's a Stardew Valley beta, some mods may have different compatibility statuses for stable vs beta. You can specify these optional fields to specify a different beta status.

{| class="wikitable"
|-
! field
! purpose
|-
| <code>beta summary</code>
| Specify custom notes or instructions about the mod's compatibility. Should usually be blank.
|-
| <code>beta broke in</code>
| The SMAPI or Stardew Valley update which broke this mod (if applicable).
|-
| <code>beta status</code>
| Whether the mod is compatible with the latest versions of Stardew Valley and SMAPI (see [[#Valid statuses]]). If not specified, it defaults to <code>unofficial</code> if an unofficial URL is given, else <code>broken</code> if <code>broke in</code> is specified, else <code>ok</code>.
|-
| <code>beta unofficial url</code>
| A page URL where the player can download an unofficial update, if any.
|-
| <code>beta unofficial version</code>
| The unofficial update's version number, if any.
|}

===Valid statuses===
{| class="wikitable"
|-
! status
! description
|-
| <code>ok</code>
| The mod is compatible. This is the default and doesn't need to be specified.<br />Default summary: ''use latest version.''
|-
| <code>optional</code>
| The mod is compatible, if you use an optional download on the mod page.<br />Default summary: ''use optional download.<sup>[[#footnote|[1]]]</sup>''
|-
| <code>unofficial</code>
| The mod is compatible using an unofficial update. There's no need to specify this; if you also set <tt>unofficial url</tt> and <tt>unofficial version</tt>, you can remove the status field.
|-
| <code>workaround</code>
| The mod isn't compatible, but the player can fix it or there's a good alternative. A summary should be provided manually. If you also set <tt>unofficial url</tt> and <tt>unofficial version</tt>, you can remove the status field.
|-
| <code>broken</code>
| The mod isn't compatible. The message depends on whether the <code>source</code> link is set.<br />Default summary: ''broken, not updated yet'' or ''broken, not open-source.''
|-
| <code>abandoned</code>
| The mod is no longer maintained by the author, and an unofficial update or continuation is unlikely. This should only be used when the author has definitively abandoned the mod (either explicitly, or by removing the mod page or downloads).<br />Default summary: ''no longer maintained.''
|-
| <code>obsolete</code>
| The mod is no longer needed and should be removed.
|}

==Script==
This script generates the template call when run from a Nexus or Chucklefish mod page.
<source lang="javascript">
switch(location.host)
{
case "www.nexusmods.com":
var url = location.origin + location.pathname.replace(/\/*$/, '');
var name = $(".header-name").text();
var author = $(".uploader a").text();
var author2 = $(".header-author strong").text();
break;

case "community.playstarbound.com":
var url = location.origin + location.pathname.replace(/\/*$/, '');
var name = $.trim($("h1:first").contents().first().text());
var author = $(".primaryContent[data-author]:first").attr("data-author");
break;

default:
throw `Unknown domain: ${location.host}`;
}

var template = `
{{/entry
|name = ${name}
|author = ${author}`;
if(author2 && author2 != author)
template += '\n' + ` |author2 = ${author2}`;
template += `
|url = ${url}
|status = ok
|summary =
|source =
}}
`;
</source>

[[Category:Modding]]
translators
8,445

edits

Navigation menu