Template talk:Trait

From Lotro-Wiki.com
Jump to navigation Jump to search

Status Update

The template is now live and awaiting deployment. This time around we'll be updating via a bot script as I'm sure nobody fancies the marathon editing sessions we did for skills. Magill has kindly offered to create the script.

First question...

Is Trait "identical" to Skills/Effects in what is required -- i.e. see: User_Talk:Magill-bot

Second question -- define "live and waiting for deployment?"

Wm Magill - Valamar - OTG/OTC - talk 23:57, 14 July 2013 (EDT)

Yes, trait works exactly the same as skill and effect. I have updated Proposed changes to Skill entries to include Trait. In answer to your second question:
  • Live = No longer in testing and available for general use
  • Waiting for deployment = Waiting for an update to existing traits to use the new template -- Snarpel (talk) 10:01, 15 July 2013 (EDT)

Template loop detected: Template Trait

This one is beyond me. Errors on Cunning Wound - It (apparently) is caused by the changes made to Template: Trait to support "trait_tree" which Neum made back in November.

Wm Magill - Valamar - OTG/OTC - talk 20:37, 4 January 2014 (UTC)
Cunning Wound and company are obsolete traits and are using what looks like an old (but still supported) parameter in trait_set - different from trait_tree. Enri's changes to The Quiet Knife (deleting the settip template) are specifically what broke Cunning Wound.
If we don't need trait_set anymore, just delete it from this template. I've fixed Cunning Wound, but all of the old traits that are no longer in the game need to receive the same treatment or get deleted. Sethladan 22:24, 4 January 2014 (UTC)
Yeah... I'm suspecting this is just the tip of the iceberg. As I've been Patrolling things, I notice both "Trait" and "Traits" being used -- probably interchangeably, but conflictingly? I think, but don't know, that "trait set" is still a term used by players to refer to what is now correctly called a "Specialization."
Have to go get some food so I can think straight.
Wm Magill - Valamar - OTG/OTC - talk 23:11, 4 January 2014 (UTC)
Well, I deleted Template:Traits with an "s", so hopefully that's one fewer doppelganger floating around. :P Sethladan 23:45, 4 January 2014 (UTC)

Displaying of Class Traits

Would it be possible to alter this template such that, if the 'type' parameter is set to "Class", the name of the actual class it belongs to (i.e. the content taken from the 'class' parameter) is displayed at the top, rather than it just saying "Class"? This would then make the display of the class traits consistent with how they are in-game.

I've been seeing a lot of cases where the 'type' parameter is given whatever text is desired to display (e.g. the name of the class) directly, in order to bypass this restriction, which kind of defeats the whole point I think.

Some sort of pseudo code of what I'm looking for:

IF Lowercase(type) = "class" THEN
    IF NotEmpty(class) THEN Display(class) END
ELSE
    Display(type)
END

I'm not very familiar with wiki syntax for functions, expressions and parsing of parameters etc., though I'm trying to figure it out and learn it, but some of it honestly really confuses me. So I would prefer not to mess around with this too much if I can avoid it, lest I break lots of stuff, and let someone far more knowledgeable about these things help out instead! :P

Here is my first feeble attempt at a solution:

<li style="color: #2AB51F; padding-top:0.5em;"> {{ #switch: {{lc:{{{type|}}}}}
    | racial | race = Race
    | class = {{{class|{{{type|}}}}}}	<!-- or maybe "Class" instead of {{{type|}}}?? -->
    | {{{type|}}}
}}</li>

Is this (close to) correct? Or is the syntax for the parameters wrong (it's really confusing to me...)? If so; what would be the correct version (and why)?
--Stargazer (talk) 17:29, 14 October 2021 (UTC)

Something like that should work. Sorry dont have time test it right now, but you can try changes to templates on sandbox pages, like Template:Trait/sandbox

--Drono (talk) 22:11, 14 October 2021 (UTC)