Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command parser extension suggestions #85

Closed
Omikhleia opened this issue Aug 13, 2016 · 1 comment
Closed

Command parser extension suggestions #85

Omikhleia opened this issue Aug 13, 2016 · 1 comment

Comments

@Omikhleia
Copy link
Collaborator

Omikhleia commented Aug 13, 2016

Say we have several object going by the same name and same aliases, so no way for distinguishing them, e.g. let's clone a dozen of bottles of beer ;)
The look-up functions in world-object-class-builder.js will return ambiguous:

  • "this" verbs will not be invoked (= no matching verb on ambiguous, obviously)
  • Other invoked verbs with "any" will usually test against ambiguous in their dobj/iobj and display messages such as "I can't tell which bottle you meant."

Suggestion:
I'd eventually like to tackle with this issue by supporting qualifiers:

  • Some way to specify a qualifier indicating which item to check, e.g. (as seen on different MUD code bases) get 2.bottle or get bottle 2, specifying the index of the object (within the appropriate container)
  • An "all" qualifier, e.g. get all and get all bottle

The latter would likely require a "many" keyword for verbs, in that case expanding to an array of items.

"any" may have to remain anyway, since things such as unlock chest with all key might not be acceptable (depending on the game, so that's a user decision).

Or do you have any other idea in mind?

Omikhleia added a commit to Omikhleia/room.js that referenced this issue Aug 18, 2016
- For  the former, supports singularizers ('any', 'a', 'an' and ordinal rank). The 'all' globalizer is parsed, but currently object matching logic still returns 'ambiguous' as before.
- For the latter, working simplest hook solution at this stage, without much refactoring.
- DOC and DEMO updated accordingly
Omikhleia added a commit to Omikhleia/room.js that referenced this issue Aug 22, 2016
Omikhleia added a commit to Omikhleia/room.js that referenced this issue Sep 4, 2016
- For  the former, supports singularizers ('any', 'a', 'an' and ordinal rank). The 'all' globalizer is parsed, but currently object matching logic still returns 'ambiguous' as before.
- For the latter, working simplest hook solution at this stage, without much refactoring.
- DOC and DEMO updated accordingly
Omikhleia added a commit to Omikhleia/room.js that referenced this issue Sep 4, 2016
@doughsay
Copy link
Owner

doughsay commented Sep 4, 2016

I agree and you've implemented the first version of it, so closing this issue.

@doughsay doughsay closed this as completed Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants