You would then need to set the "mass" property for ever takable object to 1 and then the player would only be able to carry two things at a time. The advantage to this technique is that it doesn't really involve any extra code, just a few definitions.
For the issue with wearing things, there is a hook so that you can do some extra processing when the verb gets to the "override" statement in any the library code. For example, here is the code in "verbs.library" to handle wearing an object:
{+wear
if +not_held<noun1 = true
return
endif
if noun1 hasnt WEARABLE
write "You can't wear " noun1{the} .^
set time = false
return true
endif
if noun1 has WORN
write "You are already wearing " noun1{the} .^
set time = false
return true
endif
override
set player(quantity) + noun1(mass)
ensure noun1 has WORN
write "You put " noun1{the} " on.^"
}
You will see that the override statement comes at the point in the verb where everything is determined to have succeeded . You can find detailed information on this facility in 16.4 "Responding to the Player's Moves". The "override" feature is also described in the tutorial game. The basic idea is that you define a function that gets called at that point and it could do something like:
{wear_redshirt_override
if blueshirt has WORN
write "You are already wearing the blue shirt!^"
return
endif
return false
}
This will print a message if the player tries to wear the red shirt while already wearing the blue shirt or just continue as normal otherwise.
You could also do a more generic function that gets called no matter what object the player tries to wear like this:
{+default_wear
select WORN
write "But you are already wearing the " noun3{the} "^"
return
endselect
return false
}
The above (untested) code should only let one thing be worn at a time, but this of course might be a problem if you can wear a hat, glove, shirt and pants, just not two of any one thing. That could be done, but would take extra testing based on the class of the piece of clothing being worn.
Hope that helps!
Stuart