Pertex wrote:I found a way to do this with javascript. When callling the function JS.blockWindow, the complete screen is locked, with JS.unblockWindow it is unlocked again. This is working butI think this way could be a bit risky. When the unblock command does not work for any reason the player can't play any more
This worked quite well, thank you. Only problem was that the player could still input things into the command bar as long as they don't click anywhere else, but that's easily fixed by hiding the command bar with a request command.
jaynabonne wrote:I can think of two ways, one better than the other. (You decide!)
1) While trapped in the web, switch the game pov to something in an empty room, no inventory, and a cleared screen. Then switch back when freed.
2) Bring the command handler function into your game and add code (when a certain flag is set) to simply print out a message (e.g. "You can't do that right now."). Then you can control it by setting and clearing the flag.
(The third choice is: don't do what you're doing. I found it a bit disconcerting to have it tell me that "I" was trying to free myself when I could actually not do anything at all. I suppose it adds a bit of verisimilitude, but it was just a damn delay I had to endure. lol. A small bit of feedback.)
Number 1 might be a decent idea in some situations, but the only problem involved there is that if the player doesn't change rooms, there's the possibility that it'll redisplay the room description, which can be annoying.
Number 2 is also a good idea as well, though if I'd known how to access the command handler I'd have tried that.
And yes, in a situation like the spiderweb in my example it would be best to have some progress indicated so the player doesn't think their game froze. In this case, it's more of an example than a gameplay snippet though.