Frictional Games Forum (read-only)

Full Version: Detection Upon Making a Sound?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to know how you could script something so that when the play throws something at a metal door, or jumps in water, or something similar that makes noise, the monster detects the player. Is this possible?
Monsters are programed to do it already.
The idea I have in my head though doesn't seem to work out in theory. I want him to be in a prison cell around a corner, and all you hear are the monster's breathing/default sounds. I then want the player to throw a box at the door, making a noise, causing the monster to reveal itself and run after the player.
The monster is designed to hear sounds at certain volume levels. This can be adjusted in the user defined variables.
Do you think in order to make it easier I can simply make it play the locked sound when the player interacts with the door, and then show the enemy the player's position?
You should just script it so that when the box or w/e is thrown at the door, it gives the grunt a pathnode to the player.

Do this by checking for a box - door collision with the EntityCollideCallback.

You can also add some scripts to check whether the box was thrown fast enough if you want. This will mean no matter how far away the monster is, you can be certain he will 'detect' the throw.
Quote:This can be adjusted in the user defined variables.
I usually only modify user_defined_variables when there is no simple way to do it in script. For example, I just modified the block_box entity to be made of metal, because there was no other easy solution I could think of in script.