Difference between revisions of "Template:Game data"

From PCGamingWiki, the wiki about fixing PC games
m (Wikitext -> Wikitext string)
(added previous section validity check (ensures templates are being used in the correct order on game pages))
Line 4: Line 4:
 
<th scope="col" style="width: 590px;" class="table-gamedata-head-location">Location</th>
 
<th scope="col" style="width: 590px;" class="table-gamedata-head-location">Location</th>
 
</tr>{{#vardefine:Game data note|}}
 
</tr>{{#vardefine:Game data note|}}
 +
{{#switch:{{#var:section}}
 +
|Availability/done
 +
|Monetization
 +
|DLC/done
 +
|Microtransactions={{#vardefine:section|Game data/config}}
 +
|Game data/config={{#vardefine:section|Game data/saves}}
 +
|#Default = [[Category:Invalid section order]]
 +
}}
 
{{{content|{{{1}}}}}}
 
{{{content|{{{1}}}}}}
 
{{#if:{{#var:steam appid}}|
 
{{#if:{{#var:steam appid}}|
Line 13: Line 21:
 
}}
 
}}
 
}}
 
}}
</table></div><noinclude>{{documentation}}</noinclude><noinclude>{{#cargo_declare:
+
</table></div>{{#ifeq:{{#var:section}}|Game data/saves|{{#vardefine:section|Game data/done}}}}<noinclude>{{documentation}}</noinclude><noinclude>{{#cargo_declare:
 
_table = GameData
 
_table = GameData
 
|System = String
 
|System = String
 
|Location = List (,) of Wikitext string
 
|Location = List (,) of Wikitext string
 
}}</noinclude>
 
}}</noinclude>

Revision as of 02:20, 27 August 2021

{{{1}}}
System Location
Documentation for the above template (sometimes hidden from view).

Specify each row with {{Game data/config| (for configuration files) or {{Game data/saves| (for save game data). The first parameter is for the data type, the second parameter is the path.

Where possible use environmental variables instead of manual paths (e.g. %USERPROFILE%\Saved Games\, not C:\Users\your user name\Saved Games\) since these will automatically expand when used to match the path on the user's end.

Using notes

Add a note if the folder path needs further explanation, e.g. Ultima Underworld: The Stygian Abyss has a SAVE0 folder that isn't actually one of the user's save files.
If the game has a Linux version, specify whether it supports the XDG specification using the Template:XDG.

Example usage

{{Game data|
{{Game data/saves|DOS|{{p|game}}\DATA\SAVEGAME}}
}}

This produces:

System Location
DOS <path-to-game>\DATA\SAVEGAME

This template defines the table "GameData". This table has not been created yet.