Difference between revisions of "Modding:Mod compatibility/entry"

From Stardew Valley Wiki
Jump to navigation Jump to search
(remove obsolete script)
(rewrite subtag logic to reduce subtemplate calls)
Line 12: Line 12:
 
Define a few expensive variables here.
 
Define a few expensive variables here.
  
   {{#arrayindex:vars|0}} = main status
+
   {{#arrayindex:sourceUrl|0}} = GitHub URL, else custom source URL
   {{#arrayindex:vars|1}} = main status (no subtag)
+
   {{#arrayindex:status|0}} = main status
   {{#arrayindex:vars|2}} = beta status
+
   {{#arrayindex:status|1}} = beta status
  {{#arrayindex:vars|3}} = beta status (no subtag)
 
 
   {{#arrayindex:statuscompare|0}} = whether the compatibility info is equivalent between main and beta ('same' or 'different')
 
   {{#arrayindex:statuscompare|0}} = whether the compatibility info is equivalent between main and beta ('same' or 'different')
  
-->{{#arraydefine:vars|<!--
+
-->{{#arraydefine:sourceUrl|{{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}}}<!--
  0-->{{Modding:Mod compatibility/entry/status|source={{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}}},<!--
+
-->{{#arraydefine:status|<!--
  1-->{{Modding:Mod compatibility/entry/status|source={{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|no subtag=1}},<!--
+
   0-->{{Modding:Mod compatibility/entry/status|source={{#arrayindex:sourceUrl|0}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}}},<!--
   2-->{{Modding:Mod compatibility/entry/status|source={{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|beta unofficial={{{beta unofficial url|}}}|beta broke in={{{beta broke in|}}}|beta status={{{beta status|}}}}},<!--
+
   1-->{{Modding:Mod compatibility/entry/status|source={{#arrayindex:sourceUrl|0}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|beta unofficial={{{beta unofficial url|}}}|beta broke in={{{beta broke in|}}}|beta status={{{beta status|}}}}}
   3-->{{Modding:Mod compatibility/entry/status|source={{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|beta unofficial={{{beta unofficial url|}}}|beta broke in={{{beta broke in|}}}|beta status={{{beta status|}}}|no subtag=1}}
 
 
}}{{#arraydefine:statuscompare|<!--
 
}}{{#arraydefine:statuscompare|<!--
  0-->{{Modding:Mod compatibility/entry/compare status|source={{#if:{{{github|}}}|{{{github}}}|{{{source|}}}}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|beta unofficial={{{beta unofficial url|}}}|beta broke in={{{beta broke in|}}}|beta status={{{beta status|}}}}}
+
  0-->{{Modding:Mod compatibility/entry/compare status|source={{#arrayindex:sourceUrl|0}}|unofficial={{{unofficial url|}}}|broke in={{{broke in|}}}|status={{{status|}}}|beta unofficial={{{beta unofficial url|}}}|beta broke in={{{beta broke in|}}}|beta status={{{beta status|}}}}}
 
}}<!--
 
}}<!--
  
Line 37: Line 35:
  
 
-->
 
-->
|- class="mod" style="line-height: 1em; {{#switch:{{#arrayindex:vars|1}} |ok|optional=background: #9F9; |workaround|unofficial=background: #CF9; |broken=background: #F99; |obsolete|abandoned=background: #999}}" <!--
+
|- class="mod" style="line-height: 1em; {{#switch:{{#arrayindex:status|0}} |ok|optional=background: #9F9; |workaround|unofficial=background: #CF9; |broken=background: #F99; |obsolete|abandoned=background: #999}}" <!--
 
-->id="{{anchorencode:{{#arrayindex:names|0}}}}" <!--
 
-->id="{{anchorencode:{{#arrayindex:names|0}}}}" <!--
 
-->data-id="{{#arrayprint:ids|,|@@@|@@@}}" <!--
 
-->data-id="{{#arrayprint:ids|,|@@@|@@@}}" <!--
Line 48: Line 46:
 
-->{{#if:{{{source|}}}|data-custom-source="{{#tag:nowiki|{{{source}}}}}"}} <!--
 
-->{{#if:{{{source|}}}|data-custom-source="{{#tag:nowiki|{{{source}}}}}"}} <!--
 
-->data-url="{{#tag:nowiki|{{#if:{{{nexus id|}}}|{{nexus mod|{{{nexus id}}}}}|{{#if:{{{cf id|}}}|https://community.playstarbound.com/resources/{{urlencode:{{{cf id}}}}}|{{#if:{{{moddrop id|}}}|https://www.moddrop.com/sdv/mod/{{urlencode:{{{moddrop id}}}}}|{{{url|}}}}}}}}}}}" <!--
 
-->data-url="{{#tag:nowiki|{{#if:{{{nexus id|}}}|{{nexus mod|{{{nexus id}}}}}|{{#if:{{{cf id|}}}|https://community.playstarbound.com/resources/{{urlencode:{{{cf id}}}}}|{{#if:{{{moddrop id|}}}|https://www.moddrop.com/sdv/mod/{{urlencode:{{{moddrop id}}}}}|{{{url|}}}}}}}}}}}" <!--
-->data-status="{{#arrayindex:vars|1}}" <!--
+
-->data-status="{{#arrayindex:status|0}}" <!--
 
-->{{#if:{{{broke in|}}}|data-broke-in="{{{broke in}}}"}} <!--
 
-->{{#if:{{{broke in|}}}|data-broke-in="{{{broke in}}}"}} <!--
 
-->{{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} <!--
 
-->{{#if:{{{unofficial version|}}}|data-unofficial-version="{{{unofficial version}}}"}} <!--
 
-->{{#if:{{{unofficial url|}}}|data-unofficial-url="{{#tag:nowiki|{{{unofficial url}}}}}"}} <!--
 
-->{{#if:{{{unofficial url|}}}|data-unofficial-url="{{#tag:nowiki|{{{unofficial url}}}}}"}} <!--
 
-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<!--
 
-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<!--
   -->data-beta-status="{{#arrayindex:vars|3}}" <!--
+
   -->data-beta-status="{{#arrayindex:status|1}}" <!--
 
   -->{{#if:{{{beta broke in|}}}|data-beta-broke-in="{{{beta broke in}}}"}} <!--
 
   -->{{#if:{{{beta broke in|}}}|data-beta-broke-in="{{{beta broke in}}}"}} <!--
 
   -->{{#if:{{{beta unofficial version|}}}|data-beta-unofficial-version="{{{beta unofficial version}}}"}} <!--
 
   -->{{#if:{{{beta unofficial version|}}}|data-beta-unofficial-version="{{{beta unofficial version}}}"}} <!--
Line 68: Line 66:
  
 
summary--><span class="mod-summary">{{Modding:Mod compatibility/entry/summary
 
summary--><span class="mod-summary">{{Modding:Mod compatibility/entry/summary
   |status            = {{#arrayindex:vars|0}}
+
   |status            = {{#arrayindex:status|0}}
 
   |summary            = {{{summary|}}}
 
   |summary            = {{{summary|}}}
 
   |unofficial url    = {{{unofficial url|}}}
 
   |unofficial url    = {{{unofficial url|}}}
 
   |unofficial version = {{{unofficial version|}}}
 
   |unofficial version = {{{unofficial version|}}}
}}</span>{{#ifeq:{{#arrayindex:vars|0}}|optional|<ref name="optional-update" />}}<!--
+
  |source            = {{#arrayindex:sourceUrl|0}}
 +
}}</span>{{#ifeq:{{#arrayindex:status|0}}|optional|<ref name="optional-update" />}}<!--
  
 
beta summary (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<br />'''1.4 (upcoming)<!--{{version|beta|link=0}}-beta-->:'''&#32;<span class="mod-beta-summary">{{Modding:Mod compatibility/entry/summary
 
beta summary (if different)-->{{#ifeq:{{#arrayindex:statuscompare|0}}|different|<br />'''1.4 (upcoming)<!--{{version|beta|link=0}}-beta-->:'''&#32;<span class="mod-beta-summary">{{Modding:Mod compatibility/entry/summary
   |status            = {{#arrayindex:vars|2}}
+
   |status            = {{#arrayindex:status|1}}
 
   |summary            = {{{beta summary|}}}
 
   |summary            = {{{beta summary|}}}
 
   |unofficial url    = {{{beta unofficial url|}}}
 
   |unofficial url    = {{{beta unofficial url|}}}
 
   |unofficial version = {{{beta unofficial version|}}}
 
   |unofficial version = {{{beta unofficial version|}}}
}}</span>{{#ifeq:{{#arrayindex:vars|2}}|optional|<ref name="optional-update" />}}}}<!--
+
  |source            = {{#arrayindex:sourceUrl|0}}
 +
}}</span>{{#ifeq:{{#arrayindex:status|1}}|optional|<ref name="optional-update" />}}}}<!--
  
 
warnings-->{{#if:{{{warnings|}}}|<br />⚠&#32;{{#arrayprint:warnings|<br />⚠&#32;}}}}
 
warnings-->{{#if:{{{warnings|}}}|<br />⚠&#32;{{#arrayprint:warnings|<br />⚠&#32;}}}}

Revision as of 02:18, 12 August 2019

Examples

Compatible mod

{{/entry
  |name     = Lookup Anything
  |author   = Pathoschild
  |id       = Pathoschild.LookupAnything
  |nexus id = 541
  |github   = Pathoschild/StardewMods
}}

Broken mod

{{/entry
  |name     = Lookup Anything
  |author   = Pathoschild
  |id       = Pathoschild.LookupAnything
  |nexus id = 541
  |github   = Pathoschild/StardewMods
  |summary  = 
  |broke in = Stardew Valley 1.2
  |links    = https://github.com/Pathoschild/SMAPI/issues
  |link labels = PR
}}

Unofficial update

For an unofficial update, use the broken-mod template and add these under the other fields:

  |unofficial url     = https://community.playstarbound.com/attachments/201345000
  |unofficial version = 1.18.2-unofficial.1-example

Usage

Limitations

  • Avoid using quotes (") in argument values; use &quot; instead.
  • The name, author, and id arguments are comma-separated. If the actual value contains a comma, use &#44; instead.

Main fields (shown above)

field purpose
name The normalised display name for the mod. Delimit alternate names with commas.
author The name of the author, as shown on Nexus or in its manifest.json file. Delimit alternate names with commas.
id The unique mod ID, as listed in its manifest.json file. Delimit alternate/older IDs with commas (ideally in latest to oldest order). For very old mods with no ID, use none to disable validation checks.
nexus id The mod's unique ID on Nexus (if any). This is the number in the mod page's URL.
github The mod's GitHub repository in the form owner/repo.
summary Specify custom notes or instructions about the mod's compatibility. Should usually be blank.
broke in The SMAPI or Stardew Valley update which broke this mod (if applicable).

Other fields

field purpose
status Whether the mod is compatible with the latest versions of Stardew Valley and SMAPI (see #Valid statuses). If not specified, it defaults to unofficial if an unofficial URL is given, else broken if broke in is specified, else ok.
unofficial url A page URL where the player can download an unofficial update, if any.
unofficial version The unofficial update's version number, if any.
cf id The mod's ID in the Chucklefish mod repository.
moddrop id The mod's ID in the ModDrop mod repository.
url The arbitrary mod URL, if not on Nexus or Chucklefish. Avoid if possible, since this makes crossreferencing more difficult.
source An arbitrary source code URL, if not on GitHub. Avoid if possible, since this makes crossreferencing more difficult.
links A comma-delimited list of URLs to add as links in the metadata column. Mainly useful for linking to pull requests.
link labels A comma-delimited list of link labels for the links URLs. If omitted, the links will be numbered instead.
warnings Text explaining additional compatibility warnings about the mod (e.g. not compatible with Linux/Mac).
content pack for The name of the mod which loads this content pack.
dev note Special notes intended for developers who maintain unofficial updates or submit pull requests.

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.

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

Valid statuses

status description
ok The mod is compatible. This is the default and doesn't need to be specified.
Default summary: use latest version.
optional The mod is compatible, if you use an optional download on the mod page.
Default summary: use optional download.[1]
unofficial The mod is compatible using an unofficial update. There's no need to specify this; if you also set unofficial url and unofficial version, you can remove the status field.
workaround 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 unofficial url and unofficial version, you can remove the status field.
broken The mod isn't compatible. The message depends on whether the source link is set.
Default summary: broken, not updated yet or broken, not open-source.
abandoned 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).
Default summary: no longer maintained.
obsolete The mod is no longer needed and should be removed.