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:Latias1290

From Dwarf Fortress Wiki
Jump to navigation Jump to search

Hi! Wanted to ask me a question? You came to the right place.
When you want to post something, please post new stuff at the bottom of the page. You can use the Add topic button for that.
When you post something, remember to put ~~~~ at the end of the post. Or, if you have a custom setup, like I do, you can use ~~~. But usually you want to use the quad tidle, not the tri one.
Latias1290 (talk)

Double redirects

I know there are a lot of double redirects on this wiki, but they're supposed to work (a couple don't for some reason, but most of them work fine). Basically, keeping HFS pointing to cv:HFS saves us trouble when we create the DF2014 namespace and set "cv" to point to it instead. (This is a better explanation, although outdated.)

However, I agree that we shouldn't need so many double redirects. I'm currently working on a way to make Mediawiki automatically jump to the cv: page without needing to create a redirect, so hopefully that'll solve this problem.

Also, thanks for your various fixes/corrections around the wiki :) --Lethosor (talk) 20:00, 8 January 2014 (UTC)

You may be interested in the discussion here. --Lethosor (talk) 20:47, 8 January 2014 (UTC)

Re: Using templates with special characters in parameters

It is possible to use pipes (|) and equals signs, although it's tricky. Things like this usually work just fine, since Mediawiki parses the inner template before the outer one:

{{template1|{{template2|param}}}}

e.g. {{key|{{char|50}}}} gives 2

Using things like tables is trickier, and usually requires the use of a separate template, {{!}}, which produces a pipe character. (There is also {{!-}}, which produces |-). Using these keeps Mediawiki from interpreting the pipe as a separator, which lets you use it in a parameter.

Also, if you use equals signs in a parameter, like this:

{{template|1 + 1 = 2}}

You need to either use {{=}} instead of the equals sign or specify the parameter ({{{1}}}) explicitly, i.e.:

{{template|1=1 + 1 = 2}}

(The reason the first one doesn't work is because Mediawiki interprets the content before the = sign as the parameter name, passing the template a parameter named "1 + 1" with "2" as the value. The second option forces it to use "1" as the parameter name and "1 + 1 = 2" as the value. This page has more information about this, if you're interested.)

It's messy (and harder to read), but it does work. My personal recommendation in this situation to avoid having to escape a lot of pipes is to create two templates – one for a header, and one for a footer. (Usually just a header is necessary, since a footer is often just a </div> that doesn't really need a separate template).

Lethosor (talk) 20:37, 5 February 2014 (UTC)

Infinite vs unlimited finite

The distinction is a rather pedantic mathematical one. While there are indeed infinitely many different numbers of mechanisms you can embed in a lever, all of those numbers are themselves finite, so it's not correct to say (as the article did) "they can be used to stack an infinite number of mechanisms". According to my sources, this distinction is a common cause of confusion among first-year University maths students. --bjh21 (talk) 20:50, 8 February 2014 (UTC)

Ah, I get what you mean now. You indeed cant physically have an infinite amount of mechs on a lever :P Latias1290 (talk)

JS

