Dota 2 Wiki
Line 36: Line 36:
 
:Could you add explanations in [[Damage types]] so that the links work when added to the template? Thanks -- [[User:Sanhard|<span style="color: #52d017 !important">Sanhard</span>]] 08:07, 25 August 2019 (UTC)
 
:Could you add explanations in [[Damage types]] so that the links work when added to the template? Thanks -- [[User:Sanhard|<span style="color: #52d017 !important">Sanhard</span>]] 08:07, 25 August 2019 (UTC)
 
:: Link instant attack to [[Attack damage#Instant attacks]], and instant death to [[Damage types#Instant kill]]. <small>~~</small>&nbsp;'''[[User:Bu3ny|<span style="color:#52D017;">Bu3ny</span>]]'''&nbsp;<sup><small>([[User talk:Bu3ny|talk]])</small></sup> 10:52, 25 August 2019 (UTC)
 
:: Link instant attack to [[Attack damage#Instant attacks]], and instant death to [[Damage types#Instant kill]]. <small>~~</small>&nbsp;'''[[User:Bu3ny|<span style="color:#52D017;">Bu3ny</span>]]'''&nbsp;<sup><small>([[User talk:Bu3ny|talk]])</small></sup> 10:52, 25 August 2019 (UTC)
  +
  +
== span nowrap on cooldown and mana ==
  +
  +
Currently, the code is like this. (That #32 spaces fall apart in order to show code.)
  +
<pre>
  +
<div style="display:inline-block; margin:8px 0px 0px 50px; width:{{#if:{{{mana|}}}{{{mana tal|}}}{{{mana aghs|}}}{{{mana shard|}}}{{{currentmana|}}}{{{maxmana|}}}|190px|370px}}; vertical-align:top;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}{{{cooldown aghs|}}}{{{cooldown shard|}}}
  +
|<span style="position:relative; top:-2px;">{{Symbol|cooldown|alt=Cooldown:|size=20px}} </span>{{#if:{{{cooldown|}}}
  +
|{{#dplreplace:{{{cooldown}}}|#(?<!<)/#|/<wbr>}}
  +
}}{{#if:{{{cooldown tal|}}}
  +
|& #32;<span style="white-space:nowrap;">{{#if:{{{cooldown|}}}
  +
|(
  +
}}{{#var:taltext}}{{{cooldown tal}}}</span>{{#if:{{{cooldown|}}}
  +
|)
  +
}}</span>
  +
}}{{#if:{{{cooldown aghs|}}}{{{cooldown shard|}}}
  +
|& #32;<span style="white-space:nowrap;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|(
  +
}}{{#if:{{{cooldown aghs|}}}
  +
|{{#var:aghstext}}{{{cooldown aghs}}}</span>{{#if:{{{cooldown aghs tal|}}}
  +
|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|,& #32;
  +
|& #32;(
  +
}}<span style="white-space:nowrap;">{{#var:aghstaltext}}{{{cooldown aghs tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|
  +
|)
  +
}}
  +
}}
  +
|{{#var:shardtext}}{{{cooldown shard}}}</span>{{#if:{{{cooldown shard tal|}}}
  +
|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|,& #32;
  +
|& #32;(
  +
}}<span style="white-space:nowrap;">{{#var:shardtaltext}}{{{cooldown shard tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|
  +
|)
  +
}}
  +
}}
  +
}}{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|)
  +
}}</span>
  +
}}
  +
}}</div><!--
  +
</pre>
  +
  +
