forums | blogs | polls | tutorials | downloads | rules | help

Changing the tooltip color of an item

This item is from a mod I gave up on awhile back I dubbed "diablo flash back" . I figured out how to make a new color for the item's screen name. I used this incomplete soj for testing reasons.

in config\global_settings.gas I entered a new color in the tooltip_colors block I called crafting.

[tooltip_colors]
	{
		// All colors are in 0xaarrggbb ( alpha-red-green-blue ) format
		alter_stat_up	= 0xff00ffff;			// Cyan -- was 0xff6600ff;
		alter_stat_down = 0xff995422;			// Brown
		required		= 0xffff0000;			// Red
		nature_magic	= 0xff43ca83;			// Pale Green
		combat_magic	= 0xffeaa935;			// Orange
		magic			= 0xff6699ff;			// Medium Blue
		magic_var_2		= 0xff6699ff;			// Blue-r
		magic_var_3		= 0xff6699ff;			// Blue-est
		magic_var_4		= 0xff6699ff;			// Blue-est
		rare			= 0xff00ffff;			// Cyan
		unique			= 0xffcc66ff;			// Violet
		set				= 0xffffff00;			// Yellow
		enchantable		= 0xffc0c0c0;			// Silver
		enchanted		= 0xff00ff00;			// Green
		reagent			= 0xffebba55;			// ?
		// new colors Wyvante
		Crafting = 0xff6666CC

		

The file for SOJ I created is located in world\contentdb\templates\interactive\

// I was a d2 fan and modder!!! -Wyvern

//soj!!
[t:template,n:soj]
{
	doc = "Soj";
	specializes = ring;

	[common]
	{
		base_screen_name = "Ring";
		screen_name = "The Stone of Jordan";
		allow_modifiers = false;
		is_pcontent_allowed = false;
		rarity = unique;
	}
	[gui]
	{
		equip_requirements = uber:#item_level;
		use_class = IST_ALL;
		inventory_icon = b_gui_ig_i_it_ring_036;
 	 	item_level = 29;
 	 	tooltip_color = Crafting;
	}
	[magic]
	{
		[enchantments]
		{
			[*]
			{
				alteration			= alter_max_mana;
				value				= 20;
				description			= "+<value> Mana";
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
			[*]
			{
				alteration			= alter_max_mana;
				value				= 1.25;
				description			= "+25% Mana";
				duration			= #infinite;
				multiply_value 		= true;
				is_permanent		= true;
				is_single_instance	= false;
			}
		}
	}
}

In the gui block tooltip_color = Crafting; refers to the color entry I put in global_settings.gas . This is really cool, since you can add any color to as many items as you want. The problem I had was not being able to change the rest of the item's look as noticed in the screenshot the inv backround color is the same as regular uniques. This also holds true when soj is on the ground.

Aditional info on item:

alteration = alter_max_mana; calculates the max mana then adds mana based on percent.

When it comes to creating a custom rarity (specifically for DS2), I've figured out how to make it more efficient, but unfortunately the custom color only displays in the inventory.

// I was a d2 fan and modder!!! -Wyvern

//soj!!
[t:template,n:soj]
{
	doc = "Soj";
	specializes = ring;

	[common]
	{
		base_screen_name = "Ring";
		screen_name = "The Stone of Jordan";
		allow_modifiers = false;
		is_pcontent_allowed = false;
	}
	[gui]
	{
		equip_requirements = uber:#item_level;
		use_class = IST_ALL;
		inventory_icon = b_gui_ig_i_it_ring_036;
 	 	item_level = 29;
 	 	tooltip_color = Crafting;
	}
	[magic]
	{
		[enchantments]
		{
			[*]
			{
				alteration			= alter_max_mana;
				value				= 20;
				description			= "+ Mana";
				duration			= #infinite;
				is_permanent		= true;
				is_single_instance	= false;
			}
			[*]
			{
				alteration			= alter_max_mana;
				value				= 1.25;
				description			= "+25% Mana";
				duration			= #infinite;
				multiply_value 		= true;
				is_permanent		= true;
				is_single_instance	= false;
			}
		}
	}
}

Basically, you only need the tooltip_color under GUI to make the name became the new color. However, I've yet to figure out how to alter the name's color on the ground.

I have a theory it can be done through finding where the alteration effects are stored, but I've yet to figure out where that is.

Can't believe that was 13 years ago, lol. Yeah, I didn't figure it out back then. Custom inventory is pretty cool. Perhaps drops will be figured out.

Here's a little teaser Wink

That's pretty impressive Zebrina and I'm not easily impressed.

The question is, are you going to let us know how you did it?.
Smile

Sure, but it's a hack basically, a modification of the code at runtime. My goal is to make a program that will allow any modder to do this and more Smile

You can look at the source code once I commit my changes (and there are a lot of changes) if you're interested.

That's still a great programming achievement by you Zebrina even if it's just a hack as you call it, I know nothing about all that kind of stuff so its no use asking me to take a look at it, thanks for offering though. Smile

Zebrina wrote:

Sure, but it's a hack basically, a modification of the code at runtime. My goal is to make a program that will allow any modder to do this and more Smile

You can look at the source code once I commit my changes (and there are a lot of changes) if you're interested.

Very impressive. Can this be dynamic? For instance items don't update dynamically for stats. You have to reequip the soj I created above if your mana increases.

Moros wrote:

That's still a great programming achievement by you Zebrina even if it's just a hack as you call it, I know nothing about all that kind of stuff so its no use asking me to take a look at it, thanks for offering though. Smile


Thank you! I don't mean it as a negative, it's just an accurate description of what it is. Hacking is awesome (when it's not malicious!).

Dulac wrote:

Zebrina wrote:

Sure, but it's a hack basically, a modification of the code at runtime. My goal is to make a program that will allow any modder to do this and more Smile

You can look at the source code once I commit my changes (and there are a lot of changes) if you're interested.

Very impressive. Can this be dynamic? For instance items don't update dynamically for stats. You have to reequip the soj I created above if your mana increases.

I'm not exactly sure what you mean by dynamic. It's already dynamic in the sense that you can dynamically set the rarity of an item (go.common.SetRarity([NORMAL | RARE | UNIQUE | SET]). In fact that's how that specific item works right now as I have not yet managed to make the parser parse any custom rarity types.

Another thing I would like to add is the possibility of adding additional alteration types. I didn't know the 'multiply_value' property worked like that so that's definitely a reason to add proper life/mana percent alterations.