Suppress 'all' with a single verb (Wear)

#1

I have an actor with various components defined (weapons, sensor, etc.) For example

robot: UntakeableActor 'harold/robot' 'harold' @opCenter "An intelligent robot named Harold. "; laser: Component 'bfl/laser' 'BFL' @robot "A gigawatt laser. "; holster: Wearable, Container 'holster' 'holster' @startRoom "A holster. ";
When I type take all, I get:

take all
holster:
Taken.

This makes perfect sense. However, this is wrong.

wear all
laser:
That isn’t something you can wear.

holster:
(first taking the holster)
Okay, you’re now wearing the holster.

I want to get rid of the laser reference. As components are added, this becomes unwieldy. How do I prevent this without using allVerbsAllowAll = nil?

Thanks

0 Likes

#2

If you look at the implementation of the default actions in the actions.t file, you’ll see that some of them set “actionAllowsAll = true” in order to always allow “all” even if allVerbsAllowAll is nil. By default, actionAllowsAll is set to follow allVerbsAllowAll (done in action.t.)

If you always want to disallow “all” for certain actions, then set “actionAllowsAll = nil” for those actions. For example:

modify WearAction {
    actionAllowsAll = nil;
}
0 Likes

#3

There is also mechanism for finer grained decision whatever to include object into “all” or not. This will hide one specific object from all for wear and doff actions only:

[code]+ Thing ‘some object’ ‘some object’
"Some object… "

hideFromAll(action)
{
    return action.ofKind(WearAction)
        || action.ofKind(DoffAction)
        || inherited(action);
}

;[/code]

0 Likes