This is a little difficult to explain but I'm trying to figure out is whether or not it's even possible at this point since I've been struggling with it for quite awhile.
What I want is that the player needs to get an item from across the room, but they can't be heard by the other person who's in the room or it's game over. What I want is that the player needs to move when that person is humming which would be like 3 seconds of humming and the silence for a lil bit and then humming again and so on and so on, you get the item, get out the same way and it would be the end of that.
So it would be an easy pattern to follow and the player can only move when that humming is going otherwise they'll be discovered. I, for the life of me, cannot figure out how to do this but I'm hoping there are more expirienced people who could point me in the right direction. XD
This might be an ass-backwards way of doing it, but in your place, I would make the NPC in question a Parallel Process event. The event will have two pages; one for when the character is humming, and one for when they aren't.
The page for when the character is humming is much simpler. Have it start by playing the sound effect you have of them humming, then add a "Wait" below it that lasts for exactly the duration of the sound effect. Alternatively, you could play the sound effect, then have a "Wait", then have a "Stop SE" directly after that (found on page 2, just below "Play SE...") Either way, after the sound stops, you'll want a Switch that take you to page two of the event.
Page 2 is simple, but you'll need another event to make it work. On page 2, all you need is a "Wait" for however long you want the character to not be humming. At the end of that wait, turn off the Switch from page 1 to have him start humming again.
Create a third page set to activate when a second Switch is set to ON, with an Autorun event that handles your Game Over stuff.
Now for the complicated part. Make a separate event that is a Parallel Process that is only active while the Switch from the previous event is set to ON. This page should have a "Conditional Branch..." for when the player pushes a directional button (found on Page 4 of the "Conditional Branch...", the option "Button" --- "is Being Pressed"). Make one of these for each direction, and in each case, turn on that second Switch I mentioned before.
---
Unless I've forgotten something, that should be all. If you want to have the guy wait a random amount of time before starting whistling again, use this script in the place of the "Wait" on page 2 of the first event:
Wait(rand(n))
...where "n" is the maximum number of frames you want the game to wait. Please note that it's 60 frames to a second, so if you want him to wait up to five seconds, you'll need that number to be 300. Also, if you want him to wait at least one second before resuming whistling, do it like this:
Wait(rand(n) + 60)
...so that, for example, a wait of 1-5 seconds would be Wait(rand(240) + 60) .
I'm sure this all looks complicated, but in reality, it should only take about 5 minutes to do, if that.
What might make this easier, is to remember that Autonomous Movement 'Custom' in each event acts like a parallel process. Set up the move route (which can include the playing of an SE, turning switches ON and OFF) in there and it will run for ever if you check 'Repeat'. Or you could do it on 2 pages, one turning the switch ON and the other turning it OFF, with each page conditioned by whether that switch is on or off. I think that could be better than having several parallel processes going, as potentially you are introducing lag into the game.
That could work too. I suggested my way because it was simpler to explain and because it's really only two Parallel Process events, so I felt it wouldn't have that big an impact.