player's typed command

Continuing the discussion from let's play: Inform 10's Basic Inform and Standard Rules (SR: Activities 2):

It’s the lone issue I have with TADS. I’m not happy with, e.g.

On the low table you see a yellowed newspaper.

>get newspaper
Taken.

everyone knew that a certain WIP of mine has a Trinity-grade array of verb and noun synonyms, and the only solution is separating the verb synonym re-implementing it in separate verbs. (not an option in my WIP…)

Best regards from Italy,
dott. Piergiorgio

I might be missing something, and I’m curious now; what about that are you not happy with?

EDIT - Oh, maybe you were expecting the response to be

>get newspaper

(the yellowed newspaper)

Taken.

…instead? Is that it?

I think the issue is that sometimes you want to use the exact phrasing the player entered. For example, suppose that ‘destroy’ is a synonym for ‘break’. You might get a message like this:

>destroy door
You can’t break the door. 

When you want this:

>destroy door
You can’t destroy the door. 

In Adv3, you can do something like this to get the verb:

getVerb()
{
local verb = gAction.getEnteredVerbPhrase;
local i = verb.find(‘(’);
return verb.substr(1, i-2);
}

I don’t know if there’s an easy way of doing this for nouns. You can use gAction.getOrigText to get the whole command but then it’s up to you to determine which words refer to a particular object.

Oh, I see.

…can’t say I ever noticed that particuarly, which is interesting. If I notice it at all, it’s to notice how certain verbs seem to redirect to certain actions, which helps me better understand how the game is modelling interactions. But I can see where a designer wanting to go that extra mile would find it annoying.

My apologies for the lack of clarity; my issue is exactly as Alex correctly guessed.

(I’m still looking for ways to contain the italianisms (Italian being a mixed body-verbal language full of implicits, and where tone and choice of words matters…) without resorting to prolixity, which, combined with bad english, IS the main narrative issue I have)

Best regards from Italy,
dott. Piergiorgio.

It seems like you can get the entered text for nouns as well. The following should give the direct object:

getDobjText()
{
    if(!gAction || !gAction.dobjMatch)
        return nil;
    local text = '';
    for(local i = gAction.dobjMatch.firstTokenIndex; i <= gAction.dobjMatch.lastTokenIndex; i++)
    {
        text += gAction.tokenList[i][1];
        if(i < gAction.dobjMatch.lastTokenIndex)
            text += ' ';
    }
    return text;
}

It should also provide the indirect object by replacing ‘dobj’ with ‘iobj’. However, it doesn’t work perfectly for commands with multiple objects. ‘Take ball and bat’, for example, will return ‘ball and bat’.