User:Cephalon Scientia/Blog Drafts

For drafting blogs.

=Module:Stances—A New Look and Personality (Stance Tables Remastered)= Happy New Year Warframe Wikia users and contributors!

The advent of Update 26 with its Melee 2.9999 changes have brought me and many other editors attention towards the need to update how stance tables are displayed. So began my personal project of porting the wiki templates over to Lua (no not the moon) in the form of modules.

Before I begin, I want to shoutout to contributor User:ArbitraryMary for doing the majority of the work of updating most (if not all) the stance info. Thank you for your research! If there is anyone I missed, please leave a message below.

Rationale and Purpose
Over the past weeks I've been working on a working prototype of Module:Stances called Module:ScientiaStances which is a direct Lua port of the following templates:
 * Template:StanceCombosV2
 * Template:ComboIcon
 * Template:ComboIcon2
 * Template:SharedCombos
 * Template:StanceCombosV3 (unused)

The reason for the port is the ease of editbility and expandability of new and existing stance combos that comes with using modules instead of templates for formatting tables. User:FINNER has brought to my attention of a new combo format that editors have agreed on over on the Wikia Discord, and I will update the module to reflect on these new changes.

Current Implementation
Here is a snippet of Template:StanceCombosV2, showcasing the header and the first two table rows: {| class="foundrytable" style="font-family:Roboto; text-align:left; max-width:100%; margin:-6px 0px 0px 0px;"

If you go to the page and view the source code, you will see that it is very convoluted and difficult to edit for two main reasons:
 * Limited amount of characters that can be displayed on a line.
 * The use of Template:! and Template:!!!  that are needed to display certain symbols and characters in wikitables contained in Parser functions.

Proposed Implementation
The template implementation is Luafied as such: -- helper method for p.buildTable function -- pre: stanceName is a valid stance name -- post: returns a stance wikitable; tables in Module:ScientiaStances/data are unmodified function p.buildTableHelper(stanceName) -- table header local result = '{| class="foundrytable" style="font-family:Roboto; text-align:left; max-width:100%; margin:-6px 0px 0px 0px;"\n'.. '|-\n'.. '! style="text-align:center; padding: 0em 0.5em;" | Combo Name\n'.. '! style="text-align:center; padding: 0em 0.5em;" | Button Combination\n'.. '|-\n' local stanceInfo = STANCES_DATA[stanceName] local i = 1 local comboName = COMBO_NAMES[i] while (comboName ~= nil) do       -- if combo type exists in stance table add a row for it        if (stanceInfo[comboName] ~= nil) then result = result..buildComboRow(stanceInfo[comboName], comboName) end i = i + 1 comboName = COMBO_NAMES[i] end -- bottom collapsible legends result = result..buildAttackTypeLegendRow result = result..'| colspan="2" |\n'   -- this is needed for legend to fit table columns result = result..buildAttackLegendRow result = result..buildMultiplierHitLegendRow result = result..buildProcLegendRow return result..'|}' end
 * Essentially,   function handles all the formatting and styling in accordance to each combo type.

The following was recently made by User:FINNER for the sake of demoing style changes:

Benefits
Luafying Template:StanceCombosV2 and the like has its benefits:
 * All stance data are in one location instead of scattered about templates and individual stance pages.
 * Can support additional combos or procs in the case when the devs add new ones.
 * Automated styling of tables and its rows.
 * Cuts down the need of multiple templates to display tables; if tables need to be updated anyone logged in can just update the module.
 * Opens up the possibility of using stance data for other purposes than just displaying info on a table.
 * Abstraction of key functionality so you don't have to worry about the nitty-gritty details about how the table is being built. This is mainly for people who want to update the module.

Downsides

 * Requires Lua knowledge to edit and maintain.

Comparison
Source code:

Differences

 * Styling
 * Updated legend.
 * More spacing between damage multipliers and combo icons.
 * Adjustments on proc icon placement.
 * Styling is automated; it considers damage multipliers, number of hits, and proc info to decide whether to add padding or not.
 * Human-readable combo format for editing in Module:ScientiaStances/data (compared to using Template:ComboIcon2).
 * For attacks with more than one unique hit, proc icons will not appear on top of that combo icon. The reasoning for this is that it is redundant since proc info is already shown next to each unique hit.


 * Technical
 * Combo info are all in one location Module:ScientiaStances/data rather than being on a particular stance page and in Template:SharedCombos.
 * Relatively easy to navigate and modify module code compared to going through parser functions in Template:StanceCombosV2.
 * Expandable to new combo types and proc types; just add them to   and   tables at the top of the module.
 * Note that combo rows will appear in the same order as elements in   table.
 * Need to update Module:Icon/data if more proc types are to be added.

Limitations

 * Doesn't support attacks with more than 4 unique hits (same problem with using Template:StanceCombosV2 too).
 * Reason being that CSS classes for multiple unique hits are hard-coded and that there are only 4 of those classes:
 * ,,  , and

How Can You Help? Contribute to Module:ScientiaStances/data!
If you have any knowledge in Lua, you can help contribute to this project by updating stance tables in Module:Stances/data. For styling and formatting help, please see the documentation below:

Future Improvements?

 * Add support of displaying which moves/attacks have momentum.
 * Add legacy styling support (e.g. with to denote button presses).
 * Minor formatting updates.
 * Update proc icon data for melee in Module:Icon/data.

If you have any more ideas, please comment down below. The more discussion to be had on this topic, the more useful this wiki can become to fellow Tenno. We All Lift Together.

Thank you for coming to my TED talk.

Patch History
Last Updated: 1/3/2020