• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

How dynamic exactly are tooltips and ingame text? (without sharpcraft)

Status
Not open for further replies.
Level 2
Joined
Jun 18, 2012
Messages
7
I am aware that wc3's tooltips are static in nature. However there are some values that can change ingame and still are dynamically displayed. For example:
- In the learn ability tooltip: the current level of the ability + 1 referenced via %d
- In the tooltip of an aura affecting a unit: the level of the aura ability, also referenced via %d
- many more examples from text specified in the game interface like displaying current lumber, gold, hero level etc.

In all the examples the values are referenced by a % followed by some letter. It is however unclear to me how exactly this works. One point of confusion is that the same symbol is used for different variables. For example:
- In the game interface under the field Text - Messages - "%s was defeated by %s." (raw data: Herokilledhero). Here %s is used both for the killed hero and the killing hero.

My guess is the following:
%s does not point to any specific variable but is just a placeholder in this specific text message. When displaying the message wc3 searches for the first occurence of %s in the string specified in the game interface and replaces it with a value specific to this message. (And analogously for the second.) Some other field might insert something else or nothing at all for a %s. So %s just stands for something like "this is some kind of placeholder for a unit".

This is supported by the following example:
- If used in a learn ability tooltip %d displays the current level of the ability + 1. However if it is used in the normal tooltip (that you see after learning the ability) it literally just displays "%d" and does not insert anything.

That the level of auras is displayed dynamically can be used for example to write a system with stackable buffs where the level of the aura is used to indicate the number of stacks.

So can anyone confirm or refute this? Does anyone know how and where exactly these % values work?
 
Level 2
Joined
Jun 18, 2012
Messages
7
Thanks for the reply. So i guess what the string looks for depends on which field it is affiliated with and there is no hope of making tool-tips (at least semi-)dynamic using this.
 
Status
Not open for further replies.
Top