v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User talk:Lethosor

From Dwarf Fortress Wiki
Jump to navigation Jump to search
Archive
Archives

Bot requests

Raw ripping

Several questions about things I'd like to implement (check my userpage for current progress):

  • Don't those fancy scripts increase traffic cost and such?
  • Bulk upload images for workshops, doable?
  • I'm currently working on images-from-raws script. Is it possible to use actual graphic tiles?
  • In perspective, script should take every possible information from raws. For workshops it would be: keybind, components, profession, size, reactions, maybe even input and output. Which as well opens the way for such a glorious implementations as: workshop of profession list, output/input to workshop list, workhop|keybind|components table etc. With less possible tedious editing required. Any thoughts on the matter? --Asva (talk) 12:45, 7 September 2013 (UTC)
> Don't those fancy scripts increase traffic cost and such?
They do increase the time it takes to generate pages, especially if they pull a lot of raws from the server. Fortunately, they're usually cached once they're generated, so it doesn't have too much of an impact on the server. However, you should avoid including extremely large raws - Masterwork:Golem is an example of this.
> Bulk upload images for workshops, doable?
It would be hard. There are some file upload extensions on MediaWiki, but nearly all of them are unstable. There's a PHP script that can accomplish this, if you have access to the server (which I don't). Also, there's the possibility that images might change, which would require re-uploading some of them.
> I'm currently working on images-from-raws script. Is it possible to use actual graphic tiles?
Tilesets are much easier than graphics sets, since graphics sets require looking up information about each image. I've managed to make an extension that can display images with tilesets in-browser (with JavaScript), so that's definitely possible. Using the MDF tilesets would take more effort, since they use transparency, but it shouldn't be too hard (assuming I can figure out the composition algorithms).
> In perspective, script should take every possible information from raws. For workshops it would be: keybind, components, profession, size, reactions, maybe even input and output. Which as well opens the way for such a glorious implementations as: workshop of profession list, output/input to workshop list, workhop|keybind|components table etc. With less possible tedious editing required. Any thoughts on the matter?
This sounds like it would be really useful, but I haven't figured out a way to do it yet (wiki syntax is challenging, especially once you start nesting 20+ templates). It should be possible, though, as long as all of the information is in the raws somewhere (it's easiest if it's all in the same file, since DFRawFunctions only works with one file at a time).
Actually, maybe something like this could be used to generate images for workshops, instead of uploading pictures of every one. It would be really nice to reduce the amount of template editing needed to supply basic information about workshops (and other types of pages, like iron.)
So, in summary, extracting more information from the raws is possible. It would be hard, especially once you try formatting it, but it's definitely possible.
--Lethosor (talk) 14:27, 7 September 2013 (UTC)

> you should avoid including extremely large raws
Hm, that may be troublematic. In worst case it's possible to make shorter versions of raws.
> used to generate images for workshops
Currently working on that :P. Included Template:Tile and such in script to avoid long long nesty template chains. Function takes workshop TILE values, transforms them into UTF-8 code, and presents neatly. Shall add coloring in nearest future.--Asva (talk) 14:48, 7 September 2013 (UTC)

  • BTW, how do you make mediawiki show &#x263A -like unicode symbols?
