Template talk:Skill infobox/weapon slot

From Guild Wars 2 Wiki
Jump to navigationJump to search

Request[edit]

It's hard to do this relatively simple request (context) in a neat way. I thought it would be easy to be honest, but there's so many corner cases. If anyone can think of a neat way, obviously rewrite away. -Chieftain AlexUser Chieftain Alex sig.png 23:35, 5 December 2020 (UTC)

I disabled the link once, see this edit. It always bothered me that clicking the weapon slot bar redirected to the file page and not to the actual skills. But yes, indeed, there are so many different skills with different skill orders that it get's tricky soon.
The question is: Where do we need it?
  • 1Yes Weapon - more or less done, maybe weaver is a little bit tricky.
  • 1Yes Profession bundles and engineer kits
  • 1Yes Transform
  • 1Yes Downed - straight forward (downed and drowning would take precedence over land skills), no slot 4 and 5 as they aren't profession but common skills (would require to reintroduce the Is for profession property value "Any" or hardcoding them)
  • 1Yes Drowning - no slot 4, no slot 5
  • 0No Common bundles - not sure about those, might be either straight forward or could be really complicated.
Otherwise, I can't really see a more efficient way to get those skills, for each context we need a separate query. --Tolkyria (talk) 23:53, 5 December 2020 (UTC)
I don't know, but this template somehow doesn't convince me because we have to take care of so many possibilities and nevertheless still miss one. Right now we are using the following rules (if I got wrong rule, please correct it) to select the skills, where the rules with lower numbers overrule one with lower numbers:
  1. Select skills of supertype profession.
  2. For the current weapon slot, select the current PAGENAME.
  3. For underwater skills, select underwater skills first, for land skills, select land skills first, otherwise select land and underwater skills.
  4. Select the skill with the lowest chain position.
  5. For weaver dual attack skills at weapon slot 3, select the skills 1, 2 from attunement 1 and skills 4, 5 from attunement 2.
  6. For thief dual wield skills at weapon slot 3, select the skills 1, 2 from mainhand weapon and skills 4, 5 from offhand weapon.
Furthermore, we have the following display rules:
  • Weapon slot filled tango.png — current slot.
  • Weapon slot empty tango.png — available slot.
  • Weapon slot blocked tango.png — blocked slot, not available for the current profession, e.g. offhand only weapons will have slots 1, 2, 3 blocked, to visually state that this slot isn't available. The file itself needs some improvement, I quickly created this one to get an idea how it looks like.
Hence, the following (maybe wierd) happens:
  • Since rule 1 is stronger than rule 2, all skills with chain position 2, 3, 4 will link itself rather than chain position 1. Use the chain field to select the other chain positions.
  • Rule 1 means that the downstate skills 4 and 5 are blocked due to being of supertype Common (actually these two skills are the only common skills which probably could of supertype profession with Is for profession set to "Any"). Furthermore any common skill bundles aren't considered, I think we even can't consider them, e.g. skills being available from several bundles but those may have different skills. Also racial skills, e.g. norn or human transform skills aren't considered yet, however those should be relatively easy to add.
  • One can't return to weaver dual attack skills once leaving it via this template. E.g. starting at fire + water sword skill 3, clicking slot 1 which will lead to fire sword skill 1. Clicking slot 3 again will lead to fire sword skill 3, but not fire + water sword skill 3. On the other hand it's quite nice when starting at fire + water staff 3, the skills 1, 2 are of attunement fire and the skills 4, 5 are of attunement water.
Again, while the overall idea sounds great, I don't know at which point we should (or even could) ship this subtemplate and offically add it to the skill infobox. --Tolkyria (talk) 15:43, 7 December 2020 (UTC)
I think this is very close to what I'd like to see. Chain skills linking to themselves is no problem, you can follow the link in the chain in infobox anyways. Weaver duals are also fine imo, it's the best solution we have.
I agree we should get the downed and racial transforms to work, but common bundles would become a nightmare, so i wouldn't get into that. DJemba (talk) 17:50, 7 December 2020 (UTC)
You guys have taken this template way beyond the initial offering. I think this is good enough! -Chieftain AlexUser Chieftain Alex sig.png 21:32, 7 December 2020 (UTC)

