HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating Tooltips using Object Editor Fields

01-13-2009, 12:41 PM#1
Kyrbi0
Create Tooltips using Object Editor Fields
  • I. Introduction
  • II. Huh?
  • III. Parts of the Code
  • IV. Uses and Advantages
  • V. Examples
  • VI. Credits

I. Introduction
Hey, this is my first Tutorial (I think...), but hopefully not my last. I just realized that I personally knew how these things worked, and it may or may not be common knowledge. I'd already written this up part-way for someone else, so it made sense to try and submit a tutorial. Meh, enjoy? :P


II. Huh?
What I'm talking about are those little codes inside the tooltips on all Blizzard abilities. You may have noticed them, they look something like this (using Aerial Shackles as an example):
Code:
<Amls,Dur1>
Put simply, these are like little codes that point to different parts of the Object Editor. Just like BBCode here at Wc3C and other sites, it uses a specific format; similar to opening and closing. Everything in between, if it matches the format, has some affect.


III. Parts of the Code
Here it is again:
Code:
<Amls,Dur1>
Basically, this contains the ability from which you are drawing information (first entry), and the entry of the field you want (second entry). This is separated by a comma (no space), and surrounded by those strange brackety-pointy things (carets?).

Click image for larger version

Name:	Pic1.JPG
Views:	433
Size:	93.4 KB
ID:	39707You may notice that you can't just find these strange "Amls" and "Dur1" things. However, it's quite easy:
Hold Ctrl and push D. (or go to the [View] -> [Display Values as Raw Data] in the Ability section of the Object Editor.) Every ability will now show some 4-letter code on the left-most window pane; that is the rawcode of that ability. Every ability has one, including custom abilities that you make. Using this as the first entry, you can tell Warcraft where you want it to go to look for information.
Now, still with all the values displayed as Raw Data, click on an ability (like, oh, say Aerial Shackles! :P). Instead of "Stats - Duration" or "Text - Tooltip - Normal", you will see stuff like "Dur1" and "Tip". This is the second entry which will tell Warcraft exactly what data to draw from the WE.
There are tons of others, like Cost1, Order, Area1, Name, which means you can feasibly make it bring up any bit of information.

**As an aside, the Raw Data code for abilities, similar to the ones for each field, actually have a naming paradigm; they follow a certain format.
- All start with "A", which stands for ability.
- Hero abilities use the second letter based on their race ("H" = Human, "U" = Undead, etc)
- Everything else is a shortened form of the spell (Aabs = Ability "Absorb Mana", AHfs = Ability Human Hero "Flamestrike", etc)