The aghs tal text (<pre>{{#var:aghstaltext}}{{{cooldown aghs tal}}}</pre>) and shard tal text (<pre>{{#var:shardtaltext}}{{{cooldown shard tal}}}</pre>) are useless, because there is a nowrap span outside of them (<pre><span style="white-space:nowrap;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}</pre>). If you want to break them, nowrap span should be contained only the symbol and value, which is like this.
  +
<pre>
  +
<div style="display:inline-block; margin:8px 0px 0px 50px; width:{{#if:{{{mana|}}}{{{mana tal|}}}{{{mana aghs|}}}{{{mana shard|}}}{{{currentmana|}}}{{{maxmana|}}}|190px|370px}}; vertical-align:top;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}{{{cooldown aghs|}}}{{{cooldown shard|}}}
  +
|<span style="position:relative; top:-2px;">{{Symbol|cooldown|alt=Cooldown:|size=20px}} </span>{{#if:{{{cooldown|}}}
  +
|{{#dplreplace:{{{cooldown}}}|#(?<!<)/#|/<wbr>}}
  +
}}{{#if:{{{cooldown tal|}}}
  +
|& #32;{{#if:{{{cooldown|}}}
  +
|(
  +
}}<span style="white-space:nowrap;">{{#var:taltext}}{{{cooldown tal}}}</span>{{#if:{{{cooldown|}}}
  +
|)
  +
}}</span>
  +
}}{{#if:{{{cooldown aghs|}}}{{{cooldown shard|}}}
  +
|& #32;{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|(
  +
}}{{#if:{{{cooldown aghs|}}}
  +
|<span style="white-space:nowrap;">{{#var:aghstext}}{{{cooldown aghs}}}</span></span>{{#if:{{{cooldown aghs tal|}}}
  +
|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|,& #32;
  +
|& #32;(
  +
}}<span style="white-space:nowrap;">{{#var:aghstaltext}}{{{cooldown aghs tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|
  +
|)
  +
}}
  +
}}
  +
|<span style="white-space:nowrap;">{{#var:shardtext}}{{{cooldown shard}}}</span></span>{{#if:{{{cooldown shard tal|}}}
  +
|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|,& #32;
  +
|& #32;(
  +
}}<span style="white-space:nowrap;">{{#var:shardtaltext}}{{{cooldown shard tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|
  +
|)
  +
}}
  +
}}
  +
}}{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
  +
|)
  +
}}
  +
}}
  +
}}</div><!--
  +
</pre>
  +
  +
Change it if you like. BTW, that is a rare case. --[[User:Elite stay|Elite stay]] ([[User talk:Elite stay|talk]]) 16:17, 25 February 2021 (UTC)

Revision as of 16:17, 25 February 2021

Cargo query problems

It seems like the way we are handling talent values in this template won't work with Cargo. When storing a value, that is generated by querying another value stored by the same template, Cargo always stores <em>No results</em> instead of that new value (it gets displayed correctly on the page though). See my idea for a solution below:

Possible fix: Setting variables for each value and accessing those variables instead of querying Cargo.

  • Example:
    • Before: {{calc|v1+{{show|T|Ancient Apparition|talent3right_value}}/100|v1={{show|A|Ancient Apparition|Ice Vortex|value3}}|%}}
    • After: {{calc|v1+{{show|T|Ancient Apparition|talent3right_value}}/100|v1={{#var:Ancient Apparition#Ice Vortex#value3}}|%}}
  • Advantages:
    • Good performance
    • Does not introduce any additional syntax/templates
  • Disadvantages:
    • Values can only be accessed after they are set (e.g. they can't be used in the ability description).

This is obviously not ideal, and if anyone has a better idea, please let me know. --Litzsch 08:56, 27 April 2018 (UTC)

Update: It's worse that I initially thought; the problems don't seem to be limited to values stored by the same template, but also affect other values stored on the same page. I think (needs more testing) all values stored by the same template and below it are affected. --Litzsch 09:09, 27 April 2018 (UTC)
Is Lua error: Expression error: Unexpected < operator.. the same problem? --Elite stay (talk) 13:20, 30 April 2018 (UTC)
Yes. It's due to Module:Calculate getting <em>No results</em> as one of it's parameters and the passing that to the #expr parser function. --Litzsch 13:48, 30 April 2018 (UTC)

var order

Items like Guardian Greaves icon Guardian Greaves have error with the cooldown. --Elite stay (talk) 12:17, 23 June 2019 (UTC)

I don't see any issue with the page. Can you describe further? -- Sanhard 17:48, 23 June 2019 (UTC)
I think that it's "-1". Medok 17:56, 23 June 2019 (UTC)
Yeah, that's caused by "Order of Evaluation" of template parameters when variables are being initialised. Should be resolved. -- Sanhard 13:21, 24 June 2019 (UTC)

Instant attack and instant kill under damagetype

Instant attack and instant kill should be addedas options under damagetype, together with magical/physical/pure.

There are a lot of spell that use instant attack, and quite a few instantly killing effects. Right now, we use physical for instant attacks, and hp removal for instant kill effects, which are both technically wrong (attacs can be magical and pure, too, and instant kill is not the same as hp removal). As for colors, maybe green for instant attacks and purple for instant kills~~ Bu3ny (talk) 23:19, 24 August 2019 (UTC)

Could you add explanations in Damage types so that the links work when added to the template? Thanks -- Sanhard 08:07, 25 August 2019 (UTC)
Link instant attack to Attack damage#Instant attacks, and instant death to Damage types#Instant kill. ~~ Bu3ny (talk) 10:52, 25 August 2019 (UTC)

span nowrap on cooldown and mana

Currently, the code is like this. (That #32 spaces fall apart in order to show code.)

<div style="display:inline-block; margin:8px 0px 0px 50px; width:{{#if:{{{mana|}}}{{{mana tal|}}}{{{mana aghs|}}}{{{mana shard|}}}{{{currentmana|}}}{{{maxmana|}}}|190px|370px}}; vertical-align:top;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}{{{cooldown aghs|}}}{{{cooldown shard|}}}
	|<span style="position:relative; top:-2px;">{{Symbol|cooldown|alt=Cooldown:|size=20px}} </span>{{#if:{{{cooldown|}}}
		|{{#dplreplace:{{{cooldown}}}|#(?<!<)/#|/<wbr>}}
	}}{{#if:{{{cooldown tal|}}}
		|& #32;<span style="white-space:nowrap;">{{#if:{{{cooldown|}}}
			|(
		}}{{#var:taltext}}{{{cooldown tal}}}</span>{{#if:{{{cooldown|}}}
			|)
		}}</span>
	}}{{#if:{{{cooldown aghs|}}}{{{cooldown shard|}}}
		|& #32;<span style="white-space:nowrap;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
			|(
		}}{{#if:{{{cooldown aghs|}}}
			|{{#var:aghstext}}{{{cooldown aghs}}}</span>{{#if:{{{cooldown aghs tal|}}}
				|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|,& #32;
					|& #32;(
				}}<span style="white-space:nowrap;">{{#var:aghstaltext}}{{{cooldown aghs tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|
					|)
				}}
			}}
			|{{#var:shardtext}}{{{cooldown shard}}}</span>{{#if:{{{cooldown shard tal|}}}
				|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|,& #32;
					|& #32;(
				}}<span style="white-space:nowrap;">{{#var:shardtaltext}}{{{cooldown shard tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|
					|)
				}}
			}}
		}}{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
			|)
		}}</span>
	}}
}}</div><!--

