Inventory weight glitch

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

Inventory weight glitch

Post by kaypy »

If you drop an item onto a characters stat-bars, then it does an auto-put-away and drops the item somewhere onto that characters inventory.
And if the character has a container in their inventory, then the item can wind up in that container.

But I've just noticed that if the latter occurs, then the character's carry weight isn't recalculated until something else triggers it.
Friends don't let friends eat worm round
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Inventory weight glitch

Post by Sophia »

This should be pretty easy to fix, although admittedly also not super high priority.
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: Inventory weight glitch

Post by kaypy »

Yep, not exactly game breaking 8-)

On a related note, is there any way to detect when a container gets an item added to it? I can do it fine in the subrenderer, but I couldn't find anything triggered by the aforementioned auto-put-away...

And similarly, is there a better way to detect closing a subrenderer than repeatedly sending a delayed message in one subrenderer frame and cancelling it in the next?

thanks
Friends don't let friends eat worm round
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Inventory weight glitch

Post by Sophia »

The load bug has been fixed.
kaypy wrote: Sat Dec 30, 2023 6:01 am On a related note, is there any way to detect when a container gets an item added to it? I can do it fine in the subrenderer, but I couldn't find anything triggered by the aforementioned auto-put-away...
You may or may not have been aware of inst_incoming, which is a member function that goes on a container arch and takes the id of any incoming inst. This already worked for subrenderers but I fixed it so that an auto-put-away triggered it as well.
kaypy wrote: Sat Dec 30, 2023 6:01 am And similarly, is there a better way to detect closing a subrenderer than repeatedly sending a delayed message in one subrenderer frame and cancelling it in the next?
Subrenderers don't maintain any state information; they render when the object is in hand or being looked at, and they don't when it isn't. It's good enough for DM so I don't really want to change it.

You might do better hooking into the underlying event that causes the subrenderer to stop being drawn: after_from_r_hand for something taken out of the right hand, and the newly added on_unlook when the eye stops looking.
kaypy
Artisan
Posts: 171
Joined: Sun Jan 19, 2014 7:11 am

Re: Inventory weight glitch

Post by kaypy »

Nice, thanks!

I was about to ask whether "newly added" meant on_unlook was in the currect or next version. Then I saw the 0.81 post 8-)
Friends don't let friends eat worm round
Post Reply