Difference between revisions of "Template:SetProp/doc"
From Salem Wiki
m (→Examples: refering) |
m (Protected "Template:SetProp/doc": Documentation of key-feature ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
||
(41 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
:This is a wrapper-template that calls {{t|SetProp/single}} to automatically set property values. | :This is a wrapper-template that calls {{t|SetProp/single}} to automatically set property values. | ||
:It has a ''fixed-set'' of properties it supports, and can be expanded when needed in code... | :It has a ''fixed-set'' of properties it supports, and can be expanded when needed in code... | ||
+ | :Some properties are fit to assign multiple values to, using a '''sep''', but those of type [[Special:Types/Boolean|Boolean]] are obviously not... | ||
+ | |||
+ | ;For more documentation on functions used see: | ||
+ | :*[http://semantic-mediawiki.org/wiki/Help:Properties_and_types#Silent_annotations_using_.23set Help:Properties and types (Silent annotations using #set)] | ||
==Syntax== | ==Syntax== | ||
− | :Type the below code | + | :Type the below code on top of a page: |
<pre>{{SetProp | <pre>{{SetProp | ||
|propname=propvalues | |propname=propvalues | ||
Line 10: | Line 14: | ||
|... | |... | ||
}}</pre> | }}</pre> | ||
− | :It supports this optional named-parameter: | + | :It supports this optional named-parameter for multi-value propname's: |
:*'''sep''' | :*'''sep''' | ||
:*:The default separator used in the '''propvalues''' to separate single-values from each other. | :*:The default separator used in the '''propvalues''' to separate single-values from each other. | ||
:*:It defaults to a comma '''','''' | :*:It defaults to a comma '''','''' | ||
− | + | ===Supported propname's=== | |
− | + | It currently supports these properties in preferred sequence: | |
− | :*[[Property:IsinGameMenu|IsinGameMenu]] | + | *[[Property:IsGameMenu|IsGameMenu]] (''Type: Boolean, single-value'') |
− | :*[[Property:RequiresTech|RequiresTech]] | + | *:Will '''always''' be set. |
− | :*[[Property:RequiresObj|RequiresObj]] | + | *:Defaults to 'false'. |
+ | *[[Property:IsinGameMenu|IsinGameMenu]] (''Type: String, multi-value'') | ||
+ | *:Will '''always''' be set. | ||
+ | *:Defaults to 'no'. | ||
+ | *:Default separator in this case is a '''^''' when no over-ride is used in '''sep''', be careful this property can use a comma in its valid value! | ||
+ | *[[Property:Has icon|Has icon]] (''Type: Page, single-value'') | ||
+ | *:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code> | ||
+ | *:When not used, it will auto-set this property to <code><nowiki>Image:{{SUBPAGENAME}} icon.png</nowiki></code> | ||
+ | *[[Property:Caption|Caption]] (''Type: Text, single-value'') | ||
+ | *:Can hold free text. | ||
+ | *[[Property:Has fullview|Has fullview]] (''Type: Page, single-value'') | ||
+ | *:Only supply the filename, it will automatically prepend the final property-value with <code><nowiki>Image:</nowiki></code> | ||
+ | *[[Property:RequiresTech|RequiresTech]] (''Type: Page, multi-value'') | ||
+ | *[[Property:UnlocksTech|UnlocksTech]] (''Type: Page, multi-value'') | ||
+ | *[[Property:RequiresObj|RequiresObj]] (''Type: String, multi-value'') | ||
+ | *[[Property:RepairedWith|RepairedWith]] (''Type: String, multi-value'') | ||
+ | *[[Property:IsLiftable|IsLiftable]] (''Type: Boolean, single-value'') | ||
+ | *[[Property:IsLiftableWhenEmpty|IsLiftableWhenEmpty]] (''Type: Boolean, single-value'') | ||
+ | *:<u>When used</u> will '''always''' be set to 'true', and auto-set [[Property:IsLiftable|IsLiftable]]='true'. | ||
+ | *[[Property:Locations|Locations]] (''Type: Page, multi-value'') | ||
+ | *[[Property:HP|HP]] (''Type: Number, single-value'') | ||
+ | *[[Property:Soak|Soak]] (''Type: Number, single-value'') | ||
+ | *[[Property:Loot|Loot]] (''Type: String, multi-value'') | ||
+ | *[[Property:Purity|purity]] (''Type: Number, single-value'') <span style="color:red;">(No auto calculations done yet)</span> | ||
+ | *:This will default to '''1.0''' when not provided together with ''Alchemical values'' or Skills. | ||
+ | *''Alchemical values'' (''Type: Number, single-value'') | ||
+ | *:These can be provided in 2 formats, manual and "record". | ||
+ | *:The manual format will <u>only</u> be accepted when no "record" format is being used at all for any of them. | ||
+ | *#In "record" format with dot-comma as field separators: | ||
+ | *#*'''heals''' - List the amounts that this [[object]] heals your [[humour]]s, separated by dot-comma's, in sequence as it's been listed in game. | ||
+ | *#*'''events1''' - List the <span style="color:white; background-color:red;">RED numbers</span>, separated by dot-comma's, in sequence as it's been listed in game. | ||
+ | *#*'''events2''' - List the <span style="color:white; background-color:green;">GREEN numbers</span>, separated by dot-comma's, in sequence as it's been listed in game. | ||
+ | *#*'''events3''' - List the <span style="color:white; background-color:blue;">BLUE numbers</span>, separated by dot-comma's, in sequence as it's been listed in game. | ||
+ | *#*'''events4''' - List the <span style="color:black; background-color:yellow;">YELLOW numbers</span>, separated by dot-comma's, in sequence as it's been listed in game. | ||
+ | *#In manual format, single number per propname: | ||
+ | *#*(Listed below in same sequence as used above for convenience) | ||
+ | *#*[[Property:hebl|hebl]], [[Property:heph|heph]], [[Property:heyb|heyb]], [[Property:hebb|hebb]] | ||
+ | *#*[[Property:sabl|sabl]], [[Property:saph|saph]], [[Property:sayb|sayb]], [[Property:sabb|sabb]] | ||
+ | *#*[[Property:mebl|mebl]], [[Property:meph|meph]], [[Property:meyb|meyb]], [[Property:mebb|mebb]] | ||
+ | *#*[[Property:subl|subl]], [[Property:suph|suph]], [[Property:suyb|suyb]], [[Property:subb|subb]] | ||
+ | *#*[[Property:lebl|lebl]], [[Property:leph|leph]], [[Property:leyb|leyb]], [[Property:lebb|lebb]] | ||
+ | *Skills (''Type: Number, single-value'') | ||
+ | *:These are called ''Proficiencies'' ingame. | ||
+ | *:If <u>either one</u> of the below Skills are set, then '''all will be set at same time'''. | ||
+ | *:They will all default to '0', when not given a value explicitly. | ||
+ | **[[Property:arts|arts]] = Arts & Crafts | ||
+ | **[[Property:cloak|cloak]] = Cloak & Dagger | ||
+ | **[[Property:faith|faith]] = Faith & Wisdom | ||
+ | **[[Property:frontier|frontier]] = Frontier & Wilderness | ||
+ | **[[Property:hammer|hammer]] = Hammer & Nail | ||
+ | **[[Property:hunting|hunting]] = Hunting & Gathering | ||
+ | **[[Property:law|law]] = Law & Lore | ||
+ | **[[Property:mines|mines]] = Mines & Mountains | ||
+ | **[[Property:pots|pots]] = Pots & Pans | ||
+ | **[[Property:sparks|sparks]] = Sparks & Embers | ||
+ | **[[Property:stocks|stocks]] = Stocks & Cultivars | ||
+ | **[[Property:sugar|sugar]] = Sugar & Spice | ||
+ | **[[Property:thread|thread]] = Thread & Needle | ||
+ | **[[Property:natural|natural]] = Natural Philosophy | ||
+ | **[[Property:perennial|perennial]] = Perennial Philosophy | ||
+ | *[[Property:RequiredBy|RequiredBy]] (''Type: Page, multi-value'') | ||
+ | *:This will be '''automatically set''' using {{t|SetProp/RequiredBy auto}}, after any eventual manual assignments using this propname. | ||
+ | |||
+ | ==Copy&Paste code for easy use== | ||
+ | :Type the below code at the top of the page, with values assigned to relevant parameters. | ||
+ | :Parameters can be in any order, and not all need to be used, but its preferred to use the ordering above for uniformity. | ||
+ | :The shown parameters are examples and most used. | ||
+ | :You can remove the unused ones if they are not likely to be set for your page. | ||
+ | |||
+ | :See [[Help:Infobox]] | ||
==Examples== | ==Examples== | ||
− | See the example(s) in the documentation of {{t|SetProp/single}}, this template just passes known properties with their values to it. | + | See the example(s) in the documentation of {{t|SetProp/single}}, this template just passes known ''multi-value'' properties with their values to it.<br/> |
+ | Or directly uses <code><nowiki>{{#set:propname=propvalue}}</nowiki></code> for ''single-value'' properties. | ||
<includeonly>[[Category:Templates|{{PAGENAME}}]]<!-- Any categories for the template itself --> | <includeonly>[[Category:Templates|{{PAGENAME}}]]<!-- Any categories for the template itself --> | ||
[[Category:Templates/©TriMoon™|{{SUBPAGENAME}}]] | [[Category:Templates/©TriMoon™|{{SUBPAGENAME}}]] | ||
</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude> | </includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude> |
Latest revision as of 17:38, 25 July 2012
Description
- This is a wrapper-template that calls {{SetProp/single}} to automatically set property values.
- It has a fixed-set of properties it supports, and can be expanded when needed in code...
- Some properties are fit to assign multiple values to, using a sep, but those of type Boolean are obviously not...
- For more documentation on functions used see
Syntax
- Type the below code on top of a page:
{{SetProp |propname=propvalues |propname=propvalues |... }}
- It supports this optional named-parameter for multi-value propname's:
- sep
- The default separator used in the propvalues to separate single-values from each other.
- It defaults to a comma ','
- sep
Supported propname's
It currently supports these properties in preferred sequence:
- IsGameMenu (Type: Boolean, single-value)
- Will always be set.
- Defaults to 'false'.
- IsinGameMenu (Type: String, multi-value)
- Will always be set.
- Defaults to 'no'.
- Default separator in this case is a ^ when no over-ride is used in sep, be careful this property can use a comma in its valid value!
- Has icon (Type: Page, single-value)
- Only supply the filename, it will automatically prepend the final property-value with
Image:
- When not used, it will auto-set this property to
Image:{{SUBPAGENAME}} icon.png
- Only supply the filename, it will automatically prepend the final property-value with
- Caption (Type: Text, single-value)
- Can hold free text.
- Has fullview (Type: Page, single-value)
- Only supply the filename, it will automatically prepend the final property-value with
Image:
- Only supply the filename, it will automatically prepend the final property-value with
- RequiresTech (Type: Page, multi-value)
- UnlocksTech (Type: Page, multi-value)
- RequiresObj (Type: String, multi-value)
- RepairedWith (Type: String, multi-value)
- IsLiftable (Type: Boolean, single-value)
- IsLiftableWhenEmpty (Type: Boolean, single-value)
- When used will always be set to 'true', and auto-set IsLiftable='true'.
- Locations (Type: Page, multi-value)
- HP (Type: Number, single-value)
- Soak (Type: Number, single-value)
- Loot (Type: String, multi-value)
- purity (Type: Number, single-value) (No auto calculations done yet)
- This will default to 1.0 when not provided together with Alchemical values or Skills.
- Alchemical values (Type: Number, single-value)
- These can be provided in 2 formats, manual and "record".
- The manual format will only be accepted when no "record" format is being used at all for any of them.
- In "record" format with dot-comma as field separators:
- heals - List the amounts that this object heals your humours, separated by dot-comma's, in sequence as it's been listed in game.
- events1 - List the RED numbers, separated by dot-comma's, in sequence as it's been listed in game.
- events2 - List the GREEN numbers, separated by dot-comma's, in sequence as it's been listed in game.
- events3 - List the BLUE numbers, separated by dot-comma's, in sequence as it's been listed in game.
- events4 - List the YELLOW numbers, separated by dot-comma's, in sequence as it's been listed in game.
- In manual format, single number per propname:
- Skills (Type: Number, single-value)
- These are called Proficiencies ingame.
- If either one of the below Skills are set, then all will be set at same time.
- They will all default to '0', when not given a value explicitly.
- arts = Arts & Crafts
- cloak = Cloak & Dagger
- faith = Faith & Wisdom
- frontier = Frontier & Wilderness
- hammer = Hammer & Nail
- hunting = Hunting & Gathering
- law = Law & Lore
- mines = Mines & Mountains
- pots = Pots & Pans
- sparks = Sparks & Embers
- stocks = Stocks & Cultivars
- sugar = Sugar & Spice
- thread = Thread & Needle
- natural = Natural Philosophy
- perennial = Perennial Philosophy
- RequiredBy (Type: Page, multi-value)
- This will be automatically set using {{SetProp/RequiredBy auto}}, after any eventual manual assignments using this propname.
Copy&Paste code for easy use
- Type the below code at the top of the page, with values assigned to relevant parameters.
- Parameters can be in any order, and not all need to be used, but its preferred to use the ordering above for uniformity.
- The shown parameters are examples and most used.
- You can remove the unused ones if they are not likely to be set for your page.
- See Help:Infobox
Examples
See the example(s) in the documentation of {{SetProp/single}}, this template just passes known multi-value properties with their values to it.
Or directly uses {{#set:propname=propvalue}}
for single-value properties.