![]() |
Detecting Sound
I have a couple of situations where being able to detect a sound being played, and it's position, would be very useful (ex: A baddy being able to "hear" a players foot steps).
I don't know if an event (onSoundPlayed or something) or another method would be best, but some way to do this would be nice. |
All I see is "sound" in the future improvements section, and I agree.
|
Can't you just check each player's gani instead?
Or if the sound is scripted and not in a gani, trigger your own event? |
Creating your own sound and loudness variables would be best prabably. That way you could totally script running and walking and creeping. Which would be useful if you have a baddy that detects sound.
|
Quote:
|
Couldn't something like this be a workaround? Maybe have distances for each baddy?
PHP Code:
|
Well, in terms of using it for detecting a player, that would force me to use a less efficient method of perception for the AIs sensory model.
Either way, event-based is always better than checking things in a loop. |
Quote:
|
Quote:
|
Quote:
|
Quote:
PHP Code:
|
I would suggest using a more 'approximate' method for checking distance that doesn't involve square root, but yeah.
I mean, all of this is very much a logical, acceptable way to do it. I just wouldn't consider it the best option. |
| All times are GMT +2. The time now is 06:45 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.