Difference between revisions of "Template talk:Part"

From TheKolWiki
Jump to: navigation, search
(goddammit)
 
(10 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
--[[User:Bagatelle|Bagatelle]] 18:46, 27 June 2007 (CDT)
 
--[[User:Bagatelle|Bagatelle]] 18:46, 27 June 2007 (CDT)
 
:: Yeah, [[Template:Test]] currently does that:
 
:: Yeah, [[Template:Test]] currently does that:
*With a did-a-chik and a snapping of his mighty pincer, he severs your {{Test|{{part}}| Ow! You really liked your }}!
+
*With a did-a-chik and a snapping of his mighty pincer, he severs your <nowiki>{{</nowiki>Test|{{part}}| Ow! You really liked your }}!
 
--[[User:Floh|<span style="color:green">F</span><span style="color:yellow">L</span><span style="color:orange">O</span>]] 14:26, 2 July 2007 (CDT)
 
--[[User:Floh|<span style="color:green">F</span><span style="color:yellow">L</span><span style="color:orange">O</span>]] 14:26, 2 July 2007 (CDT)
 
::PS: Better not use this yet, or, at least, give it another name than Test ;)
 
::PS: Better not use this yet, or, at least, give it another name than Test ;)
 
::Much cooler it would be to have the variables extension to MediaWiki ... --[[User:Floh|<span style="color:green">F</span><span style="color:yellow">L</span><span style="color:orange">O</span>]] 14:30, 2 July 2007 (CDT)
 
::Much cooler it would be to have the variables extension to MediaWiki ... --[[User:Floh|<span style="color:green">F</span><span style="color:yellow">L</span><span style="color:orange">O</span>]] 14:30, 2 July 2007 (CDT)
 +
 +
