Help. I’m sure this has been answered before, but I can’t seem to be able to use neither the RB or this site’s search engine.
I have this:
[code]A Gem is a kind of thing. The printed name of a Gem is “*Gem”.
G1 is a Gem in Here. G2 is a Gem in There.[/code]
What happens is that if I try to drop one *Gem when holding two, disambiguation asks “Which one? *Gem or *Gem?” (ofc).
Same applies to when I take one when there’s 2.
I succeeded in solving part of the problem by adding:
[code]Does the player mean taking a random Gem not held by the player when taking a gem: it is very likely.
Does the player mean dropping a random Gem held by the player when dropping a Gem: it is very likely[/code]
But:
the disambiguation pops up when trying to take a Gem that I already hold (and same applies to dropping Gems I don’t hold)
one could actually perform every action in the game with the Gems, resulting in me coding 130.000 lines of disambiguation help.
I’m sure there is a simpler way. I’ve seen the Inform port for the classic Questprobes where you could get and drop *Gems on the fly.
Thanks for the help!
Ps: I’m trying to acquire the same exact result that in QP. So, no: I can’t name the Gems one by one. I just want the parser to decide for me and just drop gems I hold and take those I don’t. And examine, eat, push, pull, digest and send them to stratosphere.
this thing, that I was sure didn’t work at all:
Does the player mean doing something to a random visible Cylinder when doing something to a Cylinder: it is very likely.
works. But only SOMETIMES. Sometimes it doesn’t. Which goes against anything I was ever sure about computers.
I think it’s because you’re giving the gems distinct names in the code. Try this:
[code]A gem is a kind of thing. The printed name of a gem is “*Gem”. Rule for printing the plural name of a gem: say “*Gems”.
Test Room is a room. Best Room is north of Test Room.
Test Room contains a gem. Best Room contains a gem.
Test me with “get gem / n / drop gem / l / get gem / get gem / i”[/code]
Note, if you want plural gems to be printed with the asterisk, you have to write a rule for it (see code), otherwise Inform automatically constructs a plural based on the kind name (which has no asterisk).
Also, you have to say “[Room] contains a gem.” If you say “A gem is in [room],” Inform will kick back an error message, because it has no way of knowing whether you mean a new gem or an already existing gem.
The gem repository is a container. There are 20 gems in the gem repository. Definition: a gem is unowned if it is in the gem repository.
...
now a random unowned gem is in the Sanctum.