Current Inventory Value

Forgewright
19 Oct 2015, 20:06
When a player picks something up, the volume of that item is added to what?
I made the volume of a piece of driftwood = 6 under the inventory tab for a (piece of driftwood). When I pick up the drift wood, where is the volume of 6 stored in the players attributes.

I am trying to script when the player wants to climb a tree that if he has anything in inventory (carrying in hands and not stored in a pouch) that his attempt will fail, with an explanation as to why. I figured the player would have some sort of current inventory volume attribute. So what do I check to see if player is carrying anything?
I guess I could check the currentobjectlist attribute on the player, but my feeble coding skills lack the necessary level. I want to use the default (take) script so I don't have to make my own player attribute and add to it every time I pick something up....Holy crap, I just thought of something. This sounds like a function being used here. Hold on and I'll check... Ok, (Command "take" + function "DoTake") = (Forgewright + confused). I understood some of it but it left me in the fetal position.


The player has a volume attribute, but this does not increase when the drift wood is picked up.
Any ideas?

The Pixie
19 Oct 2015, 20:24
The way to find this out is to think about when the attribute is important, and see it in use. In this case, the attribute is used in the GET command, which you can find if you do Filter - Show Library Elements. In fact the command is called TAKE, and in turn uses DoTake. Looking at the code, turns out the volume is calculated each time, using this code:
  volume = 0
foreach (obj, GetAllChildObjects(game.pov)) {
if (HasInt(obj, "volume")) {
volume = volume + obj.volume
}
}

Forgewright
20 Oct 2015, 00:33
I'm missing your meaning here Pixie. I found the Take and DoTake , when I take something doesn't Quest automatically add it's volume to the player's attribute somewhere. The code you show does not add the driftwood volume to the attribute volume of the player.