User:AEon2001/Sandbox

New front page Icon Layout - FAQ 2


This gradient should also work nicely: linear-gradient(to bottom, #802020 0%, #4D1313 100%)

Content

DLC Code Testing
New tests using DPL tables... code from Skyrim page by Game Widow... will be testing this on Witcher 2 data soon.



Armour that ups 'Geralt's maximum load'
The Armour elements that increase Geralt's maximum load:


 * |effects = Resistance to +20 - 30% Resistance to  +20 - 30% Geralt's maximum load +15

After some frustrating testing, first note the use of Perl Regular Expressions, adapting the code from there is still a bit of guesswork. And that  only matches (whitespaces), whereas here we need to match any number of any characters and for this use.

Also experimenting with replacing content on the fly. In this case removing the text  from effects, to show the effects like burn, bleed, and poison on one line instead. works! But using the result of a previous replace to then perform another replace does not work.

Cannot get the stupid search code to look for pages that mention "Dark Mode" and only show those :(... .   is also completely useless!

The  are part of the Blasphemer's Outfit. They are only available in Dark Mode.

Searching the page directly for matches fails completely, but in the case of armour that is only available in Dark Mode one can filter by links existing on the page, i.e..

uses=Template:Infoboxitem2 includematch=/.*Dark Mode.*/g

... ups load (without Dark Mode, only load effect)
Trying to extract the load gain number only, ignoring all the other text under. Example:
 * |effects = Resistance to +20 - 30% Resistance to  +20 - 30% Geralt's maximum load +15

Searching for load, and deleting all of the beginning of the effects line, almost works:

but sometimes there is info behind the load line.



To get the number of "load", you need to define a variable "block" denoted by ( and ), that you then access via numbered reference, here. The  block will match a number (1. digit) and a potential 2. digit that can be present or not (denoted by the ?). Note that in the regex search pattern the "+" is a special character, and has to be escaped via.

category=The Witcher 2 armor uses=Template:Infoboxitem2 includematch=/\|\s*effects\s*=.*maximum load.*/s notlinksto=Dark Mode include= {Infoboxitem2}:image, {Infoboxitem2}:name, {Infoboxitem2}:caption, {Infoboxitem2}:category, {Infoboxitem2}:armor, {Infoboxitem2}:effects, {Infoboxitem2}:armorslots, {Infoboxitem2}:source, {Infoboxitem2}:buy, {Infoboxitem2}:sell, {Infoboxitem2}:weight format={| class="wikitable sortable"\n! Name !! Info !! Effect(s) !! Enhancement Slot(s) !! Source !! style="white-space:nowrap;" data-sort-type="number"|Buy !! style="white-space:nowrap;" data-sort-type="number"|Sell !! data-sort-type="number"|Weight secseparators =\n|-\n| style="white-space:nowrap;"| %PAGE%\n| ,, ,,\n| style="white-space:nowrap;"| ,, \n| style="text-align:center;"|\n| ,,\n| style="white-space:nowrap; text-align:right;"|,, \n| style="white-space:nowrap; text-align:right;"|,, \n| style="text-align:center;"| ,, multisecseparators =, , , , , , ,

Dark Mode Armour
category=The Witcher 2 armor linksto=Dark Mode

... ups load (without Dark Mode)
category=The Witcher 2 armor uses=Template:Infoboxitem2 includematch=/\|\s*effects\s*=.*maximum load.*/s notlinksto=Dark Mode include= {Infoboxitem2}:image, {Infoboxitem2}:name, {Infoboxitem2}:caption, {Infoboxitem2}:category, {Infoboxitem2}:armor, {Infoboxitem2}:effects, {Infoboxitem2}:armorslots, {Infoboxitem2}:source, {Infoboxitem2}:buy, {Infoboxitem2}:sell, {Infoboxitem2}:weight format={| class="wikitable sortable"\n! Name !! Info !! Effect(s) !! Enhancement Slot(s) !! Source !! style="white-space:nowrap;" data-sort-type="number"|Price Buy / Sell !! data-sort-type="number"|Weight secseparators =\n|-\n| style="white-space:nowrap;"| %PAGE%\n| ,, ,,\n| style="white-space:nowrap;"| ,, \n| style="text-align:center;"|\n| ,,\n| style="white-space:nowrap; text-align:right;"|,, ,, \n| style="text-align:center;"| ,, multisecseparators =, , , , , , ,

... ups load (Dark Mode only)
category=The Witcher 2 armor uses=Template:Infoboxitem2 includematch=/\|\s*effects\s*=.*maximum load.*/s linksto=Dark Mode include= {Infoboxitem2}:image, {Infoboxitem2}:name, {Infoboxitem2}:caption, {Infoboxitem2}:category, {Infoboxitem2}:armor, {Infoboxitem2}:effects, {Infoboxitem2}:armorslots, {Infoboxitem2}:source, {Infoboxitem2}:buy, {Infoboxitem2}:sell, {Infoboxitem2}:weight format={| class="wikitable sortable"\n! Name !! Info !! Effect(s) !! Enhancement Slot(s) !! Source !! style="white-space:nowrap;" data-sort-type="number"|Price Buy / Sell !! data-sort-type="number"|Weight secseparators =\n|-\n| style="white-space:nowrap;"| %PAGE%\n| ,, ,,\n| style="white-space:nowrap;"| ,, \n| style="text-align:center;"|\n| ,,\n| style="white-space:nowrap; text-align:right;"|,, ,, \n| style="text-align:center;"| ,, multisecseparators =, , , , , , ,

Overview page of Witcher 2 Oils
category=The Witcher 2 oils uses=Template:Infoboxoil2 include= {Infoboxoil2}:image, {Infoboxoil2}:name, {Infoboxoil2}:caption, {Infoboxoil2}:ingred1, {Infoboxoil2}:ingred2, {Infoboxoil2}:ingred3, {Infoboxoil2}:ingred4, {Infoboxoil2}:ingred5, {Infoboxoil2}:mod_poison, {Infoboxoil2}:mod_bleed, {Infoboxoil2}:mod_damage, {Infoboxoil2}:duration, {Infoboxoil2}:source, {Infoboxoil2}:buy, {Infoboxoil2}:sell, {Infoboxoil2}:wt format={| class="wikitable sortable"\n! Name !! Info !! Ingredients !! Effect(s) !! data-sort-type="number"|Duration !! Source !! style="white-space:nowrap;" data-sort-type="number"|Price Buy / Sell !! data-sort-type="number"|Weight secseparators =\n|-\n| style="white-space:nowrap;"| %PAGE%\n| ,,\n| style="white-space:nowrap;"|,, ,, ,, ,, ,,\n|  \n| style="white-space:nowrap;"|,,\n| ,,\n| style="white-space:nowrap; text-align:right;"|,,  ,, \n| ,,

Changes / Todo:
 * Added the icons.
 * The tables contain mod_poison, mod_damage and others, these all need to be tracked and the proper icons prefixed... not really that convenient, but doable. All conditional cases added with icons.
 * Icon sized upped to standard size used everywhere else, i.e. 32px.

ignores all pages with templates that do not use a armorslots parameter, the latter are then checked if the have "1", "2", or "3" (regex number range used here) such slots. The \s* will match any number of chars, thus lets you use as many whitespaces as you light in template parameter formatting.
 * does not properly work.

category=The Witcher 2 armor uses=Template:Infoboxitem2 count=20 includematch=/\|\s*armorslots\s*=\s*[1-3]/s include= {Infoboxitem2}:image, {Infoboxitem2}:name, {Infoboxitem2}:caption, {Infoboxitem2}:armorslots, {Infoboxitem2}:duration, {Infoboxitem2}:source, {Infoboxitem2}:buy, {Infoboxitem2}:sell, {Infoboxitem2}:wt format={| class="wikitable sortable"\n! Name !! Info !! Enhancement(s) !! Effect(s) !! data-sort-type="number"|Duration !! Source !! style="white-space:nowrap;" data-sort-type="number"|Price Buy / Sell !! data-sort-type="number"|Weight secseparators =\n|-\n| style="white-space:nowrap;"| %PAGE%\n| ,,\n| style="white-space:nowrap;"|,,\n| ,,\n| style="white-space:nowrap; text-align:right;"|,, ,, \n| ,, multisecseparators =, , , , , , ,

Here the armour page that do NOT have slots
Commented out for now: category=The Witcher 2 armor uses=Template:Infoboxitem2 includenotmatch=/\|\s*armorslots\s*=\s*[1-3]/s include= {Infoboxitem2}:image, {Infoboxitem2}:name, {Infoboxitem2}:caption, {Infoboxitem2}:armorslots, {Infoboxitem2}:duration, {Infoboxitem2}:source, {Infoboxitem2}:buy, {Infoboxitem2}:sell, {Infoboxitem2}:wt format={| class="wikitable sortable"\n! Name !! Info !! Enhancement(s) !! Effect(s) !! data-sort-type="number"|Duration !! Source !! style="white-space:nowrap;" data-sort-type="number"|Price Buy / Sell !! data-sort-type="number"|Weight secseparators =\n|-\n| style="white-space:nowrap;"| %PAGE%\n| ,,\n| style="white-space:nowrap;"|,,\n| ,,\n| style="white-space:nowrap; text-align:right;"|,, ,, \n| ,,