How to Disable All Player Input?

RakeVuril
This is something I've been trying to figure out since Pause() was removed in 5.5. Take the attached quest example. How would I made it so that once you get caught in the spider web, the game stops parsing any commands?
I can disable the command bar from showing up, but the player is still capable of moving between rooms using the compass and can still interact with objects in the room by clicking on either the panes or the hyperlinks. I could disable both the panes and the hyperlinks, but I'd like to know if there are any other quicker solutions, preferably without me having to put a condition on everything in the room and that the player could possibly have with them in that room.

Pertex
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


jaynabonne
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.)

Pertex
jaynabonne wrote:(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.)


Yes, but sometimes you would like to create a cutscene where the player must wait for a result . For example in my game there is a slot machine so when the player pulls the lever it should print something like that :
"The reels are spinning"
waiting 1 second
"The first reel stops and shows a cherry"
waiting 1 second
"The second reel stops and shows another cherry"
waiting 1 second
"The last reel stops and you see another cherry. YOU WIN"

or a telephone call:
"You dial a number"
waiting 1 second
"tuuut"
waiting 1 second
"tuuut"
"Come on, take the call"
....

So solution number 1) is not helpful

But 2) is a good idea. I think I will add this for the next version

jaynabonne
I understand what you're saying. I think I'd just prefer some sort of indication that something is going on (e.g. "." ".." "..." etc increasing) so I know it's not waiting on me. Otherwise the game just seems to go dead. But that's probably down to design. :)

Regardless, you do need some way to disable input. So I retract my 3.

RakeVuril
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.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums