Yes, there is a problem with using s1() when there are multiple objects that match the same noun in the same room.
s1() will only give you an unambiguous object id, and currently I haven't added generic disambiguation into adventuron (disambiguation only works for get, drop, wear, remove, and a few other standard system commands).
I'll see if I can add a placeholder disambiguation command just for s1() prior to me larger rework of the pattern matcher (which will move it more in line with other "IF" systems).
NOTE : Not yet present in Adventuron
: disambiguate_s1 "beside|worn|notworn|carried|known";
: match "give _" { : disambiguate_s1 "notworn"; // Notworn = carried and not worn : if (is_present "oracle") {
: if (is_carried (s1()) ) {
: destroy;
: set_true "some_flag";
: print "The oracle accepts your gift. \"You may pass.\"";
: done;
}
} }
A later version of Adventuron will allow you to define proper grammatical rules, but this again is not yet implemented.
- TAKE <BESIDE>
- WEAR <NOTWORN>
- DRINK <PRESENT+ (LIQUID "You can't drink that")>
- PUT <CARRIED> IN <PRESENT+CONTAINER>
These patterns would be applied prior to match commands, and simple be used to have Adventuron disambiguate before reaching the matching stage.