I6: Thwarting all attempts to pick up an object

Suppose I have some object that will resist attempts to pick it up unless certain conditions are met – for instance, a water wiggle:

Object -> WaterWiggle "water wiggle"
        with name "water" "wiggle",
        description "It's a slippery and rubbery bundle of fun.",
        before [;
                if (self hasnt general) {
                        give self general;
                        "You try to pick up ", (the) self, " but it
                        slips out of your fingers.";
                print "Carefully, you pick up ", (the) self, ".^";

If you just try “TAKE WATER WIGGLE”, the take attempt fails the first time, then succeeds thereafter – correct behavior. However if I try “PUT WATER WIGGLE IN BOX”, the before property never runs and the water wiggle ends up in the box.

What am I doing wrong?

Try this:

before [; Take, Insert:In this case, it is best to deactivate implicite taking. Otherwise, Before will have to intercept: Insert, PutOn, Remove, Push, Throw, Eat, and many other.

In Inform 7, the rule is that any implicit take goes through a standard Take action. This is also true for the implicit taking in the 6/11 library (e.g., “eat [held]”). So a before:Take rule that blocks the action is always sufficient.

I recommend sticking to that rule in 6/12.

I’m not sure what I was doing wrong, but it’s working now. Probably a consequence of coding in the wee hours.