[Adventuron] Examining objects that are inside a container

I’m not sure if this used to work, or if I’ve only just noticed it, but…I can’t persuade Adventuron to retrieve an object description if the object is within a container. I’ve checked to see if the object is for some reason not present when in the container, but that’s not the case - it is present, but the object description isn’t returned. The same thing happens with the default examine handler and if I try and trigger examine directly from on_command. Am I overlooking something obvious here, or is it a bug? If I could use : examine with the subject (eg : examine (s1())) then perhaps I could persuade it to return the object description, but I can’t figure out the syntax or even if it is possible to do that. Of course, I could just put all my object descriptions in on_command, and reel them off as necessary but that seems like a clunky workaround. Any ideas?

start_at = my_location

locations {

   my_location : location "You are in a room." ;
   
}

objects {
   
   cupboard : scenery "a cupboard"container_type="bag" at = "my_location" ;
   banana : object "a banana" at = "my_location" msg = "it's a giant berry, often mistaken for a fruit." ;
}

on_command {
   
   : match "examine _"  {
      : if (is_present (s1())) {
      : print "the object is present, so examine message should  be returned here:" ;
          : examine;
         
     }
   }
   }

I noticed the same thing, but with GET. I’m sure something has changed, but I don’t know what it is. The thing that is really irritating is that it doesn’t seem to be consistent. Some contained objects are affected by this and some aren’t. It looks like you can always refer to the contained object after examining its parent object.

If you can provide some sample source code and sample inputs then I’ll look at it. Everything goes into the issue tracker along with the test, so functionality can be locked with sample source.

I’ve found that a contained object doesn’t exist / isn’t present until the container is looked at or opened for the first time (you can tell by the different ‘can’t do that / can’t see that’ messages that are returned depending on the state of the game), which is both a system oddity and a convincing modelling of quantum reality. My code (the series of workarounds detailed in the earlier post but more filigree now) works fine for GET but EXAMINE (as exemplified by the snippet above) has fallen off the map.

I’ve noticed that problem doesn’t occur in your Christmas game (things put in the foot locker are fine) so either you’ve put all your object descriptions elsewhere and are manually matching EXAMINE on everything or you complied with another version where this wasn’t broken?

The snippet above shows the issue (I’ve spent sixth months working on this game about putting different fruits in a mysterious cupboard…) and the response is either the object description (if it isn’t contained) or ‘You see nothing special’ if it is.

The snippet above does not seem to define a contained object.

Apologies if I’m misunderstanding, but in the snippet above, X the banana when it’s not in the cupboard = examine massage. Then PUT BANANA IN CUPBOARD and X it again = no examine message. That’s the problem I’m seeing. If there was a way to retrieve an examine message by subject (eg : examine (S1())) then I could manually workaround but I don’t know how to do that. It’s not game-breaking, just annoying that you might eg find a box containing a toy, X TOY = 'you see nothing special" then get it out and X again = ‘it’s a red train set’.

For what it’s worth, Chris asked me for some sample code. I used the code in ‘Santa’s Trainee Elf’ as a starting point. In this game, you can examine and get the candle on the mantelpiece without examining the mantelpiece first, but you can’t examine and get the wine bottle on the dining table unless you examine the dining table first. The mantelpiece and dining table are both supporters (or surfaces in Adventuron parlance) and their code is nearly identical.

I stripped it down to the bare bones. Once I’d done that, the problem disappeared. This suggests to me that there is something insidious going on that is possibly unrelated to the problems we are seeing. If I can identify the problem, I’ll send the sample code. In the meantime, I’m at a complete loss as to what it could be.

Ok, hopefully this can be chased down. Similar behaviour is exemplified by ‘minimal banana game’ above and manifests with containers (I’m not using any supporters). There are other random oddities (eg an issue with getting objects in some but not all containers = ‘you can’t see that anywhere’ but you can explicitly GET X OUT OF container and it works) which feel related but not to obfuscate the issue the EXAMINE problem is the one to concentrate on.

Please can you tell me the series of commands that you type and their expected results?

I raised the issue here : Examining objects that are inside a container · Issue #232 · ainslec/adventuron-issue-tracker · GitHub

Ok, so with this:

start_at = my_location

locations {

   my_location : location "You are in a room." ;
   
}

objects {
   
   cupboard : scenery "a cupboard"container_type="bag" at = "my_location" ;
   banana : object "a banana" at = "my_location" msg = "it's a giant berry, often mistaken for a fruit." ;
}

on_command {
   
   : match "examine _"  {
      : if (is_present (s1())) {
          : examine;
         
     }
   }
   }

X BANANA
it’s a giant berry, often mistaken for a fruit.

GET BANANA

You take the banana.

PUT BANANA IN CUPBOARD

You put the banana inside the cupboard.

X BANANA

You see nothing special.

Why isn’t the object message returned when the banana is in the cupboard? This behaviour happens with or without the examine handler in on_command. S1 is present but the description is irretrievable when it is contained.

Thanks.

Please try beta 66c,

I just tried this with Beta 66d. Examining objects in containers now works without needing to first examine the container, but getting the same objects still doesn’t work until their container has been examined.

Thanks Chris - that’s now fixed. And 66d seems to have decohered some of the other quantum oddities with objects in containers as well.

It works for me now.

I did have some related persistent problems until, in an effort to chase them down, I commented out my entire on_debug section and then a bunch of errors (misfiring system messages and things not puttable or gettable) resolved. There’s nothing in on_debug that would obviously be causing problems (it’s just a bunch of flags I’m setting) but the very presence of that debugging section seemed to upset Adventuron (poor thing).

My mistake - it works for some and not for others…

There is now a ‘try something else’ system message that is given sometimes that wasn’t there before and isn’t listed amongst the system messages in the block that I can edit. I’ll need to customise it - what is it called / how do I access it?

That was introduced today. To quote from the Telegram group:

“I’ve introduced a new system message called you_see_nothing_special_2. This message will be used when you examine a noun that does not relate to a known object, e.g. examine wibblewobble. “Nothing catches your eye”. There is also a policy in game_settings {}. on_examine_non_known_entity = you_see_nothing_special | you_see_nothing_special_2 | cant_see_one_of_those. By default it’s you_see_nothing_special_2.”

After some discussion, the message was changed to “Try something else.” Don’t ask me why. If you don’t like that, you can either change the policy or redefine the message in the system messages in your theme.

Got it thanks - I just needed to know what it was called as it’s not in my original list in the system messages block. I’m writing in third person so all my system messages need to be changed for tense.