Page 1 of 1

Inventory weight glitch

Posted: Thu Dec 21, 2023 12:48 pm
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.

Re: Inventory weight glitch

Posted: Thu Dec 28, 2023 9:38 pm
by Sophia
This should be pretty easy to fix, although admittedly also not super high priority.

Re: Inventory weight glitch

Posted: Sat Dec 30, 2023 6:01 am
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

Re: Inventory weight glitch

Posted: Tue Jan 02, 2024 11:47 pm
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.

Re: Inventory weight glitch

Posted: Wed Jan 03, 2024 6:33 am
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-)