Sort order[edit]

I changed the sort order from

Is usable underwater, Has chain sequence position, Has specialization sort order, Is historical

to

Is usable underwater, Has specialization sort order, Has chain sequence position, Is historical

because Magnetic Aura, Shocking Aura and Air Pocket are weapon slot #3 chain #1 skills, and thus have a Has chain sequence position of 1 and Has specialization sort order of 0, while there are elite specialization skills, namely Dual Attack skills with Has chain sequence position of 0 and Has specialization sort order of 2. Hence, previously the elite specialization skills got placed first and were selected although the core profession skills are wanted instead. The following query should prove that in fact for all other skills the particular order of these two properties doesn't matter, while it matters for the three mentioned skills.

<includeonly>|-
| [[{{{1|}}}]]
| {{#ask: [[Is historical::N]][[Is for game mode::PvE||Default]][[Has skill slot number::{{{2|}}}]][[Has chain sequence position::>>{{{3|}}}]][[Has specialization sort order::<<{{{4|}}}]][[Is for profession::{{{5|}}}]][[Has weapon type sort order::{{{6|}}}]]}}
| {{#ask: [[Is historical::N]][[Is for game mode::PvE||Default]][[Has skill slot number::{{{2|}}}]][[Has chain sequence position::<<{{{3|}}}]][[Has specialization sort order::>>{{{4|}}}]][[Is for profession::{{{5|}}}]][[Has weapon type sort order::{{{6|}}}]]}}
</includeonly><noinclude>
{| class="wikitable sortable"
! Skill !! Core skill with larger chain sequence position !! Elite specialization skill with lower chain sequence position
{{#ask: [[Has skill slot number::<5]][[Is for game mode::PvE||Default]][[Is historical::N]] 
| ?Has skill slot number
| ?Has chain sequence position
| ?Has specialization sort order
| ?Is for profession
| ?Has weapon type sort order
| format = plainlist
| template = {{FULLPAGENAME}}
| sort = Has profession sort order, Has weapon type sort order, Has skill slot number, Has chain sequence position
| link = none
| limit = 500
| searchlabel =
| offset = 0 <!-- first "0" and second "500" -->
}}
|}

The main query checks for all skills with a Has skill slot number, each result will check for skills that have a higher Has chain sequence position number but a lower Has specialization sort order in the second column and vice versa in the third column. It returns only the three mentioned skills. --Tolkyria (talk) 18:46, 8 October 2021 (UTC)

Profession mechanic[edit]

What's the exact point of extending this template to profession mechanics? Let's break it down:

Usage
  • We have 9 professions with 3 elite specializations, so for simplicity let's say we have 36 different profession mechanic context we need to take care of.
  • It can be used for:
Profession Can be used Sum
Guardian all 4
Revenant Renegade, Vindicator 2
Warrior Bladesworn
(with almost no information gain)
1
Engineer none 0
Ranger Untamed 1
Thief Specter 1
Elementalist Elementalist, Tempest (not Catalyst) 2
Mesmer Mesmer, Chronomancer, Virtuoso 3
Necromancer Necromancer, Reaper, Scourge, Harbinger
(with almost no information gain except Scourge)
4
Sum 18
  • So it can be only used in half of the cases, where three of them are questionable as they aren't providing any links.
Current problems
  • Number of slots: Right now it always displays 5 slots, while actually the slots should be adjusted accordingly instead of placing red-crossed slots.
  • Selection: It also selects way to many skills currently, for example try elementalist attunements or mesmer shatter skills.
  • Code: As a follow-up to the previous point, the amount of code required to make it work for all cases is insane, so many exceptions to hard-code.
  • Inconsistency: As described above it can only be used on 50% of the profession mechanics, leaving the question to the wiki users why it is used here but not there.
    • Alternatively, we could display it also for the remaining 50% without links, but then again leaving the question to the wiki users why it can be clicked here but not there. Hence, inconsistent in either way, which should be avoided at all costs in my opinion.
  • Redundancy: One can discuss this point, but is it worth having a single dot for Necromancer, Reaper and Harbinger? Sure, it signals that there's only one profession mechanic skill, but that's it, no links to click which is the basic idea of this template.
Conclusion

In an ideal world with nicely behaving profession mechanics (for example if they would be similar to weapon skills in terms of uniqueness) it could work, but with all the different profession mechanics and slot overloads I think it won't work. See the five points stated above, especially the point inconsistency where we would have to decide to either enable/disable the template in 50% of the cases or enable/disable the links in 50% of the cases, both options sound unsatisfying for me. --Tolkyria (talk) 19:13, 4 January 2023 (UTC)

I agree in the sense that it doesn't make sense to have a template for weapon slots (skills 1 to 5) covering profession mechanic skills.
I'm looking at how complex the wikicode is for what at first glance appears a straightforward objective (it isn't) and it's pretty difficult to read.
I would support trying to keep templates simple, and if that's not possible, separate templates would be OK to me. -Chieftain AlexUser Chieftain Alex sig.png 19:31, 4 January 2023 (UTC)
As an aside, I've added a profession/specialization anchor link to the infobox from the "profession mechanic" link, e.g. Profession mechanic.
We could modify that further to be something like Profession mechanic (Guardian) -Chieftain AlexUser Chieftain Alex sig.png 19:37, 4 January 2023 (UTC)
I edited the template because even though we have the mechanic slot specified in the skill infobox, it wasn't being displayed in the end result. I thought I could integrate it with a simple edit to this template but you're right, it needs its own template to handle edge cases. An issue I encountered is there is currently no way to select only base profession mechanics with SMW. --BuffsEverywhere (talk) 20:06, 4 January 2023 (UTC)
I'm fine with the current profession mechanic subsection linking, any suffix will cause an unnecessary line break.
Sure, we should definitely split it (depending if we really want to implement this), since, although this template covers also bundle and transform, all of these skills are in slots 1-5. The difference between the two codes would be that the weapon slot code is one general query with some query exceptions, while the profession mechanic slot code would be several individual cases (#switch) with pretty easy queries. So the understandability of the code shouldn't be the problem for the profession mechanic slots, instead doing it consistently for all the other professions is the real problem (as I said, decide whether we go for unlinked icons or no icons at all in these cases, both are unsatisfying). I understand that it's tempting to do it for example for the profession Guardian (three Virtues in all four cases, straight-forward, no exceptions), it's not the question if we can solve those (obviously we can), the defining question is how we deal with the hard cases.
That's not true, while there's no straight-forward way, e.g. a boolean property, you can use Has specialization sort order::0 to select core skills only.
Site note: Editing without an displaying effect still causes all transcluded pages to be queued up and rebuild which could be avoided in my opinion, especially when the code is insufficient. --Tolkyria (talk) 20:17, 4 January 2023 (UTC)
Width of the dd element in the infobox was smaller than necessary, I've increased it to 140px in the CSS. This has allowed me to add the numerical suffix to the "profession mechanic" text. We could do the same for the other skill types. -Chieftain AlexUser Chieftain Alex sig.png 17:26, 5 January 2023 (UTC)
Your approach, adding the slot number in parentheses as suffix, is indeed lazy. I'm not sure if I like it, as this solution neglects the number of available profession skills and the option to access it directly, which would be handled by the original idea. Furthermore, it is clear for the wiki users what this number exactly stands for?
In order to somehow extend the weapon slot idea to profession mechanics, instead of Guardian what about a more tricky profession, namely Warrior?
  • Core Warrior: there we have only F1, thus we would display only one filled block: [<current F1 skill>]
  • Spellbreaker: with Full Counter on F2 we need to blocks, since we have only one dedicated F1 skill we could display the linked blocks: [Breaching Strike] [Full Counter] on both pages.
  • Berserker: again we have Berserk on F2 but we a completely new set of Primal Burst F1 skills. So again two blocks, where the F1 block is not linked to any skill (or linked to Primal Burst) but the F2 block is linked: [Primal Burst] [Berserk].
  • Bladesworn: this one is kinda straight forward again, if we let Unsheathe Gunsaber take precedence over Sheathe Gunsaber, namely: [Unsheathe Gunsaber] [Dragon Trigger].
This get's even harder with Engineer or Ranger, so the questions are: Are unlinked and thus unclickable blocks consistent with the weapon slot implementation? Are unlinked blocks too disturbing since the wiki users can't be sure whether it can be clicked or not in advance? Alternatively, is it okay to link to skill overview pages? Is a single block (e.g. Burst skill F1) redundant?
--Tolkyria (talk) 19:32, 5 January 2023 (UTC)

(Reset indent) I gave it a try and fully hardcoded the profession mechanic slots template, see my sandbox. I first tried to automatically query the easier skills, but since the trickier profession mechanics need to be defined by hand anyways I went with a completely manual approach (this would fit Alex' argument of easy readable code, note that currently it's a bit bloated due to the extra printouts).

Regarding my raised questions:

  • Number of slots: The number of slots is adjusted to the available slots, no red-crossed slots.
  • Selection: Not a problem due to manual selection.
  • Code: Turned out that actually it isn't that much.
  • Inconsistency: Except for the ranger slots "Attack my target", "Return to Me" and "Pet swap" everything is linked and thus consistently linked. If several skills share the same slot I either took the more important one (e.g. the initial chain skill), or if I couldn't select one then I linked to the skill overview page (e.g. Primal Burst skill overview page).
  • Redundancy: I'm still not sure about this one though, for example the single slot Shroud entrance.

--Tolkyria (talk) 19:08, 6 January 2023 (UTC)

Added Template:Skill infobox/mechanic slot. --Tolkyria (talk) 12:45, 10 January 2023 (UTC)
Thank you! It looks great! --BuffsEverywhere (talk) 15:47, 10 January 2023 (UTC)
FYI an empty box in the 1st mechanic slot links to the empty tango icon instead of the skill. --BuffsEverywhere (talk) 23:03, 10 January 2023 (UTC)
Edit: Fixed. --BuffsEverywhere (talk) 07:35, 11 January 2023 (UTC)
So #explode doesn't trim the output by removing leading/ending line breaks or whitespaces, interesting. Thanks for fixing it. --Tolkyria (talk) 18:54, 11 January 2023 (UTC)

Switching between holosmith sword skills going to wrong page[edit]

If for example you go to Radiant Arc and switch to another skill, it always goes to the non-holosmith version of the skill. Switching between non-holosmith sword skills works as intended. Possibly related to the latest revision of this template by Dak, which fixed an issue where switching from a 2-5 photon forge skill to the auto attack would always go to the traited-version Light Strike—Storm instead of Light Strike (although I do not remember if the issue occurred before this revision). --ItVictor (talk) 11:23, 26 February 2024 (UTC)

Inconsistency with thief sword skills[edit]

Another thing I just noticed, switching between thief sword auto-attack/sword 2 to the dual wield is not uniform with other thief one-handed weapons, i.e. Infiltrator's Strike goes to Pistol Whip (pistol off hand), I would expect it to go to Stab (thief sword skill) (no off hand) instead. Thief Scepter skills seems to switch as expected, as Shadow Sap goes to Triple Threat (no off hand). Dagger and Pistol use their same weapon dual wield skills which seems more appropriate but the inconsistency for sword vs scepter doesn't make sense here. --ItVictor (talk) 11:38, 26 February 2024 (UTC)

Both this and previous comment fixed. DJemba (talk) 14:16, 26 February 2024 (UTC)

Wrong page for Guardian hammer[edit]

Yet another issue, switching between Guardian hammer skills leads to Glacial Blow (from Glacial Heart trait) being in the list instead of Mighty Blow, as viewed from other hammer skills. --ItVictor (talk) 23:42, 4 April 2024 (UTC)

Fixed but I couldn't think of a smart way to do this (hard to distinguish between trait induced versions of skills) -Chieftain AlexUser Chieftain Alex sig.png 05:27, 5 April 2024 (UTC)