View Single Post
Old 07-10-2009, 07:00 PM   #1
Alpha Male of Wc3c
darkwulfv's Avatar

Official Map Reviewer
Join Date: Mar 2006
Posts: 3,646

Submissions (6)

darkwulfv is just really nice (270)darkwulfv is just really nice (270)

Send a message via AIM to darkwulfv
Default Displaying tooltips by hovering

This tutorial was inspired by my need for a hero selection set up. I want to thank Anitarf for introducing me to the idea, Here-b-Trollz for providing links on the subject, and Karukef for finding the original discovery.

This tutorial will teach you how to make displayable tooltips in-game simply by hovering over something. Does not use RtC or Trackables.

You'll need:

1 World editor, however you like it
1 MPQ Browser (I prefer MPQ Master)
1 Map. Obviously.
1 Notepad-like program (or Notepad)
1 Keyboard

MAJOR NOTE: As far as my tests show, you CANNOT use Vex's map optimizer at ALL with a map that uses this method. For some reason, even after disabling every tweak and optimization I could, the information in the .wts still didn't show in-game, even though it existed in the .wts. I've contacted Vex and hopefully we can figure this out.

Now let the fun begin!

STEP 1: The destructible
The first step is really simple. This method works by utilizing the Name box shown by destructibles in-game. Of course, the Name box only allows a small amount of text... in the Object editor.

So first, make a custom destructible. I based mine off of a barrel, though any will do I suppose.

Edit the following fields to match mine:

Text - Name : Testing the tutorial
Pathing - Is Walkable : True
Pathing - Pathing Texture : None
Editor - Show Helper Object for Selection : True (just for simplicity when moving it)
Art - Minimap - Show : False
Art - Model File : Invisible Platform <Base> (it's under destructibles)
Art - Shadow : None

Note: Hit Points MUST be >0 or the destructible won't show.

Good, now that's done. You can place one if you want. Doesn't matter right now.

STEP 2: The MPQ and .wts file
Note: If you can condense what you're saying to the confines of the Name box, you do NOT have to do steps 2 and 3.

Now, this whole method works off using the Name box of our destructible. However, in the Object editor you're only allowed like, 2 sentences worth of text. This MAY be enough for you if it's small (like a sign that says "Go left"), but if you're making tooltips like I was, you'll need more.

So, open up your MPQ Editor of choice and open up your map. Under the master directory (no folders or anything), scroll until you find "war3map.wts". Extract it or open it directly with Notepad.

Once open, scroll to the bottom (since it's the latest string you've made). You'll see something like this:

Originally Posted by .wts file
// Destructibles: B000 (Testing the tutorial), Name (Name)
Testing the tutorial
Obviously, "STRING 1800" and "B000" may be different, but that's what it will look like for the most part.

Now the easy part: See between the { and }? Just edit that to your desired tooltip. No need to use the |n line breaks, just make a new line as needed. You'll need color codes for color though (obviously).
Note: Break your line often so it fits into a neat paragraph (for things like descriptions), or else your tooltip will be really long (horizontally) and ugly.

Note: You will have to edit the .wts file every time you need to modify this tooltip, as it cannot be edited properly in the Object Editor. It'll show up (and the name will be the tooltip), but editing it will cause it to revert to its truncated form, and we don't want that.

Step 3: Back to the map
Note: You will need to have the World Editor closed when replacing the .wts file or else it won't be replaced, and nothing will happen.
Replace the .wts file in the MPQ with the new one with your modified tooltip using your MPQ browser, and then reopen your map in the WE.
IMPORTANT: You MUST save now, or else you'll lose all the work you did in the .wts file. Not good! Also, you may need to have your MPQ browser closed out in order for it to work properly. I'm not sure, but it may interfere with the saving process. Sorry you have to open and close these things 100 times :(

Step 4: The map
So, in order for these to look good, you'll need to place them where players will hover. For something like hero selection, you'll need dummy units with your hero models and locust, so they cannot be selected. Better yet would be special effects, but the method is up to you; as long as the unit cannot be selected in any way (as this will interfere with the player's ability to hover over the destructible).

It may take some tinkering, but move the destructible around (including increasing/decreasing its Z location by using Ctrl + Page Up/Down) until it looks smooth and pretty.
This is the result from my original testing. Works beautiful!

And now you're done!

*All I get is a tiny blank box!
Did the .wts file get imported properly? If you tried replacing it while the map was open in the World Editor/Warcraft 3, nothing will happen.
Also, if you didn't save at step 3 like instructed, it won't work + you'll lose the work you did. It pays to read and obey :P
*The tooltip is wrong!
See above.
*I can't seem to replace the .wts file...
Either the map was open in Wc3/the WE, or you may have to delete the old .wts file from the MPQ and add the new one in its place.
*After optimizing with Vex's map optimizer, all my tooltips are gone!
I went through this error too. To fix it, uncheck "Optimize String Usage". You'll lose some kb of compression, but the problem will be solved.
NOTE: Wrong. Vex's Optimizer makes this method unusable for some reason.

Alternate Ideas
These are just some ideas you can use to make this work better for you.

If you still want the heroes to be selectable, perhaps make the doodad use a model like the Question Mark, and tell users to hover over them for the tooltip, but make the heroes selectable for selection/a closer look. (Recommended method!)

You can use the ObjectMerger as well to take advantage of the Name box. Example of usage is below:
Collapse JASS:
//! textmacro MakeSign takes RAWCODE, TEXT
    //! external ObjectMerger w3b DTlv $RAWCODE$ bnam "$TEXT$" bfil "Doodads\LordaeronSummer\Props\SignPost\SignPost.mdl" bgpm "Doodads\LordaeronSummer\Props\SignPost\SignPost.mdl" bmas 1.5 bmis 1.5
//! endtextmacro
Where TEXT is, obviously, the name of the destructible (in this case, a sign). Thanks azlier for pointing out this alternative.
The Spell Request Thread
Originally Posted by Joe-Black-5
a dota like map but with unique stuff
(There was no map attached, and that was all the thread said.)
Spells I've Made

Darkwulfv's Lightning Grapple || Tritanis' Lazy Bolt

darkwulfv is offline   Reply With Quote
Sponsored Links - Login to hide this ad!