How do I stop printing (with a ...) after a command?

Hi there. Is it possible to prevent the program from giving “hints”.

Using the example from the documentation related to shooting something.

If I shoot at something, but don’t have the rifle, the game prints the following:

shoot book

(with the rifle)

You are pathetically unarmed!

Which would be fine if the player had the rifle, but when they don’t it’s a hint.

I’ve just used shooting as an example of the issue.

You could look at the “clarifying the parser’s choice of something” activity (see WWI 18.30 Clarifying the parser’s choice of something), but that’s about affecting the type of output that occurs when the parser makes a guess at the meaning, not about stopping its guessing attempts.

Since you remarked that you don’t want those notifications to act as hints, you might also want to look at the way that your various Understand lines are written (see WWI 17.1 Understand and also 17.4 Standard tokens of grammar). If you wrote, for example:

Understand "shoot [thing] with [gun]" as shooting it with.

and that’s the only Understand line for the action, then the parser can only match the gun (if it’s a single named thing) or a random available gun (if there’s a gun kind) in that second slot, so it does that automatically if there is just one gun available. Broadening the definition to:

Understand "shoot [something] with [held thing]" as shooting it with.

means that the parser won’t automatically guess the gun in response to >SHOOT BOOK, but it will still try to guess (sometimes with nonsensical results) if there is only one other object that fits the slot (e.g. the player only carries a spoon). With the broader definition in place, you can try to direct those guesses via the “does the player mean” (DTPM) rules (see WWI 17.19 Does the player mean…), as in:

Does the player mean shooting something with a gun: it is likely.

which will cause the parser to prioritize a guess of the/a gun if present, but otherwise fall back on asking the player (if there are multiple items that could fit the slot) or guessing (if there is only a single fitting item).

You might also want to look at definitions (see WWI 6.5 Defining adjectives for values), as these can be made to work fruitfully in combination with the Understand lines and/or definitions. For example:

Definition: A thing is targetable if the player can see it and the player does not enclose it.

Shooting it with is an action applying to one visible thing and one thing. Understand "shoot [targetable thing] with [held gun]" as shooting it with.

constrains the parser’s choice to things that more or less make sense for the action but isn’t perfect because it may also cause parsing failure when nothing can fit one of the slots (which makes for a very inexplicable-seeming “You can’t see any such thing.” message for the player). So the last place to look would be in the Check rules (see WWI 12.9 Check, carry out, report), which can intercept nonsensical actions generated by the parser.

My best attempt putting it all together is:

(Example Scenario)
"Rifle Test"

Place is a room. Other Place is east of Place.

A gun is a kind of thing.

A book is in Place.

The player carries a gun called a rifle. The player carries a spoon.

Definition: A thing is targetable if the player can see it and the player does not enclose it.

Shooting it with is an action applying to one visible thing and one thing.

Understand "shoot [targetable thing] with [something preferably held]" as shooting it with. [Here "preferably held" gives preference to held items, but it doesn't generate an implicit take -- not sure why. Perhaps because it's the second noun?]

Does the player mean shooting a targetable thing with a gun: it is likely.

Does the player mean shooting a targetable thing (called X) with X: it is unlikely.

Check shooting something with something that is not a gun:
    say "Don't be silly. [The second noun] [aren't] even loaded.";
    stop the action. [don't forget this part; otherwise the action will continue because check rulebooks don't default to failure]

Check shooting the player with a gun:
    say "I don't know about you, but I want to live.";
    stop the action.

 Report shooting it with:
    say "Bang!"

Test me with "shoot / drop spoon / shoot / book / go east / drop rifle / w / get spoon / shoot / go east / shoot / get rifle / w / drop spoon / e / shoot / drop all / shoot".

which seems to allow the parser to generally take the most reasonable (or at least the least unreasonable) guess and doesn’t unduly hint about the existence of a gun when it’s not present.

4 Likes

If you don’t want the parser to guess at the second noun for a particular action, you could create a separate action for when the player enters only one noun, and give a different response to that.

Lab is a room.

A rifle is a thing in Lab.
A target is a thing in Lab.

Shooting it with is an action applying to two things.
Understand "shoot [something] with [something]" as shooting it with.

Gunlessly shooting is an action applying to one thing.
Understand "shoot [something]" as gunlessly shooting.

Check gunlessly shooting:
	if the player does not carry the rifle, say "You are pathetically unarmed!" instead.
	
Carry out gunlessly shooting:
	try shooting the noun with the rifle instead.
2 Likes

Nice, @bg. This is a much better answer, in that it prevents the parser from ever trying to guess a second noun.

2 Likes

I’d suggest adding something like this.

Understand "Shoot [something]" as shooting it with.

Rule for supplying a missing second noun while shooting:
if the rifle is enclosed by the player begin;
now the second noun is the rifle;
say "(with [the second noun])[command clarification break]";
otherwise;
say "You are pathetically unarmed!" instead;
end if.

You can see this in action in this sample I put together a while back.

“Test”

Rule for supplying a missing noun while locking:
now the noun is the standard door;
say “([the noun])[command clarification break]”.

Rule for supplying a missing noun while unlocking:
now the noun is the standard door;
say “([the noun])[command clarification break]”.

Rule for supplying a missing second noun while locking:
now the second noun is the key;
say “(with [the second noun])[command clarification break]”.

Rule for supplying a missing second noun while unlocking:
now the second noun is the key;
say “(with [the second noun])[command clarification break]”.

Understand “Lock” and “Lock [something]” as locking it with.

Understand “Unlock” and “Unlock [something]” as unlocking it with.

The Testing Room is A Room. A key is in the testing room. The key unlocks the standard door.

The standard door is a locked door. The Standard Door is south of The Testing Room. The Other Room is south of The Standard Door.

Test me with “unlock / lock / unlock door / lock door / unlock door with key / lock door with key / unlock door with key / s”.

Hope this helps.

1 Like