Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

How do you do disambiguation with commands such as EXAMINE?

A topic by Garry Francis created Oct 12, 2019 Views: 74 Replies: 2
Viewing posts 1 to 2
Submitted

This one really has me baffled. The doco says that Adventuron does disambiguation if you have objects with identical nouns, but different adjectives and gives examples of how to define those objects. However, it fails to give examples of how to distinguish between those objects in on_command{} etc.

For example, let's say I have three bottles -  a clear bottle, a green bottle and a brown bottle. Can you please give an EXPLICIT example of how to define those objects and how to examine them. You can't use examine_message, as the message will vary depending on various factors such as bottle being empty, full, broken etc. I assume that the same principles can then be applied to other commands such as get, take, fill, empty, drink etc.

Submitted

I think I might have worked it out.

: match "examine bottle" {
   : if (adjective1_is "clear") {
      : print "It's clear.";
      : done;
   }
   : if (adjective1_is "green") {
      :print "It's green.";
      : done;
   }
   : if (adjective1_is "blue") {

      :print "It's blue.";
      : done;
   }
}

Does that look right?
Host

Disambiguation only works for system commands at the moment, and will be added for user handled commands "soon" (tm).

You are on the right path with your workaround code. I posted a fuller example in the document this very evening : https://adventuron.io/docs/tut/#DisambiguationUserCommands

I can't apologise enough for how over-complex this is. Just know it'll be pretty much automatic "soon" (tm) with no such workaround code required at all.