The aghs tal text (

{{#var:aghstaltext}}{{{cooldown aghs tal}}}

) and shard tal text (

{{#var:shardtaltext}}{{{cooldown shard tal}}}

) are useless, because there is a nowrap span outside of them (

<span style="white-space:nowrap;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}

). If you want to break them, nowrap span should be contained only the symbol and value, which is like this.

<div style="display:inline-block; margin:8px 0px 0px 50px; width:{{#if:{{{mana|}}}{{{mana tal|}}}{{{mana aghs|}}}{{{mana shard|}}}{{{currentmana|}}}{{{maxmana|}}}|190px|370px}}; vertical-align:top;">{{#if:{{{cooldown|}}}{{{cooldown tal|}}}{{{cooldown aghs|}}}{{{cooldown shard|}}}
	|<span style="position:relative; top:-2px;">{{Symbol|cooldown|alt=Cooldown:|size=20px}} </span>{{#if:{{{cooldown|}}}
		|{{#dplreplace:{{{cooldown}}}|#(?<!<)/#|/<wbr>}}
	}}{{#if:{{{cooldown tal|}}}
		|& #32;{{#if:{{{cooldown|}}}
			|(
		}}<span style="white-space:nowrap;">{{#var:taltext}}{{{cooldown tal}}}</span>{{#if:{{{cooldown|}}}
			|)
		}}</span>
	}}{{#if:{{{cooldown aghs|}}}{{{cooldown shard|}}}
		|& #32;{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
			|(
		}}{{#if:{{{cooldown aghs|}}}
			|<span style="white-space:nowrap;">{{#var:aghstext}}{{{cooldown aghs}}}</span></span>{{#if:{{{cooldown aghs tal|}}}
				|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|,& #32;
					|& #32;(
				}}<span style="white-space:nowrap;">{{#var:aghstaltext}}{{{cooldown aghs tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|
					|)
				}}
			}}
			|<span style="white-space:nowrap;">{{#var:shardtext}}{{{cooldown shard}}}</span></span>{{#if:{{{cooldown shard tal|}}}
				|{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|,& #32;
					|& #32;(
				}}<span style="white-space:nowrap;">{{#var:shardtaltext}}{{{cooldown shard tal}}}</span></span>{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
					|
					|)
				}}
			}}
		}}{{#if:{{{cooldown|}}}{{{cooldown tal|}}}
			|)
		}}
	}}
}}</div><!--

Change it if you like. BTW, that is a rare case. --Elite stay (talk) 16:17, 25 February 2021 (UTC)