VERB vs. VERB OBJECT

Dear all,

I want the player to be able to use “HELP” to get access to the help menu and “HELP (Person)” to, well, help the person. I’ve implemented the latter, but how do I distinguish between two cases of using the same verb, once without and once with object?

Thanks and kind regards,
G.

This might get you started:

DefineSystemAction(Help)
  execAction() {
    "Help...\n";
  }
;

VerbRule(Help) 'help': HelpAction
  verbPhrase = 'help/helping'
;

DefineTAction(HelpSomeone)
;

VerbRule(HelpSomeone) 'help' singleDobj: HelpSomeoneAction
  verbPhrase = 'help/helping (whom)'
  askDobjResponseProd = singleNoun
;

alice: Actor 'Alice' 'Alice' @kitchen
  dobjFor(HelpSomeone) {
    action() {
      "Helping Alice.\n";
    }
  }
;
2 Likes

Works like a charm! Thanks!!

If I may ask a follow-up question - my help menu doh work. I did this:

DefineSystemAction(Help)
execAction(){
HelpMenu.showHelp();
}
;

HelpMenu: MenuItem ‘Help’;

  • MenuLongTopicItem ‘Test’
    ‘Test’
    ;

+MenuItem
title=“Help1”
heading=“Help2”
;

VerbRule(Help) ‘help’: HelpAction
verbPhrase = ‘help/helping’
;

Result for “help”: “Nothing obvious happens.”

What am I doing wrong?

I think you need to use HelpMenu.display() instead of showMenu().

2 Likes

That indeed works, thanks!!!

1 Like