IV. Uses and Advantages
The reason you would do this (and why I suggest learning how to) is because you can effectively make tooltips write themselves. (It can be used in other places, of course; potentially all over the World Editor; but tooltips are it's most obvious use.)

By way of example: Say you made a custom ability, and lower a target enemy's armor by -3/-6/-9 (for three levels). If you write (in the tooltip): "Lowers enemy armor by -3/-6/-9" (for each level), then all is good.
Unless...
You later decide to change the armor-lost, for balance or whatever. Suddenly, you have to go back through each level and rewrite just that little number. Quite annoying, with 3 levels. Now imagine you're making an ability with 20+ levels.

This is similar to the "Auto-Fill" function; a great way to conserve time, made to ease the Object Editing process. In fact, using these works in tandem with the Auto-Fill feature of the Object Editor.
Effectively, you just "map" that part of the tooltip to that specific bit of information.


V. Examples
<ACam,Cost1> = 50 (neutral hostile Anti-magic Shell costs 50 mana)
<Amls,Dur1> = 40 (aerial shackles binds a target for 40 seconds)
<A000,Area3> = 280 (this is the Barrage custom ability on Rising_Dusk's Hero3 Submission.)
**Actually, if you'll note, since it was a custom ability, it doesn't have the nice format of the other abilities. It was the first custom ability made, so it's "A000" (those are all zeroes, not "O"s).

<AEev,DataA2,%>% = 20% (Lvl 2 Evasion gives a 20% chance to evade).
**This portrays the use of a ",%" between the 2nd entry and the bracket, which multiplies the 2nd entry by 100 (effectively making a percentage out of a value such as ".20"). The second "%" outside of the brackets simply adds on a percent sign after the modified 2nd entry, as you would expect.)

<Axxx,YYYY,.> = A Real value (i.e. 2.75) that will not automatically round into an Integer (i.e. 3). The period (".") between the 2nd entry and the bracket is what does it.


VI. Credits
YourJanissary (user on the Wc3:TFT board at GameFAQs)
~For spurring me to create this tutorial
Rising_Dusk
~For (unwittingly) letting me use his map as an example.
Wc3Campaigns
~A great site for Wc3 Modding!
Alexander244
~For adding a few Examples I missed~
Akolyt0r
~For adding his 2 bits~
01-14-2009, 05:25 AM#2
Kwah
Very, very convenient.

"Dynamic tooltips" suggest to me though, generating and changing the tooltips in game (an intensive feat).

So, can you base a skills tooltip off the values from another skill? It's something I've never tried before.
01-14-2009, 05:44 PM#3
Kyrbi0
Quote:
Originally Posted by hawk900
"Dynamic tooltips" suggest to me though, generating and changing the tooltips in game (an intensive feat).

So, can you base a skills tooltip off the values from another skill? It's something I've never tried before.
1. Yes, I ran into a wall when I tried to name the darn thing. I don't know what they're called (if they even have a real name), and the only thing I could think of was how they "dynamically" change what they display whenever you change it in the Object Editor (i.e., you don't have to change them yourself).

If you can think of something better, I'd be more than happy to have an Admin change it. (<- not a threat :P)

2. Potentially, sure. You could probably even use it to take values like the Name or Tooltip, and insert that into a tooltip.
Ironically, I didn't learn this before doing the bulk of my "custom race" work, so this whole time I've been doing exactly what these save you from doing; writing and re-writing and re-re-writing the tooltips for every edit. :P
01-14-2009, 06:47 PM#4
Alexander244
You should include <Axxx,YYYY,%> mutiplies a value by 100.
Also in some cases you need to use <Axxx,YYYY,.> to make a real value display as a real and not round to an integer.
01-14-2009, 07:00 PM#5
Kyrbi0
Huh. I didn't know that. Ok, thanks; I'll add it in (somewhere...).

--EDIT--
Alright, done. I couldn't think of a good example for the "no rounding-reals" example (Incinerate?), so meh. Thanks. :P

~~~

So what are the rules for this kind of things? I understand PitzerMike is busy; that's alright. Like, should I only bump every 48 hours (or was it 72?), if at all?
01-14-2009, 07:14 PM#6
akolyt0r
Damn, when i saw this Thread title on the recent posts list, i thought of something ....like ..changing tooltips at runtime ...which would be quite cool :)
still dunno if its possible ..i once played a map (was some footy dunno) which had buggy scrolling tooltips ...but it was more of a bug ......
random characters scrolling/moving trough the tooltips 0.o
01-14-2009, 07:17 PM#7
Kyrbi0
^Again, sorry. :P If anyone thinks of a more appropriate name, that'd work.
01-14-2009, 08:59 PM#8
akolyt0r
lil error here
examples:
Quote:
<Amls,Dur1> = 40 (aerial shackles binds a target for 30 seconds)

hmm... "How to create Tooltips using object editor data fields"..
or maybe "HOWTO: Use Object Editor Data Fields in Tooltips"

hmm kinda long and bulky xD, but at least correct, since those tooltips are pretty much not dynamic

You might also add that that <XXXX,YYYZ> stuff is not limited to the ability it refers to...you might also use those in tooltips of a hero for example...so you can see the data of his abilites before you choose him or something... maybe as example.
01-14-2009, 09:18 PM#9
Kyrbi0
1. Ah, thank you

2. Nah, that's too clunky. I'm looking for something elegant here.
And sure they're "dynamic". They change, by themselves. (I know that's not the strict definition... actually, I can't find a good definition on the interwebz. o_o)

3.
Quote:
Originally Posted by akolyt0r
You might also add that that <XXXX,YYYZ> stuff is not limited to the ability it refers to...you might also use those in tooltips of a hero for example...so you can see the data of his abilites before you choose him or something... maybe as example.
Quote:
Originally Posted by The Tutorial
(It can be used in other places, of course; potentially all over the World Editor; but tooltips are it's most obvious use.)
01-14-2009, 09:37 PM#10
akolyt0r
Quote:
Originally Posted by Kyrbi0
1. Ah, thank you

2. Nah, that's too clunky. I'm looking for something elegant here.
And sure they're "dynamic". They change, by themselves. (I know that's not the strict definition... actually, I can't find a good definition on the interwebz. o_o)

3.

hmm well ...didnt even read it completely ^^ ...i already know everything ...
but you could add bugs ...
the only one i can think of atm is:
the mindmg and maxdmg data fields dont work as intended for custom units.
If you use thos fields of custom units they will always show the values of the unit on which those custom units were based ...
01-14-2009, 09:43 PM#11
Kyrbi0
I don't of any bugs. If enough are found, I can add a section.

However, (in your example) it sounds like you used the wrong First entry. Whenever you make a custom anything, the Raw Data code for that "thing" looks like "A###: Axxx", where the last part (after the colon) is the "regular" Raw Data code of the unit you based it off of, and the "A###" is the actual Raw Data code of the custom "thing".
Also, it numbers in order of "first-created"; i.e., the first "thing" you make will be "A000", the second will be "A001", ad nauseum.
01-14-2009, 10:06 PM#12
akolyt0r
Quote:
Originally Posted by Kyrbi0
I don't of any bugs. If enough are found, I can add a section.

However, (in your example) it sounds like you used the wrong First entry. Whenever you make a custom anything, the Raw Data code for that "thing" looks like "A###: Axxx", where the last part (after the colon) is the "regular" Raw Data code of the unit you based it off of, and the "A###" is the actual Raw Data code of the custom "thing".
Also, it numbers in order of "first-created"; i.e., the first "thing" you make will be "A000", the second will be "A001", ad nauseum.
yeah...good but ..i usually give my new custom units funny rawcodes as '!!!!' lol xD
and ur wrong anyway ...its not always 'A###' thats only for abilities ...'B###' for buffs ...'h###' for human units, 'u###' for undeads and so on...



well i recently saw a thread on thehelper concerning this bug mom..
http://www.thehelper.net/forums/showthread.php?t=116883

PS: and im not that dumb, as you might believe, well most of the time at least :X
01-14-2009, 10:32 PM#13
Kyrbi0
Quote:
Originally Posted by akolyt0r
yeah...good but ..i usually give my new custom units funny rawcodes as '!!!!' lol xD
and ur wrong anyway ...its not always 'A###' thats only for abilities ...'B###' for buffs ...'h###' for human units, 'u###' for undeads and so on...



well i recently saw a thread on thehelper concerning this bug mom..
http://www.thehelper.net/forums/showthread.php?t=116883

PS: and im not that dumb, as you might believe, well most of the time at least :X
1. ... I'm not aware that you could choose the rawcode, but alright...
2. I didn't explicity say it was "always" 'A###'. Just transpose for whatever 'thing' you're looking at (buffs, units, etc). Seriously.
3. Huh.
4. Did I say you were dumb? I was just answering what could be a common problem.
Besides, what I was talking about is something I do all the time. I'm incredibly absentminded. I can only imagine I'd do something like that, too.
01-14-2009, 11:48 PM#14
Kwah
Automatic Tooltips?
Automated?
01-14-2009, 11:50 PM#15
Kyrbi0
Meh, that sounds nice. But "Dynamic" seems to draw people to it (mainly because they think it's something much more complicated :P).

If an Admin/Mod thinks it should change, then that's fine.