Page 1 of 1
How does boost_highlight_time work?
Posted: Fri Jan 14, 2022 11:20 am
by Gambit37
In inventory_info.lua there's a property boost_highlight_time = 60, to affect how long a changed attributed is displayed. In my experiments at changing this number, it doesn't seem to have any effect, so I'm not sure it's actually working?
What does this actually do / how does this work? Does it affect the box around the eye, or the how long the boosted stat is displayed in red/green? Even after changing this number, the eye box and the stat only show in changed colours for as long as the condition is in place, at least that how it appears...?
Re: How does boost_highlight_time work?
Posted: Fri Jan 14, 2022 2:21 pm
by kaypy
It seems to work to me? I set it ridiculously short/long, spawned a character with no skills but a bunch of mana, and cast potions till they got a level up. I can have the level up greenbox either vanish near immediately or loiter for a minute or so.
How are you testing it? Note that this variable *only* affects level up notifications. Not eg buff potions...
Re: How does boost_highlight_time work?
Posted: Fri Jan 14, 2022 11:54 pm
by Gambit37
kaypy wrote: Fri Jan 14, 2022 2:21 pmHow are you testing it? Note that this variable *only* affects level up notifications. Not eg buff potions...
Oh! I see. I thought it also applied to attribute boosts, but if I set an attribute boost programmatically, this delay seems to be ignored. For example:
Code: Select all
for i=0,3 do
local char = dsb_ppos_char(i)
dsb_set_maxstat(char, STAT_WIS, dsb_get_stat(char, STAT_WIS) + (dsb_rand(1,3) * 10))
end
The boosted max stat means that the
current lower value is shown in red, but only until regen makes the current stat reach the max stat. I thought
boost_highlight_time would also show an increase to the maxstat for those 60 ticks, but clearly it doesn't work that way. It's a bit weird because I think when maxstats are increased, it should be more obvious what's happened. The red lower current unboosted value can be a bit misleading, and for low boosts of 1 or 2 points you might not even notice the boost before it's reached the max and is shown in grey.
Re: How does boost_highlight_time work?
Posted: Sat Jan 15, 2022 12:30 am
by Sophia
Yeah, it applies to leveling up only. Stats that are above/below their maximum are only shown in red or green until they're back to the normal maximum value.
It may not be the best approach but I should note that the stat being shown in red after an increase to the maximum value is also what DM does.
Re: How does boost_highlight_time work?
Posted: Sun Jan 16, 2022 6:23 am
by kaypy
Have a look at base/xp.lua/perform_stat_increase(who, stat_num, value_up) for stat bumps with highlight