I’m trying to implement a “screw to” action (as far as I can tell, the adv3lite library only includes “screw” and “screw with”), but I seem to be running into conflicts with the default “screw” action (i.e. the parser isn’t disambiguating correctly/providing the correct responses when the player doesn’t provide an indirect object). Instead of trying to patch fixes on top of this, I would really like to start from a blank slate and either remove the “screw” action entirely, or remove all of the verb rules associated with it to prevent the player from ever invoking it, but I can’t find any instructions on how to do that. Is there any way to achieve this?
You can remove the command vocab by doing this:
modify VerbRule(Screw)
''
:
;
modify VerbRule(ScrewWith)
''
:
;
You might want to do the same with Unscrew and UnscrewWirh.
aside that SCREWing something TO somewhat is basically an case of attachable, without entering in nuts and bolts wasn’t more simple a new verb akin to the HANG ON (the code seems similiar to what you seems to actually want…) in the Defining new Action chapter of the documentation ?
Bestr egards from Italy,
dott. Piergiorgio.
I am actually using attachable components already. But for some reason it seems like their default behavior is that you can “unscrew” them but then you have to “attach” rather than “screw” them back, which I was finding confusing when I was trying to test my own puzzle, so I can imagine would be even worse for a player.
(And I do want the verb “screw” to work specifically, because it’s something that has its own threads and would normally be screwed and unscrewed by hand.
Well, this works fine, except the disambiguation still doesn’t come into play because now it assumes you’ve misspelled “unscrew” instead. It’s still better than before, since the response is much less confusing, but I am nervous it would mislead a player into thinking “screw” isn’t a valid word at all. I’m not sure if this behavior is changeable just for this one case. If not, I might reimplement “screw” and put the disambiguation question there.
That’s why I suggested you might want to use the same technique to disable the vocab for Unscrew and UnscreWith .
I’m assuming there’s no way around it if I’m actually using the “unscrew” verb, though?
I’ve just run a quick test to see if there is another way round it, but I’ve failed to reproduce your original problem, so maybe I’ve misunderstood what it is.
Without disabling any of the original Screw/ScrewWith grammar I added this:
VerbRule(ScrewTo)
'screw' singleDobj 'to' singleIobj
: VerbProduction
action = FastenTo
verbPhrase = 'screw/screwing (what) (to what)'
missingQ = 'what do you want to screw (to it);'
+ 'what do you want to screw it to'
iobjReply = toSingleNoun
;
I appreciate you’ve created a ScrewTo action but for the purposes of tracking down the problem, I reckoned using the existing FastenTo should suffice.
I then got;
>screw white book to black book
That’s not something you can fasten.
>screw white book with black book
You can’t screw the white book.
>screw black book
You can’t screw the big black book.
>screw
What do you want to screw?
>black book
You can’t screw the big black book.
Which seems to be the correct behaviour.
Is the problem that you don’t get a disambiguation prompt if the player simply enters SCREW TO? If so, you’d get the same problem with SCREW WITH. If that’s what you’re trying to fix then reimplementing SCREW to put the disambiguation question there may indeed be the easiest way to deal with it, but it could then be tricky to handle commands of the form SCREW WHATEVER when WHATEVER is a valid noun.
But if you want is a disambiguation prompt after SCREW WHATEVER TO, then you should be able to get it by adding something like:
VerbRule(ScrewToVague)
'screw' singleDobj'to'
:VerbProduction
action = FastenTo
verbPhrase = 'screw/screwing (what) (to what)'
missingQ = 'what do you want to screw (to it);'
+ 'what do you want to screw it to'
iobjReply = toSingleNoun
priority = 20
missingRole = IndirectObject
;
The problem I was having was that if I just typed “screw x” (without specifying an indirect object at all), it would give the default response to the ‘screw’ command of “that can’t be screwed,” even if the thing could be screwed to something. Removing the ‘screw’ command and using your vague rule (but without the ‘to’ in it) seems to produce the behavior I want.