Disable the inventory in darkness?

Hi there! I’d like to be able to disable the inventory when the player is in darkness (location == thedark); the game begins with the player in the dark, and I’d like not to reveal the inventory until the light is on.

Whilst I can control the inventory listing for each object; how do I override the global inventory command?

Kind regards,
Kroc Camen.

1 Like

Something like this:

Check taking inventory:
     if the player is in darkness:
          say "It's too dark to see your possessions." instead.

I don’t have an Inform IDE open here, so this might not compile as-is, but I hope the idea is clear. :slight_smile:

Oops, you’re using Inform 6. Totally useless answer then.

That’s IF7, no? I’m using IF6 – I am posting in the right category, no?

1 Like

Yeah, sorry! Those categories are really easy to miss when you navigate from the “Latest” page (as I always do).

You can define InScope to choose exactly what’s in scope. Something like:

[ InScope person;
  if(person == player && location == thedark) {

On the other hand, if you just want to change so objects in the player’s inventory can still be referred to but are not listen in the inventory, you need to replace InvSub (defined in verblib.h).

That’s a great lead, thank you!

1 Like