inventory management problem

Can anyone help me with this?

I’d like to have a condition in the game where you can’t take the fire axe off the wall without first transferring the contents of your inventory into a trunk and setting it aside, but I’d like the game to handle it automatically.

I’ve tried every variation of the following, but I’m not sure how to get the game how to transfer all the objects you’re holding to the trunk before setting it aside?

Before taking the fire axe while the player is carrying the trunk: say "Before lifting the fire-axe down off the wall, you shove the heavy steamer trunk in the back of the sedan."; move the contents of the players inventory to the trunk; move the trunk to the car; try taking the fire axe.

Thanks in advance for any help or suggestions with this.

I’m guessing you’re doing something like this.

[code]A thing is either packable or not packable. A thing is usually packable.

The Garage is a room.
The Car is a room. [?]
The fire axe is in the Garage.
The player is carrying the trunk. The trunk is a container.
The player is carrying a feather boa and a china plate. The china plate is not packable.

Instead of dropping the trunk: [ prevents player from dropping trunk, taking axe, and ruining your set-up - assumed the trunk begins held, or will be held when axe needs to be taken]
say “You can’t do that! All your worldly possessions are in it!”.

Before taking the fire axe while the player is carrying the trunk:
say “Before lifting the fire-axe down off the wall, you shove the heavy steamer trunk in the back of the sedan.”;
move the trunk to the car; [done first so there’s no edge cases with trying to put the trunk in the trunk]
repeat with N running through the list of things carried by the player: [won’t touch stuff worn by the player though]
if N is packable: [this would give you a little control in case you didn’t want everything put away]
now N is in the trunk;
[try taking the fire axe. - Redundant - you’re about to try taking it, so you don’t need to do it twice.][/code]

I think you can also say something like (untested) “Now the packable things carried by the player are in the trunk” but I like if loops because they’re easy to change, so that’s what I wrote.