User:Kenoxite
PLEASE, DO NOT POST ANY FURTHER MODERATION REQUESTS HERE I should be considered inactive for all intents and purposes. New moderation requests should be directed to the new appointed administrators.
Test
Misc stuff
Mainly for personal use, but might help others.
New crafting input sytem
1. Create a new page for the information of the item's recipe. It must have the format: crafting/<full item name>
and MUST BE LOWER CASE (the full name, all the letters, even if the proper name uses caps).
To create a new page you can either write in your browser's address bar: http://www.wiki.cataclysmdda.com/index.php?title=crafting/ (plus the name of the item, in lower case), or do a search in the wiki for the page you want to create (crafting/<full item name>
) and click the returned red link.
2. Input the recipe data following this template. Note that the instances where the name of the item is used MUST AGAIN BE LOWER CASE.
Bold means parameters and other code that must be included in any recipe:
<includeonly>{{{{#switch: {{lc:{{PAGENAME}}}} |<full item name in lowercase> = Craft |#default = Row/Crafting1 }}</includeonly> <noinclude>{{Craft</noinclude> |name=<full item name in lowercase> |category=<category> |Skill1=<first skill used> |SkillLvl1=<first skill level> |time=
Example of the recipe for a grenade:
<includeonly>{{{{#switch: {{lc:{{PAGENAME}}}} |grenade = Craft |#default = Row/Crafting1 }}</includeonly> <noinclude>{{Craft</noinclude> |name=grenade |category=CC_WEAPON |Skill1=fabrication |SkillLvl1=2 |Skill2=mechanics |SkillLvl2=1 |time=5000 |reversible=false |autolearn=true |Tool=[[screwdriver]] {{or}} [[integrated toolset]] |ComponentR=[[pilot light]] |ComponentR2=[[superglue]] {{or}} [[string - 3 ft]] |ComponentR3=[[tin can]] {{or}} [[aluminum can]] {{or}} [[empty canister]] |ComponentR4=30x [[nails]] {{or}} 100x [[BB]] |ComponentR5=6x [[birdshot]] {{or}} 3x [[00 shot]] {{or}} 2x [[shotgun slug]] {{or}} 200x [[gasoline]] {{or}} 72x [[gunpowder]] |ComponentI=[[mininuke]] {{md}} [[booby trap]] {{md}} [[land mine]] }}<noinclude> [[category:{{recipecattocategory|CC_WEAPON}}]] </noinclude>
3. Now the recipe should be ready to be embedded anywhere. For instance, in the item page or the page of recipes of the same category.
To include it in the item page you need:
- First delete any present crafting data. It's not needed any more and it will only confuse, showing duplicate (and most likely contradictory) crafting info
- Change the call for the navbox to that of the template for the footer of that section. So, if it's a gun you should change {{ranged}} to this {{footer/ranged}}.
The currently available footers per section are:
- ranged weapons: {{footer/ranged}}
- ammunition: {{footer/ammunition}}
- gun modifications: {{footer/gunmods}}
- explosives: {{footer/explosives}}
- tools: {{footer/tools}}
- clothing: {{footer/clothing}}
If you need a new one either create it yourself or bring it up to me. The format of a footer template should be this:
{{recipe}} <name of the used navbox for that section> <noinclude>[[category:footers]]</noinclude>
You also should include the item in the page listing all the recipes of a given category (like Crafting/ammo, etc). To do so you only need to embed the recipe page inside the table, like:
{{:<recipe page>}}
Example to add the grenade recipe in Crafting/weapons:
{{:crafting/grenade}}
Regex
(For notepad++, but should work in anything that deals with regex)
(This one was for the clothing update. It was eventually replaced with the new embedding system, which made all this unnecessary.)
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}}