☺ (☺) works for me. Are you using a template? Some templates, like {{diagram}}, process individual characters (&, #, ... ;) before the browser can process them as entities (&#...;). --Lethosor (talk) 15:11, 7 September 2013 (UTC)
  • Padding issue. With no way to insert line breaks from template, I get either this or that. Any way around you possibly know?
Nevermind, did it by xHTML. Script is fully operational and ready for testing.
Personally, I prefer using actual HTML tags (<table>, <td>, etc.) over MediaWiki tables for this reason, since they don't need newlines, but it looks like you got it working. Nice work! --Lethosor (talk) 15:15, 8 September 2013 (UTC)
  • Here is another problem. Table works fine in most cases. But when borders are missing (check incomplete building), the alignment messes up true location of tiles. Any helpful ideas, by chance? Here is the table config I use: <table cellpadding="0" cellspacing="0" style="font-size:150%; font-family: 'Courier New', 'Quicktype Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', 'Lucida Sans Typewriter', monospace; font-weight:bold">
The source code (wikitext) would make it easier for me to test it on my own. From my experiences with {{Diagram}}, though, it looks like each <td> element requires some CSS as well. --Lethosor (talk) 23:36, 13 September 2013 (UTC)
    
    
ò 
   
 
ò 
The source code is nothing but html... But oh, well.
I managed to fix those empty spaces. What I did is just exchanged tile "32" from conversion table with no-break space (&#160;).
Though, I still can't fiqure the way to get rid of borders at top and bottom of tiles.
  • On a different matter. Played a bit with tilesets. Seems, no javascript is required:

Arrow:

Phoebus 16x16.png

Bush:

Phoebus 16x16.png

Something:

Phoebus 16x16.png

2,3,1:

Phoebus 16x16.png

Phoebus 16x16.png
Phoebus 16x16.png

Though the padding is a bit weird. Somewhy for "arrow" and "2" it is not dividable by 16. --Asva (talk) 11:06, 14 September 2013 (UTC)

  • I'm almost done. Here's the result. And that's how it looks after I save the page =.=. Same syntax as before. --Asva (talk) 14:28, 14 September 2013 (UTC)

Wow, nice work. A few things I've noticed about the tiles, though - they don't seem to support non-square tilesets or different foreground colors. :( Personally, I'd prefer to use JavaScript for this (assuming I can get transparency to work) but the CSS works a lot better than I expected.

(And by the way, the "Close" button at the bottom of the pull request is probably what you're looking for.) --Lethosor (talk) 17:44, 14 September 2013 (UTC)

> support non-square tilesets
Probably fixaeble. Non square big tiles can be squarified. That will make messy code even messier...
Foreground colors? You mean, for monochrome tilesets? I don't think supporting these would be of any merit. For workshop articles, ascii and graphic tiles are plenty. Only implementation - would be tricky option, allowing any user to chose his favorite tileset from list.
Surely, clean javascript would suit much better.
PS Thanks for github editing and supportive information. --Asva (talk) 18:41, 14 September 2013 (UTC)
I was referring to the text color - for example, the background color of the numbers above (2,3,1) can easily be changed to red, green, and blue, but the colors of the numbers themselves are still white (I'm not even sure if it's possible to do this in CSS, although it could be). You're probably right about workshops not needing them, though.
> allowing any user to chose his favorite tileset from list
Definitely possible with an extension (could be added in Special:Preferences somewhere, for example), although it would require at least some JS to modify the CSS appropriately. --Lethosor (talk) 19:05, 14 September 2013 (UTC)
I'm talking about graphics sets. You can't possibly change color without turning them into monochrome+alpha. Which is weird and probably bothersome.
While for tilesets the idea is valid.
  • While working on items I encountered tags like FIRE_BUILD_SAFE, NEEDS_MAGMA, WORTHLESS_STONE_ONLY. Don't you have an idea, how those can be put in workshop or item template without taking too much space?
  • About huge tables (f.e. workshop | buildmat | tiled image | build profession). Is it possible to make them editable only by your bot? Like, simply update once new version arrives? Otherwise large tables may hurt server costs.


Hi. I remade the previous script a bit. Now it uses global array of objects. Which means, to get any output you'll have to (pseudocode warning):

  • {{load files}}
  • {{process files}}
  • {{output files}}

Beforehead, I passed all data for every function just to avoid excessive file loading. Was hectic, hard to debug, hard to process. As for now, stuff seems much brighter. For instance, I can make {{show me errors}} wiki template without much ado.

So, back to globals, is it a good idea (safety-wise)? Won't it break something?

BTW, I decided on quietust's functionality. I'll left it intact. Won't touch a thing. I'll use only one parser template, which is {{#df:}}. Approved, sir?--Asva (talk) 19:18, 17 October 2013 (UTC)

ArticleVersion bug?

The updated ArticleVersion template seems to believe Dwarf Fortress Italia is in the 40d namespace. --Loci (talk) 19:48, 21 October 2013 (UTC)

That's because there was a redirect created when I moved 40d:Dwarf Fortress Italia to the main namespace. I don't know of any way to resolve redirects from a template, so I just removed {{av}} from the article altogether. --Lethosor (talk) 20:21, 21 October 2013 (UTC)

New Push Page

Hey man I wanted to create a page about the default "push" attack creatures have, as its not always clear what that attack is. I thought I'd put some concrete into about it and a list of creatures that use it by default. I made the page and added content, but I really have no idea what I'm doing such as how to add that version box for what version of DF its for how to add it to the df2012 namespace...whatever namespace is. And how to see a list of categories. Internal links to creatures also will not work. I thought creating a page would be easy, apparently not.

Also is it ok to link to things like my Amazon Writing profile on my talk page? I just wanted to put something about me there and what I do.

Thanks. Hope you're liking my edits.

http://dwarffortresswiki.org/index.php/Push

I took care of the namespace and link problems - you just add "DF2012:" to the beginning of the title to create a page in the DF2012 namespace. The link issue was a result of capitalization - MediaWiki treats the entire article title as case-sensitive except for the first letter.
Anyway, putting up links to your other profiles on your user page is fine with me (as long as they're not super-promotional or inappropriate), and some other users have done things like that too. --Lethosor (talk) 20:14, 28 October 2013 (UTC)

Great, thanks for fixing it. I didn't realize it was that easy. and i didn't know about the case sensitive thing either I'll keep that in mind.

And thank you I will then. I've done plenty of writing :) Proudnerd (talk) 00:11, 29 October 2013 (UTC)

Rating script bug

It appears the new rating script is stripping returns when it rearranges ArticleVersion templates (example). This can lead to page layout problems. Can you revise the rating script to retain the returns?--Loci (talk) 19:53, 30 October 2013 (UTC)

I did manage to fix the second example you listed in the script with a recent update, which was caused by accidentally retaining spaces (see this edit), but I'll try to make it work with the source code better. Thanks for pointing out the first example, too – I hadn't thought of that as a possibility. --Lethosor (talk) 20:04, 30 October 2013 (UTC)
Just to point out, your test didn't have any spaces after the {{av}} template. But, beyond spaces, a number of special characters (such as ":") could probably still cause problems if they end up attached to the beginning of a paragraph. You could probably just add an extra return after the av template line to prevent most problems.--Loci (talk) 20:17, 30 October 2013 (UTC)
The rating script is apparently still stripping newlines: Native aluminum Bismuthinite. --Loci (talk) 15:27, 9 November 2013 (UTC)
This should be fixed now. (I actually fixed this about an hour ago, but I didn't save the fix to the branch used on this wiki -_-) This wiki automatically fetches updates for the rating script, so it should probably be updated in an hour or less (the new version that should appear on Special:Version is 1.0.2). --Lethosor (talk) 18:13, 9 November 2013 (UTC)
Thanks! ...But now the script is inserting an extra newline each time the page is rated [1]. This may lead to content creeping down the page until the newlines are manually removed. Is it possible to only add newlines when rearranging the page templates? --Loci (talk) 20:53, 14 November 2013 (UTC)
Wow, thanks for noticing that! Right now the {{quality}} replacement is using a single regex, and I fixed the last problem by changing \s to a space. Apparently I forgot that this was the reason it included newlines in the first place. I'll fix this when I can (hopefully in the next couple of days). --Lethosor (talk) 21:14, 14 November 2013 (UTC)

I've also noticed that the rating script tab appears at the top of pages that it shouldn't, such as Special:RecentChanges. That's a pretty minor bug, but if you're changing it anyway and it's easy to fix... --Loci (talk) 18:28, 16 November 2013 (UTC)

I can definitely get that done. The only reason I hadn't was because I didn't want to create future issues with new namespaces, but that's no longer an issue since I made the script into an extension. I'm probably going to implement this as a system message (and maybe a preferences option as well). Hopefully I can get to these things today or tomorrow. --Lethosor (talk) 18:39, 16 November 2013 (UTC)
This part is done (v1.0.3): see Mediawiki:rater-enable-ns and Mediawiki:rater-disable-ns (which specify a list of namespaces to enable/disable rating). Other namespaces still allow the rating to be viewed, but not saved (which is really only useful for testing purposes). --Lethosor (talk) 22:26, 20 November 2013 (UTC)

And I've fixed the issues with whitespace, as far as I can tell. The only one that wasn't resolvable was

{{av}} {{quality...}} content

which is changed to:

{{quality...}}
{{av}}content

(this doesn't cause any layout problems, and the source doesn't appear any worse than it was before). The recent edits I made to DF2012:Native aluminum were using an older version of the script – the current version works fine. (I've also added a debug mode, so I can test the script on the Sandbox in the future instead of messing with content pages.) --Lethosor (talk) 01:28, 22 November 2013 (UTC)

Creature template problem

Creature pages for untamable egg-laying creatures (like raven men) currently show them producing food products. Untamed egg-laying creatures don't actually produce eggs in this version (and probably wouldn't willingly hand them over to a hungry dwarf even if they did). The template probably needs to check that the creature has [PET] or [PET_EXOTIC]. --Loci (talk) 20:22, 20 November 2013 (UTC)

Fixed (it now checks for [PET] and [PET_EXOTIC]). --Lethosor (talk) 22:20, 20 November 2013 (UTC)

Bot tests

Testing on Python 3.4.0b1 --LethosorBot (talk | Lethosor | talk) 19:08, 8 December 2013 (UTC)

Testing on Python 2.7.5 --LethosorBot (talk | Lethosor | talk) 19:11, 8 December 2013 (UTC)


Testing on Python 3.4.0b3 --LethosorBot (Lethosor | talk) 19:54, 27 January 2014 (UTC)

Spammer

Anon 125.39.106.149 was vandalizing this page. Undone, just saying so you can go on blocking xD
Latias1290 (talk)

D for Dwarf

Lethosor, as you have seen recently, I have been doing some D for Dwarf parts of pages. Well, I would like to know somethings about what I can and can't do, it would help me. unsigned comment by Sbcc

Personally, I don't really care too much about the content of D for Dwarf sections as long as they're appropriate. The section Quietust removed on sponge man seemed appropriate enough to me – I suspect he may have removed it because someone else had recently removed another Spongebob reference, deeming it "unneeded" [2]. In this case, you should probably discuss it on the talk page and/or ask Quietust why he reverted your edits.
About what you "can and can't do" - we don't really have specific rules about that, as long as it's reasonably related to the article's topic (and appropriate). If you're interested in finding examples, this category lists all pages using {{D for Dwarf}}, which may be useful. —Lethosor (talk) 20:10, 30 January 2014 (UTC)

Thank you, it helped alot, ya I will ask him, thank you so much also you do alot of great stuff here, so that's why I asked you.

A page for amount of food, and how long it will keep a fortress alive

Im wondering if you can make a page for food amount and how long a fortress will be able to run on say food amount. It would be helpful, and I would make it if I knew how to make templates. Anyways, could you please help, if there is such a page that would really help to knpw where it is. Thank You ~ sincerely, Sbcc.

It was on the Farming FAQ. The page is called How large a farm do i need. Not really a template per se but it gets the job done.--Doktoro Reichard (talk) 05:55, 1 February 2014 (UTC)

Thank you, ive been looking for one soni can refrence things.

Raw adamantine wikipedia page

I do not understand the stonelookup template or the way infoboxes work on this wiki in the slightiest, so would you mind removing the wikipedia link that appears on the infoboxes on the Raw adamantine page? Latias1290 (talk)