Since {{tl|#rand}} was added several months ago, it's technically now possible to implement this using a #switch, though it would probably end up performing more poorly as a result. Nonetheless, here it is: &lt;[[Anatomical Injuries|{{#switch:{{#rand:1|26}}|1=ankle|2=arm|3=arse|4=bung|5=calf|6=ear|7=elbow|8=eye|9=face|10=foot|11=forehead|12=giblets|13=groin|14=head|15=kidney|16=knee|17=leg|18=lower back|19=neck|20=nipple|21=shins|22=shoulder|23=skull|24=solar plexus|25=thigh|26=throat}}]]&gt; --{{User:Quietust/sig}} 05:22, 14 February 2009 (UTC)
 +
*My issue I've seen so far is that in messages where this template needs to be provide a new part name each time it is used in a line, it isn't.  I'm seeing nothing but the same part in each line.  Is this what everyone else is seeing?  If so, maybe we could add a flag to the template to use the randomization code above, that way we can make it generate new parts when it might otherwise not.  --[[User:Flargen|Flargen]] 05:53, 14 February 2009 (UTC)
 +
**I am indeed seeing this, and I suspect it is due to some optimization the wiki is performing on parser extension tags. Switching to use #switch would almost certainly solve this problem (and it would open up the possibility for feeding it a number to request a specific body part for the above scenario), but it would probably hurt performance. --{{User:Quietust/sig}} 06:05, 14 February 2009 (UTC)
 +
***I apparently forgot that I had discovered this last year and tried implementing it, only to find out that MediaWiki is still optimizing it out. Interestingly, if I call the template multiple times with different parameters, it sort of works. --{{User:Quietust/sig}} 22:06, 13 December 2010 (UTC)
 +
***You could also just send it a dump variable, a repeat the dump variable to repeat the random part -> {{part}} {{part|1}} {{part|2}} {{part|3}} {{part}} {{part|1}} {{part|2}} {{part|3}}.  Wait, well that is how you used to be able to do it before it just got changed. --[[User:JRSiebz|JRSiebz]] ([[User talk:JRSiebz|&#x260E;]]|[[Special:Contributions/JRSiebz|&#167;]]|[[Special:Listusers/sysop|&#8225;]]) 08:46, 16 December 2010 (UTC)
 +
****Or maybe that's just how the templates using RandomlySelect work(ed?). The wiki would create a cached version of the template for each dump variable, so repeating a variable repeated that particular version --[[User:JRSiebz|JRSiebz]] ([[User talk:JRSiebz|&#x260E;]]|[[Special:Contributions/JRSiebz|&#167;]]|[[Special:Listusers/sysop|&#8225;]]) 08:49, 16 December 2010 (UTC)
 +
*****That's how it still works (if I understand you correctly), which is essentially what I made note of in the new examples.  Using #rand demonstrates the same behavior.  Passing in dummy variables (or empty variables, as in the examples) always causes a new random value.  No variable calls all get optimized to the same value.  Which is exploitable a bit because I believe there are a few hit messages where the same part is intentionally used in multiple locations.  Not so much luck if there are two or more body parts intentionally reused, but one is good.  --[[User:Flargen|Flargen]] 08:52, 16 December 2010 (UTC)
 +
******Rather annoyingly, the updated MediaWiki seems '''not''' to have fixed this. Oh well. --{{User:Quietust/sig}} 20:50, 22 July 2011 (CEST)

Latest revision as of 18:50, 22 July 2011

Repetition

Is there any way of repeating a random body part? One of the lobsterfrogman's attack messages does this:

With a did-a-chik and a snapping of his mighty pincer, he severs your <part>. Ow! You really liked your <part>!

--Bagatelle 18:46, 27 June 2007 (CDT)

Yeah, Template:Test currently does that:
  • With a did-a-chik and a snapping of his mighty pincer, he severs your {{Test|<throat>| Ow! You really liked your }}!

--FLO 14:26, 2 July 2007 (CDT)

PS: Better not use this yet, or, at least, give it another name than Test ;)
Much cooler it would be to have the variables extension to MediaWiki ... --FLO 14:30, 2 July 2007 (CDT)

Since {{#rand}} was added several months ago, it's technically now possible to implement this using a #switch, though it would probably end up performing more poorly as a result. Nonetheless, here it is: <lower back> --Quietust (t|c) 05:22, 14 February 2009 (UTC)

  • My issue I've seen so far is that in messages where this template needs to be provide a new part name each time it is used in a line, it isn't. I'm seeing nothing but the same part in each line. Is this what everyone else is seeing? If so, maybe we could add a flag to the template to use the randomization code above, that way we can make it generate new parts when it might otherwise not. --Flargen 05:53, 14 February 2009 (UTC)
    • I am indeed seeing this, and I suspect it is due to some optimization the wiki is performing on parser extension tags. Switching to use #switch would almost certainly solve this problem (and it would open up the possibility for feeding it a number to request a specific body part for the above scenario), but it would probably hurt performance. --Quietust (t|c) 06:05, 14 February 2009 (UTC)
      • I apparently forgot that I had discovered this last year and tried implementing it, only to find out that MediaWiki is still optimizing it out. Interestingly, if I call the template multiple times with different parameters, it sort of works. --Quietust (t|c) 22:06, 13 December 2010 (UTC)
      • You could also just send it a dump variable, a repeat the dump variable to repeat the random part -> <thigh> <arse> <elbow> <lower back> <arse> <knee> <elbow> <groin>. Wait, well that is how you used to be able to do it before it just got changed. --JRSiebz (|§|) 08:46, 16 December 2010 (UTC)
        • Or maybe that's just how the templates using RandomlySelect work(ed?). The wiki would create a cached version of the template for each dump variable, so repeating a variable repeated that particular version --JRSiebz (|§|) 08:49, 16 December 2010 (UTC)
          • That's how it still works (if I understand you correctly), which is essentially what I made note of in the new examples. Using #rand demonstrates the same behavior. Passing in dummy variables (or empty variables, as in the examples) always causes a new random value. No variable calls all get optimized to the same value. Which is exploitable a bit because I believe there are a few hit messages where the same part is intentionally used in multiple locations. Not so much luck if there are two or more body parts intentionally reused, but one is good. --Flargen 08:52, 16 December 2010 (UTC)
            • Rather annoyingly, the updated MediaWiki seems not to have fixed this. Oh well. --Quietust (t|c) 20:50, 22 July 2011 (CEST)