intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Aug 17, 2018 10:29 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Aug 01, 2018 9:24 pm 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
I have an actor with various components defined (weapons, sensor, etc.) For example

Code:
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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Aug 01, 2018 9:53 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1007
Location: Greece
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:

Code:
modify WearAction {
    actionAllowsAll = nil;
}

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Aug 02, 2018 12:33 am 
Offline

Joined: Sat Jul 16, 2011 3:48 pm
Posts: 296
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);
    }
;


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group