How does boost_highlight_time work?

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

How does boost_highlight_time work?

Post 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...?
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: How does boost_highlight_time work?

Post 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...
Friends don't let friends eat worm round
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: How does boost_highlight_time work?

Post 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.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: How does boost_highlight_time work?

Post 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.
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: How does boost_highlight_time work?

Post by kaypy »

Have a look at base/xp.lua/perform_stat_increase(who, stat_num, value_up) for stat bumps with highlight
Friends don't let friends eat worm round
Post Reply