Talk:Clothing: Difference between revisions
(→New parameters for existing and new entries: new section) |
(→Row entries now use named parameters: new section) |
||
Line 52: | Line 52: | ||
--[[User:Kenoxite|Kenoxite]] ([[User talk:Kenoxite|talk]]) 05:08, 1 October 2013 (PDT) | --[[User:Kenoxite|Kenoxite]] ([[User talk:Kenoxite|talk]]) 05:08, 1 October 2013 (PDT) | ||
== Row entries now use named parameters == | |||
That's it. No more "Is that 0 for encumbrance or for EP? Did I put that in the wrong place?". Each parameter is now named, so you can clearly see what is what when updating or adding new entries. This also means that you could place the parameters in any order you want without breaking the internet. | |||
I've had to deal with regular expressions for this, using Notepad++ built-in regex search/replace tool. | |||
Below there's the regular expressions I used, for future reference and as a guide when updating other tables from section that also need this. For anybody else, remember to update both the page AND the row template with the new parameters. | |||
For entries with hints, search for: | |||
<code>^(\{\{row\/\{\{PAGENAME\}\}\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?)\r\n^(\|)"(.*?)"(.*?\{\{hint\|.*?\}\})</code> | |||
And for those without hints, search for: | |||
<code>^(\{\{row\/\{\{PAGENAME\}\}\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?)\r\n^(\|)"(.*?)"</code> | |||
Replace in both cases with: | |||
<code>\1name=\2rarity=\3price=\4color=\5mat1=\6mat2=\7volume=\8weight=\9bashdmg=${10}tohit=${11}encumbrance=${12}enviprotect=${15}warmth=${16}storage=${17}cover=${18}</code> | |||
Finally, a normal replace (no regex) to add missing parameters with default values. | |||
Search for: | |||
<code>)}}</code> | |||
and replace with: | |||
<code>)|coverage=0|thickness=1}}</code> | |||
--[[User:Kenoxite|Kenoxite]] ([[User talk:Kenoxite|talk]]) 04:12, 3 October 2013 (PDT) |
Revision as of 11:12, 3 October 2013
Power armor section
The original description was written as if someone like this guy was explaining this whole power armor thing to grunts. Seeing that this was clearly military gear created used by military personnel I thought it was both fitting and fun. It was intended to be both humorous and informative.
But first after the removal of the hints, that helped expand and clarify the tone and purpose of this whole joke and now with the latest rewrite, I don't think this section works anymore. The tone is all over the place and the humorous intent is diluted and extremely unclear, which leads to even more confusion.
TBH I rather have the whole text in the power armor description section streamlined with the rest of the wiki (so, aseptic and purely descriptive) than what we have now.
EDIT: I just wanted to clarify that this is nothing personal, neither from my part nor towards KA101's edit. I just was trying to explain why I think it worked before and IMO it doesn't now. And, as I said, I think the better course of action would be to simply streamline this section "for the greater good" and to simplify further edits.
--Kenoxite (talk) 01:09, 6 June 2013 (PDT)
New parameters for existing and new entries
Due to the new way things are calculated and new parameters found in armor.json, this whole page should be revised and new items correctly inputted from now on.
Bash and cut protection isn't defined in the items themselves, but they're calculated based on their material composition and thickness.
There's also a new "coverage" parameter.
For the entries on this page
Examples
Socks should be updated from this:
{{row/{{PAGENAME}}|socks|70|100|C_SHOES|COTTON|null|1|1|-5|0|0|0|0|0|10|0|mfb(bp_feet) |"Socks. Put 'em on your feet."}}
to this (notice the new coverage and thickness parameters):
{{row/{{PAGENAME}}|socks|70|100|C_SHOES|COTTON|null|1|1|-5|0|0|0|0|0|10|0|mfb(bp_feet) |"Socks. Put 'em on your feet."|coverage=80|thickness=1}}
Although they aren't used anymore, the old bash and cut protection values can be left as is. In any case, if you don't want them to be theredelete their values, but don't delete the parameters themselves.
I mean, you can do this (notice the protection values are deleted and being left empty):
{{row/{{PAGENAME}}|socks|70|100|C_SHOES|COTTON|null|1|1|-5|0|0|||0|10|0|mfb(bp_feet) |"Socks. Put 'em on your feet."|coverage=80|thickness=1}}
but do not do this (notice the protection parameters have been totally removed):
{{row/{{PAGENAME}}|socks|70|100|C_SHOES|COTTON|null|1|1|-5|0|0|0|10|0|mfb(bp_feet) |"Socks. Put 'em on your feet."|coverage=80|thickness=1}}
All this is because of the way the row template is reading the parameters. Instead of using named ones (such as the new thickness and coverage) it relies on the position they are passed. If you remove them, then the count is altered, and any parameter after them will be read wrong. This is legacy from the old Whales wiki, from which this page was originally ported, tweaked and expanded upon. Eventually, this will be streamlined one way or another (if anybody is up for it, go ahead!) but, as of now, that's the way we must do things, as confusing as they might be.
For the standalone item pages
These parameters aren't needed anymore (as they're auto-calculated based on materials and thickness): bashprotect, cutprotect
And these are needed now: thickness, coverage
As before, you can leave the bashprotect and cutprotect parameters there, but they won't be used. Unlike the row entries, here you are free to delete them if you want to.
See kevlar vest, leather jacket and flotation vest for examples.
--Kenoxite (talk) 05:08, 1 October 2013 (PDT)
Row entries now use named parameters
That's it. No more "Is that 0 for encumbrance or for EP? Did I put that in the wrong place?". Each parameter is now named, so you can clearly see what is what when updating or adding new entries. This also means that you could place the parameters in any order you want without breaking the internet.
I've had to deal with regular expressions for this, using Notepad++ built-in regex search/replace tool.
Below there's the regular expressions I used, for future reference and as a guide when updating other tables from section that also need this. For anybody else, remember to update both the page AND the row template with the new parameters.
For entries with hints, search for:
^(\{\{row\/\{\{PAGENAME\}\}\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?)\r\n^(\|)"(.*?)"(.*?\{\{hint\|.*?\}\})
And for those without hints, search for:
^(\{\{row\/\{\{PAGENAME\}\}\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?\|)(.*?)\r\n^(\|)"(.*?)"
Replace in both cases with:
\1name=\2rarity=\3price=\4color=\5mat1=\6mat2=\7volume=\8weight=\9bashdmg=${10}tohit=${11}encumbrance=${12}enviprotect=${15}warmth=${16}storage=${17}cover=${18}
Finally, a normal replace (no regex) to add missing parameters with default values.
Search for:
)}}
and replace with:
)|coverage=0|thickness=1}}