Automatic Tooltips

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
I'm building a system where tooltips are automatically created from the game data files (most of them are hand-written in every language in vanilla).

In the CiV code the capability to do this is provided and partially used, but for whatever reason just wasn't finished. I've included the progress on this in Combined v4 and recent versions of the beta. This is in large part thanks to alpaca's work figuring out how to retrieve many of the individual stats for buildings. I designed a way to take this and organize it in a table, created an algorithm to loop through the table, refined it further and you have what you see now.


attachment.php



Once this system is fully armed and operational:
  • Solves all current and future tooltip errors.
  • Greatly reduces time required to make mods. I know that personally about a fourth of my time's been spent creating and updating tooltips.
  • Automatically localizes mods for users of Español, Français, Deutsch, and other versions of Civ, once I get the core tooltip file translated. I've done some preliminary attempts to try and get basics in place for the first two languages, though I'm not a native speaker of either one so it's probably rather odd grammar. (If you might be able to help with that, please see the translations thread here.)

Currently this system is only active for buildings. I want to get all the bugs hammered out, then extend it to other object tooltips (mainly units and promotions), and release it as a stand-alone mod.

For modders out there, I'm attempting to design the internal workings of the code so it's easy to extend. If you wish to add stats (sql columns) to one of the game's tables and create an auto-tooltip for the new stat, you won't need to modify the core InfoTooltipInclude file at all or override it in your mod. There's two main components to do this. It relies on the LuaEvents "super global" designed to pass data between scripts:

  • A function to call for adding new stats to the tooltip table(s).
  • An event generator instructing all mods to proceed with calling this function.
Both of these can be found in the InfoTooltipInclude.lua file, currently in the Unofficial Patch sub-component of combined balance package. I'll put together more documentation on this once I've made more progress on the tooltip engine.
 

Attachments

  • Auto-tooltips.JPG
    Auto-tooltips.JPG
    93.6 KB · Views: 833
Do you mind if I copy your tooltip version back to PWM?

Big Ben and the Statue of Liberty are missing a description. And I think it's more accurate to say "consumes 1 coal" instead of "requires 1 coal"
 
That would be quite nice I imagine as it would display the tooltip during the Civ selection process as well?
 
That would be quite nice I imagine as it would display the tooltip during the Civ selection process as well?

No, it doesn't. Some parts of it need an active player instance, this isn't displayed for the same reason that the civilopedia isn't accessible outside of the game.
 
I originally used the "consumes" word, then changed it to "requires" for consistency with their existing system, though you're probably right. Even with the active player part it's still feasible to give basic info at the front, I think it was just a time/benefit situation where they focused on other things.

Go ahead and copy it back, a good chunk of it's your work. :)
 
Sorry to bump an old, old thread but it's relevant.

Though I like the tool tips I feel like some of the descriptions are still ambiguous, especially on things that may have been altered. Any listing I can reference for clarification? Or is there some kind of (visual) editor I could use just to view the building/wonder attributes?

Just wondering.
 
Back
Top Bottom