I ended up abandoning that because it became too cluttered and complex to do much with. Feel free to decipher what it does if you like. Part of the reason it's so unreadable is because I was trying to reduce its size, before I realized Mediawiki automatically minifies Javascript over a certain length.

  • window contains all Javascript globals in the current page/window (equivalent to Lua's _G). For example, alert and window.alert are the same thing. I usually use "window" when I want to force the use of a global variable instead of a local one.
  • _le is the same thing as window.LE. I use it to "export" things to the global namespace - since everything is inside a big function (a closure), variables I define there belong to that function's scope and aren't accessible to any outside code. Anything I put in _le, however, is accessible, since I have window.LE = _le near the end of the function. I could have used LE instead of _le - it doesn't make a difference.
  • A() is complicated. I use it to assign properties to _le (e.g. instead of _le.x = 2, I use A('x', 2)). Here's a fully-documented version:
function A(a,b){
	/* Assigns properties to '_le'. Polymorphic.
	A(String a, mixed b): Assigns _le[a] to b
	A(Object a): Performs A(key, value) for each {key:value} pair in 'a'
	*/
	if(!b){ // THIS IS BAD. It should be "if(b!==undefined)"
		// 'b' is not defined, so assign all key-value pairs in 'a' (an object) to _le
		if (typeof a != 'object') return; // if 'a' isn't an object, it doesn't have keys, so looping won't work. This only happens with things like A('foo')
		for(i in a){ // Loop through keys of 'a' - 'i' is the key
			if(i in {}) continue; // if i is a property of an empty object, skip it. This should never happen unless you add properties to the Object constructor.
			_le[i] = a[i] // Assign property 'i' of 'a' to the same property of '_le'. In this loop, effectively assigns all properties of 'a' to '_le'.
		}
	}
	else _le[a]=b; // b _is_ defined, so set _le[a] to 'b'
	return A; // returns A so it can be called again, if necessary
}
-----
The following lines are equivalent:
A('a', 1); A('b', 2);
A({a:1, b:2});
A('a', 1)('b', 2);
  • OPTS_MD is "metadata", which I was eventually going to use for a settings manager. It doesn't do anything, so you can remove it if you like.
  • You can probably remove the jQuery loading - the wiki now uses 1.8, which works just fine. I can add this for you if you like (admins can edit user JS pages :) )
  • OPTS contains options, and DEFAULT_OPTS contains the defaults. OPTS merges data from DEFAULT_OPTS and LE_USER_OPTS (if it exists), with LE_USER_OPTS taking priority. (This is also what update_opts does)
  • I have no idea why I used O() instead of accessing the options directly.
  • PM is a plugin manager, which I meant to use to simplify adding new features. It actually made them more complicated and less readable, particularly since I gave everything unhelpful variable names (see point #1)
  • LELL is supposed to be a way to run events when the menu loads, but it doesn't work (it actually causes errors when the page loads, but I suspect that's a result of loading jQuery). It also doesn't do anything, as far as I know, so it can be removed too.

I can try to explain other things too, if it helps (assuming I can figure them out). —Lethosor (talk) 16:50, 23 March 2014 (UTC)

AAAAAA???

Your edit of decoration: http://dwarffortresswiki.org/index.php?title=DF2012:Decoration&diff=195815&oldid=195779 is rather poorly explained. I think you _meant_ that you changed the spelling to conform with in-game use? "Civilisation" is a perfectly valid spelling of the word, just not the one used by the game itself.--Larix (talk) 18:12, 24 March 2014 (UTC)

Actually I always thought "civilizations" was the right spelling but after some quick "research" just now I found out both are correct Latias1290 (talk)

Recent changes to the Non Dwarf's Guide to Rock

Your "Fortune?" Column adds little to what exists on the Uses column and at most, some of its content could be merged into the Uses column.

For instance, you're being highly redundant in stating that all Flux stone can be used to make steel, mainly because any Non Dwarf will need to look into the Flux page to know what Flux is and hot to use it to make steel.

As I understand the work you might have had in adding the information, I was wondering if you had a good reason to add such column instead of undoing it without warning. --Doktoro Reichard (talk) 19:00, 10 April 2014 (UTC)

I remembered finding myself looking at the page and wondering if whatever I struck was valuable as a noob, and I also have some vague memories of it existing. Looking in the history didnt turn up anything, so I decided to add it.
Also, it didnt really take much work :P delete it if you want, since I actually realized its redunancy now that you told me :P Latias1290 (talk)

Re: DF2014:Collect webs‎

Redirects are an exception to the links-within-namespaces patch (it's probably due to Mediawiki not taking the patch into account when following redirects). I'll try to find a way to change this when I get a chance. —Lethosor (talk) 22:35, 13 November 2014 (UTC)

Re: Shortcuts subpage

Have you seen CP437? —Lethosor (talk) 23:55, 25 November 2014 (UTC)

No, I didn't. But I actually wanted my own subpage to have a shortcut to only the masterwork char, not the whole table. So I won't have to search for it every time I needed it. Latias1290 (talk)