Restricting commands

On the game I'm working on now, I want to display a "game over" message, but allow the user to undo if they'd like.

So, I created a "game over" room, with the "You are in" prefix changed to "I am", and the room alias "dead".

To stop the player messing about, I added a command in this room with the regex pattern ^(?!undo|restore|score|hint); this command simply prints a message "I can't do that, I'm dead!"

Thought someone else might find that useful.
So you can override all commands except specific ones in a certain room. (The regex ^(?!foo) will match everything except foo)

Very clever. I like it. Thanks.

Is there a way to attach a command like that to an object? As in: As long as the player is sitting on a chair he cannot interact with anything else in the room until he stands up?

edit nvm figured it out by randomly poking about.

Log in to post a reply.