Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

I'm not sure why you want to disable silent gets and drops for generic objects (rather than specific special get handlers for particular objects), but this (should be) how you achieve that.

Now when you go to pick up an object, it will print the standard get and drop message, but that will also insert a press any key after the message is printed followed by a redescribe (assuming the object list changes):

: match "get _" {
   : get silent="false";
}
: match "drop _" {
   : drop silent="false";
}

The only way to not have a press any key when the object list changes in the auto redescribe mode is for the action to be silent, which is why get and drop are configured this way by default in auto.

There is a known issue (which we discussed earlier) that if the NAME of an object changes, rather than the set of objects listed, then an auto redescribe is not currently (automatically) triggered, but that's a bug (and I'll fix it soon), this one isn't a bug, it's a feature.

The question was how to refer to a generic noun. I know I've asked this many times before, but I've never got an answer. It must be possible, as you must do it in the default handlers.

Please let me know what you want to achieve with a specific example.

: match "give _" {
   : if (is_present "oracle") {
      : if (is_carried <noun1>) {
         : destroy <noun1>;
         : set_true "some_flag";
         : print "The oracle accepts your gift. \"You may pass.\"";
         : done;
      }
   }
}

Press F5 to update Adventuron then ...

// s1 () == subject1
// destroy (without an id), will destroy the item (move to the ether) of the item corresponding to s1()
: match "give _"  {
   : if (is_carried (s1())) {
      : print "GIFT ACCEPTED." ;
      : destroy;
      : set_true "is_has_given_oracle_something" ;
   }
}

I'll give it a try. In the meantime, I've discovered that the first method I used will work if the object id consists of a noun only. It fails if it consists of adjective_noun. That's why I was having trouble with it. Sometimes it worked and sometimes it didn't.

yes, s1() returns current subject object of, original noun () returns the noun. Most functions operate on object I'd, which allows advenruron to uniquely identify and object.

I think there's a problem. I continued using the old method and found that it was misbehaving if you have two identical objects with a numeric suffix, e.g. log_01 and log_02 with descriptions "log" and "log". So I updated Adventuron to Beta 22 (although I think the previous version was also Beta 22). I then replaced the old code with (s1()) and found that I had the same problem. It doesn't seem to be identifying them as unique. A test for is_beside (s1()) returns true for the first object, but returns false for the second object.

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.

Thanks for the update. I have a lot of "pairs" of objects, where they are initially single objects, then they magically merge into a plural object when they're together. I think I'll revise my puzzles so that the two single objects initially appear as plural objects and there's no need for disambiguation and no need for the merging (although this part was working really well). It will make those puzzles a bit easier and will make my code a lot simpler. Pity, as I'd already done all the work on that.

Incidentally, I just confirmed that you forgot to update the version number on the latest update. It should have been Beta 23.