Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detection Upon Making a Sound?
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#1
Detection Upon Making a Sound?

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?

The Nightmares v1.0 - Dreadful Fires WIP
04-12-2012, 08:39 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#2
RE: Detection Upon Making a Sound?

Monsters are programed to do it already.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-12-2012, 08:41 PM
Website Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#3
RE: Detection Upon Making a Sound?

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 Nightmares v1.0 - Dreadful Fires WIP
(This post was last modified: 04-12-2012, 09:11 PM by Strembitsky.)
04-12-2012, 09:11 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Detection Upon Making a Sound?

The monster is designed to hear sounds at certain volume levels. This can be adjusted in the user defined variables.

Tutorials: From Noob to Pro
04-12-2012, 09:17 PM
Website Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#5
RE: Detection Upon Making a Sound?

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?

The Nightmares v1.0 - Dreadful Fires WIP
04-12-2012, 09:21 PM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#6
RE: Detection Upon Making a Sound?

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.

(This post was last modified: 04-12-2012, 09:46 PM by DRedshot.)
04-12-2012, 09:44 PM
Find




Users browsing this thread: 3 Guest(s)