Thanks for the reply - I see I have shortened the example a bit too much - your post is what I started with and found it to become unmanageable. So … let me try to provide additional detail and thus clarify my initial question:
I am working with body positions - like lieing down, sitting, kneeling, standing. Depending on the position a person can reach things at a different height.
Let us assume we have a nightstand with 2 drawers and something on top.
The player - if he is lieing on the floor - could open bowth drawers, rummage through the content of the lower drawer but could not do so with the content of the upper drawer nor could he interact with an object on the nightstand.
If the player was kneeling or sitting, he could open, take and interact with anything in or on the nightstand.
If we had a 3 drawer wardrobe, however, he could open all three drawers, only access things in the lower and middle drawer and not interact with anything inside the top drawer or something on top of the wardrobe.
To have a quick means of checking I thought about 2 variables:
position of the player, reach of the player
position of the object
If the object was at a height within (player position - reach of the player ) to (player position + reach of the player) the player can interact with it (open, take, push, switch on, etc.) and if it was outside of that boundary he couldn’t.
So I wanted something like say the height of the upper drawer would be, say, 3 but the content in the drawer would be 4. And if the player placed something onto the wardrobe its height would be set to 4 as well. I might try to code that within the drop statements but if possible something like my failed definition in the example would be way easier to handle.
Since the player can drop things and put things into containers and there’s quite a bit of random placement involved as well I am looking for a numerical approach like I sketeched out in my example but which, alas, doesn’t compile.