NetHackWiki:Community Portal/Archive3
This page contains old sections from NetHackWiki:Community Portal. If you want to carry on talking about these topics, post a new section on the current Community Portal page. This page is intended to be a static archive.
Contents
- 1 New javascript-based monster template
- 2 Google Analytics
- 3 Item drops?
- 4 Instructional ttyrecs
- 5 Multiple entities on one page
- 6 Logical colour templates
- 7 Another tweak to the monster template
- 8 Internal names for article titles
- 9 Extra linebreaks in infobox templates
- 10 Linking to Wikipedia
- 11 Incomplete
- 12 Random page function
New javascript-based monster template
As was discussed a while ago, I've created a new template, currently at {{test}}, which combines the short and long form of the monster infoboxes, toggling between them with some javascript at MediaWiki:Monobook.js. You can see it in action on killer bee, if you make sure to clear your cache first. I've tested it on Firefox, Opera and Konqueror, but it doesn't appear to work on IE6 at the moment. Can someone else confirm that? I think the problem is with the following code:
if (window.addEventListener) window.addEventListener("load", createNavigationBarToggleButton, false) else if (window.attachEvent) window.attachEvent("onload", createNavigationBarToggleButton) else if (document.getElementById) window.LoadOff=createNavigationBarToggleButton;
but I have no idea what it is. Help! I'm not a programmer! --Jayt 23:08, 3 September 2006 (UTC)
- It is code to try to tell the createNavigationBarToggleButton function to run after the document loads (so that document.getElementById can find everything). The code did work when I found a copy of IE6 to test it on, but that was after you put in the missing semicolons. Meanwhile, I decided to replace that code with "addOnloadHook( createNavigationBarToggleButton );" which calls an addOnloadHook function from http://nethackwiki.com/skins3/common/wikibits.js?1, which loads before MediaWiki:Monobook.js does. By using addOnloadHook, our code runs before some of MediaWiki's own code, so there is less delay before the "Show detail" link shows up. --Kernigh 00:48, 4 September 2006 (UTC)
- Thanks, this is a much tidier solution. But there are still two or three people in #nethack who can't see the "Show details" link, even on almost identical setups to mine (Firefox 1.5.0.5 on Kubuntu). Their cache was cleared. I've tested it successfully on Firefox, IE6, Opera and Konqueror, on Kubuntu and Windows. Any ideas what could be going wrong? --Jayt 11:42, 4 September 2006 (UTC)
- Strangely, killer bee now works beautifully for me (I'm one of the Firefox 1.5.0.5 on Kubuntu guys). None of the pages have been edited since it was last broken, and I haven't done anything special, so I have no clue why it suddenly started working, or indeed, why it was broken in the first place. --Eidolos 17:42, 4 September 2006 (UTC)
- I observed the same situation on Firefox 1.5.something on same computer as IE6. I think that it might have went away when I logged in with Firefox (as I already was logged in with IE). I heard once that Wikia might use a server-side cache for anonymous users (not for logged-in users who have their name on every page), a setup that might be like one at Wikimedia. Possibly that caused it. --Kernigh 19:32, 4 September 2006 (UTC)
- Fascinating... I will test on a few more setups and ask around for results, but assuming it works as plans, what do you all think about replacing {{monster}} with {{test}}? I deliberately made the rolled-up version very very brief. I replaced Base level with Difficulty, which I now understand to be a good general summary of the monster's... difficulty (see RGRN)! The game uses it to determine which monsters to generate for a given level.
- Finally, I made the full table display by default, for when JS is not working/available. Does anybody notice a flicker when the page is first loaded, or will that JS always execute before the page is rendered for the first time? --Jayt 01:04, 6 September 2006 (UTC)
- There's no noticeable flicker here, and even if there was I wouldn't mind. I think resistances conveyed by eating should be in the hidden-details table as well; it's sufficiently useful information. (Also we should give percentages on how often each resistance is conveyed by that monster, but that's neither here nor there). --Eidolos 19:11, 6 September 2006 (UTC)
- I've tested Killer bee in eLinks, my other browser of choice (a member of the lynx family, no JS support). I notice that both the small and large tables are visible. Would it be practical to only output the small table using JS? I've also tested in JS-disabled Firefox 1.0, and the show/hide link becomes an empty table row. This actually makes it look nicer - a visual separator between need-to-know and nice-to know. --Stefanor 00:35, 7 September 2006 (UTC)
- Would it be practical to only output the small table using JS? That's what it does; a browser without JS will inevitably see both tables, unless it also supports CSS. --Jayt 12:22, 7 September 2006 (UTC)
Addendum
Addendum: Oops, I've now realised that the template won't work when more than one copy of it is on a page, which we should probably have on pages like Mummy. I'll have a think about this later. --Jayt 01:22, 6 September 2006 (UTC)
- Okaaay, I think I have it working. Except I'm running into the same cache problem, so I'm going to wait and see if it magically starts working later. --Jayt 12:35, 6 September 2006 (UTC)
- Try logging out and then back to Wikia. That should clear the cache. --ZeroOne 15:17, 6 September 2006 (UTC)
No, it is not the cache. It does not work in Firefox nor Opera on my Mac. I have now moved to my OpenBSD box (so I can use Konqueror's JavaScript debugger). So far, the createShowHideButtons function seems to be broken; calling it from a debugger acts as if the function does not exist. I am still investigating if we have a syntax problem. --Kernigh 17:20, 6 September 2006 (UTC)Well, the debugger is giving me old code. It turns out that [1] gives me old code even if I reload it. So there is a cache, but not the same cache. Thisismight be MediaWiki's internal cache (the one that we reset with action=purge, but I have no way to purge this one), not the anonymous-users cache. --Kernigh 17:32, 6 September 2006 (UTC) Update: since I really have no idea what the problem is, I am waiting for help in #wikia on Freenode. --Kernigh 20:03, 6 September 2006 (UTC)
- Whatever problem there was seems to have cleared up now. Does the template not work for anybody? --Jayt 12:22, 7 September 2006 (UTC)
CSS
There is also the matter of the new code requiring more divs. I haven't yet discovered a way to make these shrink-wrap to the point of invisibility, so that's why there's an extra grey border. Could somebody please fiddle with the template ({{test}}) until the border looks good? :-) --Jayt 12:22, 7 September 2006 (UTC)
Final comments
I have made several improvements. Here's an example of the final result:
a killer bee | |
---|---|
Difficulty | 5 |
Attacks |
Sting 1d3 poisonous |
Base level | 1 |
Base experience | 19 |
Speed | 18 |
Base AC | -1 |
Base MR | 0 |
Alignment | 0 (neutral) |
Frequency (by normal means) | Rare, appears in large groups |
Genocidable | Yes |
Weight | 1 |
Nutritional value | 5 |
Size | Tiny |
Resistances | Poison |
Resistances conveyed | Poison (30%) |
A killer bee:
|
If there are no complaints, I will replace the {{monster}} template soon. --Jayt 13:38, 8 September 2006 (UTC)
- I don't think the "A killer bee:" line of the attributes is at all necessary. Otherwise, looks pretty good on this end, good work! --Eidolos 16:24, 8 September 2006 (UTC)
- Once the new monster template goes live, I'll see what I can do about automatically uploading the rest of the monster species with User:Eidobot. --Eidolos 21:51, 8 September 2006 (UTC)
Google Analytics
(NetHackWiki has been a bit flaky for the last few days. The Wikia admins are aware of it. I'm sure they're doing something about it.)
I sent some Google Analytics javascript code to User:Jasonr; hopefully he'll put it in the right place soon and we'll have a better idea of which pages people actually read. --Jayt 12:19, 11 September 2006 (UTC)
- coff* The trouble with Google Analytics is that it runs in scripts on the pages that use it, and they're linked directly from Google's domain. Anyone using a script blocker probably blocks it - and anyone who is worried about security and uses Firefox will probably have NoScript. :[ (addendum by Michael Martin, unregistered reader; 9:10, 13 October 2006)
- Perhaps, but it's better than nothing. Although Wikia are being reticent about GA, so I suspect they don't want us to see the stats anyway. --Jayt 17:25, 13 October 2006 (UTC)
Item drops?
I'm not sure what article or template would fit this best, but I think it'd be good if we had a list of which monsters tend to carry/drop which items. (For instance, nymphs often carry mirrors and a potion of object detection; gnomes carry an aklys, etc.) If this already exists, I think it should be consolidated somewhere. Lotte 00:15, 24 September 2006 (UTC)
- I do not know if wehave such an article yet, but one can use the m_initinv function at makemon.c#line487 as a reference. --Kernigh 00:28, 24 September 2006 (UTC)
- The death-dropped item is random, but there is a spoiler here listing which items monsters can start with. It would make a nice wiki article, but you might want to contact Boudewijn before copying it wholesale (it doesn't carry a copyright notice). --Jayt 12:14, 24 September 2006 (UTC)
- Never knew that existed, thanks. (I wasn't planning to include deathdrops in the list). I'd imagine the source code would be a decent reference, but if needed we could contact him. Lotte 17:33, 24 September 2006 (UTC)
Instructional ttyrecs
ala Eidolos'? Castle with instrument, Kaen, maybe a newb one,... ideas? — Preceding unsigned comment added by Stumbly (talk • contribs) 25 September 2006
- What about instructional ttyrecs? I don't think those can be uploaded to this wiki, if that's what you are asking. But creating an article with a list of those and links to them may be a good idea, although I don't know where to find them in the first place... Maybe just by searching the r.g.r.n? --ZeroOne 13:36, 25 September 2006 (UTC)
Multiple entities on one page
We currently don't have any guidelines for when multiple entities should be documented in a single wiki article. For example, mithril-coat contains both elven and dwarvish varieties; Dragon contains all dragons; mimic contains all mimics; and there may be more. This can be good infodesign, but I suggest:
- Two entities (weapon, tool, monster, ...) should only be on the same page if there is useful commentary that spans them both.
- To emphasise that the two entities are in fact separate game objects:
The Banes fails the first point. I suggest it is broken up and redirected to bane, a disambiguation page.
Dragon will need 9 sections and 9 infoboxes to comply with the second point (I think baby dragons are sufficiently different to need a separate page); putting "see article" under Attacks really defeats the point of an infobox.
Any objections or comments before I add this advice to the style guide? --Jayt 17:21, 26 September 2006 (UTC)
- The reason Dragon is set up as it is is because almost all of the information in the infobox is completely identical between the different types of dragon. We do not need nine infoboxes containing largely the same information - it is horribly redundant. I am thinking separate infoboxes should only be used if there are substantial differences between entities (as with the mimics, Keystone Kops, the Yendorian Army, etc. -- SGrunt 18:24, 26 September 2006 (UTC)
- Sure it's redundant, but NetHackWiki is a massively redundant enterprise, all for the sake of usability. Firstly, when people look up info on a monster, they could read the current dragon template and ignore the non-relevant bits, or they could dig through mon1-343.txt, but I think the very purpose of an infobox is to document exactly one thing. Secondly, I don't think dragons really are similar enough to justify making an exception to the normal use of infoboxes: there are three fields in the current box saying "see article", and of course there's no monster with the name "dragon". It gets worse when the attributes list is added (yellow and green dragons are acidic and poisonous, respectively and uniquely). --Jayt 22:46, 26 September 2006 (UTC)
Any further comments on this from anyone? I will leave Dragon alone for now if it's a major objection, SGrunt. --Jayt 11:58, 30 September 2006 (UTC)
Logical colour templates
In the spirit of Template:Black and CLR_BLACK
, I'm tempted to create a set of colour templates corresponding to HI_LEATHER
, HI_METAL
etc. from color.h. This would make transcribing infoboxes from source easier, and would insulate us from potential changes. Not sure whether I'd call them "leather color" or "HI_LEATHER", though. Any thoughts? --Killian 02:56, 1 October 2006 (UTC)
- I see no reason not to use {{leather}}, {{silver}}, {{organic}}, {{metal}}, etc.. They won't interfere with similarly titled pages in the article namespace, and this seems as good a use for them as any. Also, has any object ever changed colour? --Jayt 14:03, 1 October 2006 (UTC)
- Ah, but I see now that you've already done it :-) --Jayt 15:04, 1 October 2006 (UTC)
Another tweak to the monster template
= | |||
---|---|---|---|
Name | giant beetle | ||
Appearance | random | ||
Base price | {{{cost}}} zm | ||
Weight | 3 | ||
Probability out of rings | 3.57% | ||
Probability out of items in: | |||
containers | Rogue level | Gehennom | Elsewhere |
0.179% | 0.179% | 0.286% | 0.107% |
I put the monster's name on the top row for an even more compact table, as originally envisaged by PraetorFenix. Any reason I shouldn't merge this into the {{monster}} template? --Jayt 15:04, 1 October 2006 (UTC)
- I would support this - it gives a proper title to the monster box. -- SGrunt 19:32, 3 October 2006 (UTC)
Internal names for article titles
I have moved several articles (Bell of Opening, Candelabrum of Invocation, Dark One, etc.) from titles prefixed with The to those without to match the internal names specified for those entities. My justifications for this are as follows:
- Pages generated with the assistance of tools (e.g. Monster) will point at the internal name and therefore a large number of links will point at the article with the internal title.
- As it stands, the majority of links pointing to the articles in question already point to the internal title (possibly as a consequence of the above).
If there is any rationale for preficing the articles with the unnecessary "The", please state it here. -- SGrunt 19:27, 3 October 2006 (UTC)
- Agreed. Quest artifacts are the exception - they are prefixed with The in artilist.h. --Jayt 21:31, 3 October 2006 (UTC)
- Hence why I've left them where they are. -- SGrunt 01:30, 4 October 2006 (UTC)
Extra linebreaks in infobox templates
I noticed there was a problem with some of the infobox templates: if you placed them in their own paragraph, before the first paragraph of the article, there was too much vertical space before the text itself. Turns out this was caused by having a linebreak between the end of the template body and the <noinclude>
tag. Removing the linebreak in the template solved the problem, so it's no longer necessary to put the template-include in the same paragraph as the article introduction (which is what I've had to do recently). --Killian 12:17, 6 October 2006 (UTC)
Linking to Wikipedia
I added links to Wikipedia articles K-ration and C-ration into our own K-ration and C-ration articles. I only did this because it isn't clear, what these things are actually supposed to be, and Wikipedia has some interesting background on them. The reason I am posting to Community Portal now is to prevent anyone from thinking that hey, it might be a good idea to add that template to all articles. If it isn't clear yet, I am strongly against adding {{wikipedia}} to all articles. Everyone knows, for example, what a dog, a tin opener or an apple is like. That is, I think the Wikipedia-link template should be used sparingly. --ZeroOne 21:17, 16 October 2006 (UTC)
- Agreed. The {{wikipedia}} template should only be used when it's not at all clear what something is, such as in the case of some of the demons, or perhaps to provide background on famous monster appearing in the game as a unique (such as Ashikaga Takauji). -- SGrunt 00:11, 17 October 2006 (UTC)
- (The interwiki prefix to Wikipedia is "wikipedia:" – "w:" points to Central Wikia. I fixed the two links above. --Kernigh 04:29, 17 October 2006 (UTC))
Incomplete
A lot of monsters are missing from the NetHackWiki database. I was wondering if anyone could fix this problem. I'd also love to know what wizard lock does. — Preceding unsigned comment added by Pokemonman (talk • contribs) 9 December 2006
- Concerning wizard lock, I just now gave to it a wiki article. --Kernigh 05:48, 9 December 2006 (UTC)
Random page function
I'm not sure if this is the place to post this, so feel free to move it if its not. It might be nice to stop the random page function from including source code... there's so much source code that more often than not you end up reading some random file from some random revision of the game, which most people using the "Random page" link aren't really intending to see. Just my thoughts on it. -- Intx13 20:31, 21 December 2006 (UTC)
- As far as I know, the only simple way to accomplish this would be to move it to a different namespace (like the User: and NetHackWiki: namespaces - call it "Source:"?). 64.218.194.120 15:49, 16 February 2007 (UTC)