The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Ambient Music/Sound Fix
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#1
Ambient Music/Sound Fix

So, why hello there dear Amnesia Community. Up ahead will probably be a somewhat long post for a probably not so huge problem. Though i want to be sure let you guys know what i'm doing and how i'm doing it.

So basically i'm using an ambient music technique where i have different script areas that play different types of music depending on the surrounding architecture. The code looks, in short, something likes this:

PHP Code: (Select All)
//AMBIENCE COLLIDE CALLBACKS
AddEntityCollideCallback("Player""AmbientScriptArea""AmbienceHandler"false0)

//HANDLER
void AmbienceHandler (string &in asParentstring &in asChildint alState) {
   if (
asChild == "AmbientScriptArea") {
      if (
alState == 1) {
         
PlaySoundAtEntity("Ambience01""amb_xx_xx.snt""Player"1.0ftrue) }
      if (
alState == 1) {
         
StopSound("Ambience01"1.0f) }
   }


With this method the ambient sound can easily be changed with different script areas. Though i ran into problems when it comes to shaped rooms that are not quadrangular. The way I've done it was that i just set one script area up so that it covers the blank areas (because the music would stop otherwise) and let it play the same sound/music again. I've put together a little picture to demonstrate it a little better.

The point marked with an X is the problem zone. If the player switches or passes this point the ambient music changes and starts over from the start again. It's either a whole other setup of code or i'm just being too fussy about this because it is easily overheard. Though i'd like to discuss it here and see if someone is willing to help me out here Smile. Thanks in advance.

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 02-05-2014, 06:11 PM by RaideX.)
02-05-2014, 06:08 PM
Find


Messages In This Thread
Ambient Music/Sound Fix - by RaideX - 02-05-2014, 06:08 PM
RE: Ambient Music/Sound Fix - by DreamScripters - 02-06-2014, 05:27 AM
RE: Ambient Music/Sound Fix - by RaideX - 02-06-2014, 07:38 AM
RE: Ambient Music/Sound Fix - by Daemian - 02-06-2014, 08:16 PM
RE: Ambient Music/Sound Fix - by RaideX - 02-06-2014, 09:45 PM
RE: Ambient Music/Sound Fix - by MyRedNeptune - 02-06-2014, 09:59 PM
RE: Ambient Music/Sound Fix - by RaideX - 02-07-2014, 01:41 PM



Users browsing this thread: 1 Guest(s)