Difference between revisions of "User:©TriMoon™/Sandbox"
From Salem Wiki
m (→Property settings: x) |
m (→Querries: x) |
||
Line 141: | Line 141: | ||
</ul></li> | </ul></li> | ||
<li>Therefore we need to use <code><nowiki>{{#arraymap:}}</nowiki></code> as a wrapper to inject the records as extra arguments...<ul> | <li>Therefore we need to use <code><nowiki>{{#arraymap:}}</nowiki></code> as a wrapper to inject the records as extra arguments...<ul> | ||
− | <li><code><nowiki>{{#arraymap: </nowiki>{{t|PropVals/getRecords|prop<nowiki>={{{prop|RequiresObj}}}</nowiki>|page<nowiki>={{{page|{{FULLPAGENAME}} }}}</nowiki> }}<nowiki>{{{grpsep|/\}}} |{{{grpsep|/\}}} | | + | <li><code><nowiki>{{#arraymap: </nowiki>{{t|PropVals/getRecords|prop<nowiki>={{{prop|RequiresObj}}}</nowiki>|page<nowiki>={{{page|{{FULLPAGENAME}} }}}</nowiki> }}<nowiki>{{{grpsep|/\}}} |{{{grpsep|/\}}} |xXx |{{PropVals/Group |sep={{{sep|;}}} |grpsep={{{grpsep|/\}}} |xXx }} |}}</nowiki></code></li> |
− | <li>{{t|PropVals/getGroupedRecords|prop<nowiki>={{{prop|RequiresObj}}}</nowiki>|page<nowiki>={{{page|{{FULLPAGENAME}} }}}</nowiki> }}</li> | + | <li>{{t|PropVals/getGroupedRecords|prop<nowiki>={{{prop|RequiresObj}}}</nowiki>|page<nowiki>={{{page|{{FULLPAGENAME}} }}}</nowiki> |sep<nowiki>={{{sep|;}}}</nowiki>|grpsep<nowiki>={{{grpsep|/\}}}</nowiki> }}</li> |
− | <li>{{PropVals/getGroupedRecords|prop={{{prop|RequiresObj}}}|page={{{page|{{FULLPAGENAME}} }}} }}</li> | + | <li>{{PropVals/getGroupedRecords |prop={{{prop|RequiresObj}}} |page={{{page|{{FULLPAGENAME}} }}} |sep={{{sep|;}}} |grpsep={{{grpsep|/\}}} }}</li> |
</ul></li> | </ul></li> | ||
</ul></li> | </ul></li> | ||
− | <li><code><nowiki><ul>{{#arraymap: <output from step above> |{{{grpsep|/\}}} | | + | <li><code><nowiki><ul>{{#arraymap: <output from step above> |{{{grpsep|/\}}} |xXx |{{PropVals/List|sep={{{sep|;}}}|xXx}} |}}</ul></nowiki></code><br/><ul> |
<li>each {{t|PropVals/List}} using {{t|PropVals/Print Entry}} which will internally use {{t|PropVals/Split}}</li> | <li>each {{t|PropVals/List}} using {{t|PropVals/Print Entry}} which will internally use {{t|PropVals/Split}}</li> | ||
− | <li> | + | <li>{{PropVals|debug=y}}</li> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</ul></li> | </ul></li> | ||
<li>{{t|PropVals|prop<nowiki>=</nowiki>RequiresObj}} gives:<br/>{{PropVals|prop=RequiresObj}}</li> | <li>{{t|PropVals|prop<nowiki>=</nowiki>RequiresObj}} gives:<br/>{{PropVals|prop=RequiresObj}}</li> |
Revision as of 02:24, 25 June 2012
Infobox
Template:Infobox/debugTheme | Template:Infobox/debugTheme |
Template:Infobox/debugTheme | Template:Infobox/debugTheme |
Semantics use
Lets try to describe properties of Objects using their placement in the game-menus to aid in later auto-categorization....
- See Property:IsinGameMenu for current menu-names.
fe. Blazing Brazier, would need:
- isGameMenu=n
- isinGameMenu=Claims & Defenses
- See these pages for documentation
- Help:Selecting pages
- Help:Displaying information
- Help:Inline queries (Parser function #show)
- Extension:StringFunctions (#explode:)
- List the set of unique values for a property
- Multiple values for the same field
Property settings
- isGameMenu=n
- isinGameMenu=Test
- String=Board;6
- String=Wooden Plugs;4
- String=Nails;2
- RequiresObj=Anvil
- RequiresObj=Flint;1
- RequiresObj=Stone;3
- RequiresObj=Lime;15;Startpost
- RequiresObj=Flint;15;Startpost
- RequiresObj=Stone;30;Startpost
- RequiresObj=Lime;8;Cornerpost
- RequiresObj=Flint;8;Cornerpost
- RequiresObj=Stone;15;Cornerpost
- RequiresObj=Board;10
- RequiresObj=Nails;4
Querries
- {{List MenuEntries|menu=Test}}
no Non-menu entries found. ---{{#show: {{FULLPAGENAME}} |?IsinGameMenu}}---
------- Listing values for Property:RequiresObj on current page
{{#show: {{FULLPAGENAME}} |?RequiresObj |link=none |sep=<br/> }}
{{#ask: [[{{FULLPAGENAME}}]] [[RequiresObj::+]] | ?RequiresObj= |link=none |sep=<br/> }}
- Automatic listing in mind: {{PropVals |prop=RequiresObj |page={{PAGENAME}}}}
- {{PropVals/getRecords|prop={{{prop|RequiresObj}}}|page={{{page|{{FULLPAGENAME}} }}} }}
- {{PropVals/Group | <output from step above> }} internally using {{PropVals/Split}}
- As you can see the usage below doesn't work because the parser does not recognize the records as extra arguments...
{{PropVals/Group |{{PropVals/getRecords|prop={{{prop|RequiresObj}}}|page={{{page|{{FULLPAGENAME}} }}} }} }}
- PropVals/Group:
- You need to provide records tobe processed !
- Therefore we need to use
{{#arraymap:}}
as a wrapper to inject the records as extra arguments...{{#arraymap: {{PropVals/getRecords|prop={{{prop|RequiresObj}}}|page={{{page|{{FULLPAGENAME}} }}} }}{{{grpsep|/\}}} |{{{grpsep|/\}}} |xXx |{{PropVals/Group |sep={{{sep|;}}} |grpsep={{{grpsep|/\}}} |xXx }} |}}
- {{PropVals/getGroupedRecords|prop={{{prop|RequiresObj}}}|page={{{page|{{FULLPAGENAME}} }}} |sep={{{sep|;}}}|grpsep={{{grpsep|/\}}} }}
- As you can see the usage below doesn't work because the parser does not recognize the records as extra arguments...
<ul>{{#arraymap: <output from step above> |{{{grpsep|/\}}} |xXx |{{PropVals/List|sep={{{sep|;}}}|xXx}} |}}</ul>
- each {{PropVals/List}} using {{PropVals/Print Entry}} which will internally use {{PropVals/Split}}
- {{PropVals|prop=RequiresObj}} gives:
- {{PropVals|prop=RequiresObj|page=Stone Hedge}} gives:
- {{PropVals/getRecords|prop={{{prop|RequiresObj}}}|page={{{page|{{FULLPAGENAME}} }}} }}
- floating code...
- {{PropVals/Split |val={{#show:{{FULLPAGENAME}} |?RequiresObj |link=none |sep=/\}} |sep=/\ |part=2 }}
{{#replace:{{#show:{{FULLPAGENAME}} |?RequiresObj |link=none |sep=/\}}|;|{{!}} }}
{{#arraymap: {{#replace:{{#show:{{FULLPAGENAME}} |?RequiresObj |link=none |sep=/\}}|;|{{!}} }} |/\|x|{{t|t|x}}|<br/> }}
- {{PropVals/Split |val={{#show:{{FULLPAGENAME}} |?RequiresObj |link=none |sep=/\}} |sep=/\ |part=2 }}
... more about "©TriMoon™/Sandbox"