if (player.maxvolume < 0) {
player.maxvolume = 0
}
if (GetBoolean (player, "immobilized")) {
if (HasString(player, "immobilizedmessage")) {
msg (player.immobilizedmessage)
}
else {
msg ("<br/>You cannot move! <br/>")
}
}
else if (player.maxvolume < ListCount(GetDirectChildren(player))) {
msg ("<br/>{random:You're carrying too much to move!:You're juggling too many items!:You cannot move, things are literally dropping out of your arms with every motion you make!} {once:You'll need to find a container or to drop some of your current items.} <br/>")
}
else if (exit.locked) {
msg (exit.lockmessage)
}
else if (HasScript(exit, "script")) {
do (exit, "script")
}
else {
if (exit.lookonly) {
msg ("You can't go there.")
}
else {
player.parent = exit.to
}
}
else if (player.maxvolume < ListCount(GetDirectChildren(player))) {
vol = 0
foreach (o, GetDirectChildren(player)) {
if (HasInt(o, "volume"))
vol = vol + o.volume
}
else {
vol = vol + 1
}
}
return (vol)
else if (player.maxvolume < CalcVolume())) {
I think if I was doing it I would create a function that adds up the volume carried, CalcVolume. Here is some code; it assumes a volume of 1 if there is none set for an object.
Only change player.maxvolume if the player picks up or puts down a bag.
else if (player.maxvolume < ListCount(GetDirectChildren(player))) {
Anonynn wrote:This would ordinarily be a great idea! But I have certain things like "clothing" and "keys" for example, that do not have volume, that way when the player wears something it doesn't count against their inventory capacity.
I have items with volume subtract from the total of the max carry, so that the player can just look at their description and see how much space they have left. Containers increase that max carry amount It actually works really good! It works like this....
Starting Player has a Max Carry Capacity of 3.
Player picks up clothing or a key. MCC still 3.
Player pick up item with "1" volume. MCC drops to 2.
Player drops that item with "1" volume. MCC increases to 3.
Player picks up "Container". MCC increases to 6
Starting Player has a Max Carry Capacity of 3. Carried volume is 0.
Player picks up clothing or a key. MCC still 3. Carried volume is 0, because they have a volume of 0.
Player pick up item with "1" volume. MCC still 3. Carried volume is now 1.
Player drops that item with "1" volume. MCC still 3. Carried volume is 0.
Player picks up "Container". MCC increases to 6.
vol = 0
foreach (o, GetDirectChildren(player)) {
vol = vol + o.volume
}
return (vol)
I was thinking of changing player.maxvolume to player.maxweight --- so nothing gets associated with the game's built-in volume. I dunno.