I have a script that will unequip my character's backpack and drop it on the ground. With my character completely naked and with her backpack unequipped she is reported by the client in the status gump as having a weight of 10 stones. Does anyone know what the weight of a naked character is supposed to be?
I can tell you that the total weight of items in her backpack that is reported by my script plus my character's "naked" weight is more than what the status gump says she weighs with the backpack equipped. The gump says she should be able to carry 390 stone. The weight of the items in the backpack reported by my script is 352. Her weight is 10. The backpack weight is set to 1 in the itemdesc.cfg file. So the total combined weight (if my script is working properly) is 363 stone. However when I equip her backpack the status gump reports her weight as 260 stone and she cannot pick-up any more items. If the status gump is reporting her maximum weight accurately she should be able to add 130 more stone weight to her pack. The max weight capacity for the backpack is 800 stone so I know that isn't limiting things.
I'm sorry for the mixed topics here but I am getting bug reports about the weight issue and I'd really like to know if my script is working. In particular I was not sure if I needed to convert weights to reals. Some of our items do have fractional weights so I assumed so.
Code: Select all
use uo;
program textcmd_addupweight (me)
var num := 0;
var sum := 0;
var stuff := {};
SendSysMessage(me, "Target the container you wish to know the weight of.");
var it := Target(me);
if (!it)
return;
endif
if (!it.isa (POLCLASS_CONTAINER))
SendSysMessage(me,"That is not a container!");
return;
endif
sum := CDbl(sum);
stuff := EnumerateItemsInContainer(it,0);
foreach item in stuff
sum := sum + CDbl(item.weight);
endforeach
SendSysMessage(me, "The total weight of the items in that container is " + CStr(sum), 1, 66);
endprogram