Skip to playerSkip to main contentSkip to footer
  • 6/2/2025
Are you tired of all tools using the same color scheme for the wear bar, do you wish you could use a single or twenty different colors in a custom wear bar? Well thanks to a new-ish feature you can define your own custom wear bar colors for your tools.

Download Luanti: https://www.luanti.org/downloads/

https://www.nathansalapat.com/luanti/wear-bar-color
https://nathansalapat.com/SocialMedia
https://nathansalapat.com/support-me
Transcript
00:00Welcome back to another Luanty modding tutorial. Today we are going to be looking at wear color for the wear bar on tools. I don't really know about a way of describing that, but this is a newer feature in Luanty as of, I don't know, I think 512, maybe it's only since 513, but I think it's 512.
00:22So, normal tools, well I shouldn't say normal tools, any tools, you get a wear bar, right? And by default you go from green to yellow to red. There's this little wear bar right down here.
00:36But, you can make them custom colors. So, I have, yeah, it's a tool that breaks dirt. It could break anything, it really doesn't matter. And you'll notice the wear bar is blue, but then it changes to yellow, and then green, and then red, and then, I don't know what it changed to there, to black, I guess.
01:03And then it breaks and disappears. Whereas, a normal tool, if you do not include pretty much just one table in the node registration, it just uses the default green to yellow to red.
01:15So, let's go ahead and take a look at how to do this. Very simple, actually. So, you're going to have your normal tool registration, and we're just going to add a wear color table to the node registration, or to the tool registration.
01:31So, we're going to have, firstly, the blend. So, this is how the color interpolates, I suppose. And your two options are either constant or linear. So, previously, I was using constant.
01:44So, pretty much, at each, whatever you want to call these, each of these points in the tool wear, it just makes an instant hard transition.
01:58Whereas, linear does a fade. So, your default tool wear bar uses a linear fade, where it goes from green to yellow to red.
02:08But, that's not what we were using here. So, I'm going to go ahead and give myself a new tool here.
02:18It's actually the same tool, but a new version of it.
02:23So, you'll see here, we're going kind of from a pink, and it's transitioning to a blue-ish color.
02:28And then, from the blue, I'm kind of changing colors of blue there.
02:35Oh, now it's going to yellow. Okay.
02:37To green.
02:39Now, going to red.
02:41And then, going to black.
02:44A lot of colors going on there.
02:48Probably more than you would really need or want.
02:51But, I just, I had to know.
02:54So, your normal one, you have three stops, which would be 0, 0.5, and 1.
03:02So, 0 would be when it's completely worn out.
03:07So, this is actually kind of set backwards, because it starts at the highest number and works its way down to the lowest.
03:12So, your default registration would be the lowest.
03:21So, 0 would be red, 0.5 would be yellow, and 1 would be green.
03:27Of course, if you just wanted to leave it at the default value, you wouldn't put any of this in.
03:32And, I did this because I was curious.
03:35I was like, well, how many of these can we do?
03:38And, it turns out, you can do as many as you want.
03:44I'm assuming.
03:45I didn't actually check.
03:46I only did what we have here.
03:49Now, it is worth noting that you don't just have to use the names of colors.
03:59Fuchsia?
04:00How do you spell fuchsia?
04:04Fuchsia?
04:04Is that fuchsia?
04:05I don't think that you spell fuchsia.
04:07Oh, boy.
04:09But, that's okay, because I'm just going to...
04:13Oh, well, thanks, but not really.
04:19I didn't realize it was going to do that on me.
04:22So, I think if we're going to use a hex value, I do need to start that with a pound sign.
04:31I should have really checked on this to make sure...
04:37Hmm.
04:39Okay.
04:40Well, I guess we still want that encapsulated within parentheses.
04:45So, let's give her another shot.
04:49I don't know what color that is.
04:51Well, I do.
04:51It's kind of a dark red color.
04:55Which maybe wasn't the best of colors to use.
04:59But, let's see if this becomes a darker...
05:01It is kind of going to a darker red.
05:04Yeah.
05:06So, it's going to get to this darker red, and then it's going to transition to blue.
05:09Yep.
05:09It definitely worked.
05:11That's pretty much it.
05:12That's really all you have to do.
05:14One quick thing to note, though.
05:19If you are using constant, your stops at 0 and 1 pretty much are never visible.
05:32So, this is a red.
05:33I'm going to change this to white, just because I have nothing that's close to white.
05:38So, you'll see pretty easily here.
05:41I'll give myself a new tool.
05:43So, the tool hasn't been used at all yet, right?
05:46So, it has no where bar.
05:47As soon as we dig one thing, a where bar appears.
05:50Now, at value 1, our where is white.
05:54But, because we're using the constant interpolation, the value is already below 1.
06:02So, it's using the 0.6 value.
06:05So, it's going to stay at this kind of dark red color here.
06:09Reddish-brownish.
06:10Until there, where we turn to the blue.
06:14And then, in like fashion, when we get down to the far end, we're going green.
06:21We have red, and then we have black.
06:23So, we're looking at red.
06:24We're looking at red, right?
06:25And now, there is a little goofy thing here where the where bar is all red, but the value is at 0.
06:35Sorry, the where bar is all black.
06:37So, I'm not really sure what the reason there is.
06:44So, like, we're at red.
06:47I guess I have to wait until it stops being red.
06:50Okay, so, it turned black.
06:55So, technically, we're at a level of 0.
06:58But, we can still break 1, 2, 3, 4, 5, 6, 7, 8.
07:05Eight more nodes that we could break with the tool before it actually disappeared.
07:08So, I'm not sure what the entirety of that system is.
07:13I'm assuming it's something with just tool caps and kind of the regular jank with how tools work.
07:20But, you could, theoretically, for funsies, set it to constant and put a stop in at every single, you know, you could probably even go down to fractionals here.
07:33So, let's change that to 0.15 and 2, 2, 3, 7.
07:39And, for no real reason, other than because I'm interested to see if it still works out these values.
07:47I would imagine it does.
07:51All right.
07:52So, we are going through.
07:55We're on red here.
07:57Just keep digging, keep digging.
08:00We have blue.
08:01Yellow should be at 0.37.
08:03Yep, okay.
08:03So, it's definitely, that would lead me to believe you could at least put 100 different colors into the levels.
08:12Now, I believe you can modify tools in such fashion that when they hit 0, they don't break.
08:20Because I think Technic uses a watering can and a lava can that you can fill.
08:25They may not technically be using the tool capabilities to register uses.
08:34But, I'm thinking things like that could be very useful where maybe you don't want, you don't want any color variation.
08:44I wonder how that works.
08:46Let's put this to 0.5.
08:47What if we just want a black bar for the entirety of the use?
08:54Because we're not really representing uses.
08:58So, we have a black bar.
09:01And, yeah.
09:06Setting it to black was kind of silly, though, because it's invisible.
09:10So, let's make it something visible.
09:12I'm thinking if you were using this to...
09:15There we go.
09:17Yeah, that makes a little more sense because you already have a black background on it.
09:20So, setting it to black is really useless because then you can't see at all what's going on.
09:25But, here you just, you get a level.
09:27It doesn't change color-wise.
09:30And, I do need to just verify.
09:36Okay, yeah.
09:36If you only have one value provided, it just uses that value the whole time.
09:40So, even though we're far above a 0.5 on our level here, it's still using the color of 0.5.
09:46So, you can set it up to just use two colors.
09:49Or, sorry.
09:49To just use one color if you want.
09:51Or two.
09:51Or 10.
09:52Or 20.
09:52Or 30.
09:52Or 50.
09:53Whatever you want to do, it appears as if you can do it.
09:58That's pretty much it.
10:00Wear color.
10:02For tools.
10:03Change the blend.
10:04Change how many stops.
10:06Change the colors of the stops.
10:07Any of the normal color specs you can use.
10:09You can use hex code.
10:10You can use color names.
10:12And, there's whatever the third system is that's like kind of a Luanty specific color spec.
10:20I don't know offhand what it is.
10:23I believe it's just hex with alpha included.
10:28But, I feel like alpha probably wouldn't work on a wear bar.
10:31I don't know.
10:32Mess around.
10:32See what happens.
10:34That's going to do it.
10:35That's really all there is.
10:37Thanks for watching.
10:38Tune in next week for another video.
10:39And, I'll see you then.

Recommended