Template talk:New Krytan

From Guild Wars 2 Wiki
Jump to navigationJump to search

Include translation in template?[edit]

I like what Arrowmaster did in his userpage. Maybe you could add an option to also display latin letters below Krytan on your template too, Shew? Chriskang 22:09, 11 February 2011 (UTC)

I'll definitely look into that. Thanks for fixing the template! I need to clear up the whitespace, but that won't be a problem.-- Shew 00:34, 12 February 2011 (UTC)

Links[edit]

Could we implement a link thing? (such as {{nk|blah blah blah|elementalist}} so that text could link without manually doing it)? I know how to implement, I just want to check to make sure its okay with people... Aqua (T|C) 14:29, 28 March 2011 (UTC)

EDIT:I kind of know how to implement. May need assistance. Aqua (T|C) 14:31, 28 March 2011 (UTC)
Can't look into it atm, but will do (or someone else can). I think the way to do it would be a clickable div, given that each letter is a separate image. I could see where it would be fine for single words, as all you'd need to do is multiply the number of NK characters by the width of the characters (assuming they all have the same width). For multiple words, though, that would involve determining where there are spaces & how many there are, which I don't know how to do.-- Shew 15:16, 28 March 2011 (UTC)

Why?[edit]

Why on [[User:Necro Shea mo/Mousefire's Story|this page]] is the template not functioning(if you could look &such..)--User Necro Shea mo signature.jpg Necro Shea Mo 00:57, 14 May 2011 (UTC)

Category:Pages where template include size is exceeded pretty much says it all. Aqua (T|C) 02:47, 14 May 2011 (UTC)
Look at how many characters are in the template!--User Necro Shea mo signature.jpg Necro Shea Mo -Gelukkig Tulp Feest iedereen!!!! 14:37, 14 May 2011 (UTC)
The amount of New Krytan calls appears to be limited to 10 per article. Whether this is a wiki-software hard cap is beyond me. - Infinite - talk 15:15, 14 May 2011 (UTC)
Thank you Infinite!--User Necro Shea mo signature.jpg Necro Shea Mo -Gelukkig Tulp Feest iedereen!!!! 21:18, 14 May 2011 (UTC)
Is there anyway to break the 48 letter cap????--User Necro Shea mo signature.jpg Necro Shea Mo 05:44, 17 July 2011 (UTC)
The template is very inefficient at conserving space, so no. That's probably the reason for the limit of 10 calls (because there are sooooooo many template/parser function calls within the template and subtemplates) and definitely is the reason for the 48 letter cap.-- Shew 05:59, 17 July 2011 (UTC)
Ok... I sorta understood that... --User Necro Shea mo signature.jpg Necro Shea Mo 06:04, 17 July 2011 (UTC)

Is [For (wiki)] let as pass the 48 letters cap? -- Itay AlonTalk 15:51, 24 July 2011 (UTC)

Update?[edit]

can we get this updated with the new letters that are found on the new ktytan page?- User Zesbeer sig.png Zesbeer 22:43, 25 May 2012 (UTC)

Simplifying the code with recursion[edit]

The code is too "rough" right now, and using recursion, we could make it have no limits on characters. The only obstacle I've found is there's no recursion depth allowed: http://www.mediawiki.org/wiki/Manual:$wgMaxTemplateDepth :S.

With recursion, the code would be this: {{New Krytan/Recursion|{{{1}}}|{{{2}}}|{{#len:{{{1}}}}}|0}}

The code for {{New Krytan/Recursion}} is: {{#ifexpr:{{{3}}}>{{{4}}}|{{New Krytan/Encoder|{{#sub:{{{1}}}|{{{4}}}|1}}|{{{2}}}}}{{New Krytan/Recursion|{{{1}}}|{{#expr:{{{4}}}+1}}}}}}

As you see, the code is much more simple and clear, but it won't work with recursion disabled.--Lon-ami 15:07, 23 June 2012 (UTC)

There's a reason that MediaWiki imposes a limit on recursion depth - if it didn't, someone could write an infinitely expanding loop and crash the server. Well, they could if there wasn't an inherent limit in the PHP engine that serves to limit template recursion to a max of 50.
As I mentioned here already, we'll be able to do something similarly simple once we get SMW. The #arraymap function is like a loop or recursion function, except that it can't be forced to repeat indefinitely (it is always limited by the number of items in the input list), and thus is much more secure than template recursion. —Dr Ishmael User Dr ishmael Diablo the chicken.png 15:40, 23 June 2012 (UTC)
Couldn't we get a recursive limit of 150, for example? Or just allow it for this page?
Anyway, I'll just look at that #arraymap thing, and try to adapt my idea to it ;).--Lon-ami 16:45, 23 June 2012 (UTC)
Nope, the PHP limit I explained above is a hard limit on template recursion (at 50) due to how the MediaWiki parser works - once the PHP engine reaches a stack depth of 100 (at a rate of 2 per recursion), it throws an error. It would be more limiting than the current form of this template. —Dr Ishmael User Dr ishmael Diablo the chicken.png 16:56, 23 June 2012 (UTC)
Well, I cleaned the code a bit. It's still a huge wall of text, but now you can read the code easier. I added a lot of new functions, too. If you want to discuss them, go to the subtemplate: [[Template talk:New Krytan/Encoder]] ;).--Lon-ami 17:44, 23 June 2012 (UTC)
Just checked the new version out. Lookin' good! Much more efficient.-- shew|make 19:37, 21 May 2014 (UTC)

Whitespace[edit]

Right now, the text gets squished together without proper space between words. Would it be possible to add a New Krytan image for space (and implement this template /encoder to translate space to "whitespace.img"), or alternatively another easier method? Titus The Third User titus the third.png 17:19, 13 December 2014 (UTC)

It's impossible with the way #arraymap works here - it completely ignores all whitespace when splitting by character.
{{#arraymap:This is a test||@@@|%@@@|}}
%T%h%i%s%i%s%a%t%e%s%t
Dr Ishmael User Dr ishmael Diablo the chicken.png 18:28, 13 December 2014 (UTC)
How about adding the option to use another symbol (e.g. _) to create whitespace? Titus The Third User titus the third.png 11:02, 14 December 2014 (UTC)
New Krytan alphabet N.pngNew Krytan alphabet O.pngNew Krytan alphabet P.pngNew Krytan alphabet E.png. New Krytan alphabet A.pngNew Krytan alphabet N.pngNew Krytan alphabet Y.pngNew Krytan alphabet T.pngNew Krytan alphabet H.pngNew Krytan alphabet I.pngNew Krytan alphabet N.pngNew Krytan alphabet G.pngNew Krytan alphabet I.pngNew Krytan alphabet S.pngNew Krytan alphabet P.pngNew Krytan alphabet O.pngNew Krytan alphabet S.pngNew Krytan alphabet S.pngNew Krytan alphabet I.pngNew Krytan alphabet B.pngNew Krytan alphabet L.pngNew Krytan alphabet E.png.
-Chieftain AlexUser Chieftain Alex sig.png 12:00, 14 December 2014 (UTC)
Oh come on, that's just cheating. :P —Dr Ishmael User Dr ishmael Diablo the chicken.png 15:22, 14 December 2014 (UTC)
Yep. Was the em-space too wide btw? -Chieftain AlexUser Chieftain Alex sig.png 18:34, 14 December 2014 (UTC)
I think it looks good :) Thanks for fixing! Titus The Third User titus the third.png 19:52, 14 December 2014 (UTC)