Guide to Metadata

Revision as of 09:38, 24 August 2014 by Buffy2nd (talk) (Bit of a shitty guide but it will do for now)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is a guide for editing the wiki in it's current state. Things may have changed slightly, or greatly, by the time you're reading this. --Buffy2nd (talk) 09:38, 24 August 2014 (UTC)

Metadata apparently means "data about data", I'm not sure if that applies for our example, but the premise is that we used pages prefixed with the "Data:" text, to store information about jobs, items, maybe even traitor objectives, and then use other templates to pull from there and display these anywhere and everywhere. As such, you can change one item's image or brute damage and it will apply the changes on all pages.

Creating an item

First off we create the normal page of the item, like any other article, by either searching for the name and then pressing "Create the page item on this wiki" or changing the name of the current page to a non-existing page in the URL bar. This is the page that people will want to look at when looking up stuff about the item, so feel free to type here whatever you want.

To add the metadata for the item, put this at the top of the page:

 {{MetaInfoBox}}

MetaInfoBox is a template that creates a little infobox for the item, using it's metadata page for information. Press preview now to see it. As there's no metadata page yet, it's empty and also there's a "c" or "create" button somewhere on the top right of it. Click that and it will take you to create the metadata page, titled something like "Data:YOURITEM".

Editing the metadata

When you click the "create" button on the MetaInfoBox template, it preloads the necessary text you need for it to function, however, at the time of writing this, it defaults to the Jobs metadata syntax. Unless you're making a page for a job, that's not what you want. Delete the preloaded stuff and copy this instead:

<includeonly>{{{{{format}}}|
name=|
img=|
category=|
found=|
used=|
examine=|
{{{1|}}}}}</includeonly><noinclude>{{:{{FULLPAGENAME}}|format=MetaData/Items}}</noinclude>

It's probably a bit overkill using this, but generally it's best to just copy the metadata of a similar item and editing it. For example, if you're making the metadata for   Sunglasses your best bet is to copy the metadata of a close relative, such as   Health Scanner HUD. Sometimes there is no close relatives, in that case just use the closest you have, or a multitude of them and combine bits and pieces to make it work. For example, a backpack has slots just like a toolbox, but a toolbox can't be worn. So ideally you could look at the toolbox and see that there's a "Slot" variable, which you can use for your backpack, and there's a "wearable" variable in the Welding Helmet metadata. More importantly, the backpack belongs to the same category as the welding helmet, namely "Clothing and Accessories" which you absolutely should copy over.

Anyway, enough rambling here's an example from   Science Goggles:

<includeonly>{{{{{format}}}|
name=Science Goggles|
img=Science_goggles.png|
category=Clothing and Accessories|
found=[[Chemistry]], [[R&D Lab]]|
examine=nothing|
used=Protects eyes from chemicals|
wearable=Eyes|
{{{1|}}}}}</includeonly><noinclude>{{:{{FULLPAGENAME}}|format=MetaData/Items}}</noinclude>

It's very important that there are no unnecessary blank lines between these, and also that the "|" character is at the end of each line. So if you wanted to set the "wearable" variable to "back" for a backpack, then you'd edit the line to "wearable=Back|". First is the variable name, then the "=" sign, then your content and to finish it off the "|" sign.

If done right when you hit the save page button, it should show you a neatly organized page such as this, if a variable isn't showing up, it either means you misspelled it or it doesn't exist yet. It can also happen that the category you put in isn't configured yet, so don't worry about that, if it looks broken it will get fixed, I'll make a tutorial for that as well.

More importantly, if done right, there should be a "Category specific metadata" section in the code, there you can see all the variable you may have missed to add, the variable name is between the parenthesis, and what follows is either the default value, or your custom value. Feel free to go back and add any missing pieces.

Once saved, go back to the page with the MetaInfoBox and see if it works correctly.

Don't forget to add "[[Category:Items]]" to the bottom of the page.

Cool shit

If an item has metadata correctly set up, you can use it a few (currently just two) ways.

MetaInline:

You can display an item such as this: File:Securityhud.png Security HUD by simply typing this:

{{MetaInline|Security HUD}}

MetaIcon:

Not added yet, but it's essentially the same thing as above, just without the name next to it.

NavBoxes:

Crude example: Template:Clothing_and_Accessories