Jump to content

Gun tooltip info


ORMtnMan

Recommended Posts

Hey,

 

So I have my new reloading code working for the most part (the hard part of getting the tables to work is done) but now I need to figure out how to display the info on the hover-over tool tip.

 

Can someone point me in the direction of where that is handled in the vanilla game? I did some digging around and I couldn't find it.

Link to comment
Share on other sites

  • 8 months later...

I'm not sure if you still need this answered but I think I know. You need to add a few things, first of which is a folder path in your mod folder.

Create this folder path or add to what you have already: media/lua/shared/Translate/EN/Tooltip_EN.txt

Inside this folder and text file is a table called Tooltip_EN, this table lists all the tooltips. Normally it has a bunch of info from the vanilla game. Checking through a few mods that use this as well as what I am doing on my own mods, it seems you can define the table as usual and then name your tooltips in the table. For example:
 

Tooltip_EN = {

	MyModTooltip01	=	"This is where you type what you want to appear in the tooltip. I don't know if you can have line breaks as it is all on one line with no wordwrap. You can have spaces, symbols and commas as long as they are contained within quote marks.",

}

Then, you go to your item.txt file in media/scripts/ and in the item you add Tooltip = MyModToolTip01, where the name is what you named the tooltip in that translation file. I thought at first that it overwrites the Tooltip_EN that the base game uses but it doesn't seem that way as in a couple mods they just define what they need and my guess is that it possibly just adds it to the bottom of the list? 

This will get your tooltip info to display in the context menu as you build.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...