Template talk:Ouch

From TheKolWiki
Jump to: navigation, search

I'll admit it is a start, but it's not much in the direction I was wanting to take it. This one looks like it'll be used as {{ouch|Ooh! Eek! Ouch!}} to give Ooh! Eek! Ouch!, while I was looking for something along the lines of {{ouch|5}} to come up with something like Ouch! Ooh! Ooh! Eek! Ow! or Argh! Ow! Oof! Eek! Oof! by using a wiki extension similar to what is used for body parts and substat names. --Quietust 22:07, 17 May 2006 (CDT)

  • Awesome idea. This template's only used on one page so far, so it can be modified easily. There's no random number function in the wikicode, is there? —Dentarthurdent(T,C) 22:13, 17 May 2006 (CDT)
    • No, there isn't any easy way to do randomization right now. This discussion would probably be best continued at Proposed Standards. --Quietust 22:39, 17 May 2006 (CDT)
  • How many different "groans" are there used in KoL? Argh, Eek, Oof, Ooh, Ouch, Ow? --JRSiebz (|§|) 00:08, 18 May 2006 (CDT)
    • Yep, that's all of them. --Quietust 08:05, 18 May 2006 (CDT)
  • .. and on a side note, how many different onomatopoeia are ther in KoL besides Splat! Whack! and Barf!? --JRSiebz (|§|) 00:08, 18 May 2006 (CDT)
    • BAM! BARF! BIFF! BONK! BOOF! KAPOW! KERBLAM! POW! SMACK! SOCKO! SPLAT! WHACK! WHAM! WHAMMO! ZAP! ZOT! --Quietust 08:05, 18 May 2006 (CDT)

Ok, I upgraded the template so that it uses the format which it will use in the future (where you enter a number). The results are not random so it ends up a bit awkward but it is better than a template which just changes the color to red.--SomeStranger (Talk | Contribs) 09:29, 18 May 2006 (CDT)


I just finished a plugin which would allow this:

<RandomlySelect num="3" repeat="true" separator=" X ">One|Elephant|Went|Out|to|Play</RandomlySelect>
This would select 3 elements out of the set (which happens to be six elements), allowing duplicate choices, using " X " as a separator in the results. (The 3 arguments are not required (but default to 1, false, and a space, respectively)

So this template could become just:

<span style="color: red; font-weight: bold;">
<RandomlySelect num="{{{1}}}" repeat="true" separator=" ">Argh!|Eek!|Oof!|Ooh!|Ouch!|Ow!</RandomlySelect>
</span>

I'm assuming this could be used to select one (or more) from a list of strings, like the onomatopoeic ouchies, or randomizing the term used for moxie (smarmness, etc.), etc. It works for good input, I;m just abusing it with bad input, hoping it fails gracefully and informatively. --JRSiebz (|§|) 23:08, 19 May 2006 (CDT)

  • Testing - Oof! Ow! Ooh! Oof! - hmm, something's not quite working. It's getting parsed before the template parameters are being substituted. --Quietust 08:09, 25 May 2006 (CDT)
    • There's also a significant problem when trying to embed these within links - [[Moxie Substat|<RandomlySelect>Cheek|Chutzpah|Roguishness|Smarm|Sarcasm</RandomlySelect>]] gives me Smarm. --Quietust 08:54, 25 May 2006 (CDT)
      • I just tried doing this by putting the RandomlySelect stuff inside a template and then using the template as the link caption (i.e. something like [[Moxie Substat|{{substat|moxie}}]]), but it gives the same result as above. --Quietust 10:18, 8 June 2006 (CDT)

It might be good to add another parameter to specify what each random element is separated with, to make it possible to include the | character within the random elements. Example: <RandomlySelect num="1" repeat="false" insep="," outsep=" ">[[Moxie Substat|Cheek]],[[Moxie Substat|Chutzpah]],[[Moxie Substat|Roguishness]],[[Moxie Substat|Smarm]],[[Moxie Substat|Sarcasm]]]</RandomlySelect>, in case the above issue cannot be solved. --Quietust 08:59, 25 May 2006 (CDT)

  • Ok here's the problem, the wiki parser does not replace template variables inside custom hooks. In laymans terms, it will not replace template variables such as {{{1}}} within <customtag>STUFF</customtag>. Everyone who has tried to put template variables inside a custom hook has had this problem. One person 'hacked' parser.php to work, but that was in v 1.5.7, and the 1.6 parser.php is a lot different. Mediawiki does not replace template variable in custom hooks, and evaluates the extension before the template is included. Kinda sucks. We may have to do some "creative templating". Hmph. I've been screwing around trying to see if I can manipulate when the extension gets evaluated, or force it to sub the template variables into it. --JRSiebz (|§|) 17:21, 25 May 2006 (CDT)
  • Odd, its evaluated before a template is included, causing problems, and I believe it's the |s used to define the list which screw up the wikilinks. Insert curse words here. Stupid thing works by itself, though, erg. Oof!Ugh!Ouch!Eek!Ouch!Argh!Argh!Ooh!Ow!Oof! --JRSiebz (|§|) 19:37, 25 May 2006 (CDT)
    • Until we can work out this issue, I've created templates Ouch1 thru Ouch9, which will be included by this one so we can at least randomize them. --Quietust 12:26, 26 May 2006 (CDT)
      • Oh, and Ouch10, since that's the most the game ever shows at once (for attacks that do over 50,000 HP of damage). --Quietust 21:28, 7 June 2006 (CDT)

How come I don't see a single "Ugh!" in there?--Someone Else 12:27, 26 May 2006 (CDT)

  • Because I somehow managed to forget that one. --Quietust 12:51, 26 May 2006 (CDT)

The Change

Why did have only one template before? It seems so logical and simple.--SomeStranger (t|c) 08:57, 6 April 2007 (CDT)

  • The reason we had multiple templates before is because this template predates the addition of ParserFunctions to this wiki - now that we have them, we can use them, but the RandomlySelect stuff still happens before the parserfunctions do. --Quietust (t|c) 12:07, 6 April 2007 (CDT)
  • Aw, we never got {{#rand:}}. :P I wonder if this version is slower since RandomlySelect is being evaluated 10 times, compared to a dynamic template call, this verison is probably faster, maybe.--Dehstil (t|c) 22:17, 6 April 2007 (CDT)