I want to have a rule in my game for a dog to give it a special rule to determine whether it can touch something or not. For example, in one room I have a piece of beef jerky (edible) on a supporter (the kitchen counter top). The dog should be able to see it but not take it. If the dog is on the same supporter as the food then it can touch it, otherwise it can’t. This way I can have a condition like
if the dog can see something edible (called the food) but the dog can't touch the food: say "The dog looks at [the food] wistfully."
But I can’t figure out the right way to write a rule. I already have a rule like
if the dog carries something edible (called the food):
try the dog eating the food;
else if the dog can see something edible (called the food):
if the dog can touch the food:
try the dog taking the food;
Which works great, except the dog will take any food in the same room as it. So it will take food of a kitchen counter for instance when it shouldn’t. The condition I want is for the dog to only be able to touch something if it is on the same supporter as the dog is on, like if there is food on a bed the dog will first jump onto a bed (supporters can be comfortable in my game, and dogs will only jump onto comfortable supporters. That works fine.)
I’ve tried things like:
To decide if (a dog - canine) can reach (a toy - thing): decide no; To decide if (a dog - canine) can touch (a toy - thing): decide no;
But neither of these get invoked at all, ever.