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
Questions about playing sounds
werckm Offline
Junior Member

Posts: 6
Threads: 1
Joined: Feb 2018
Reputation: 0
#1
Questions about playing sounds

Hello everyone,

I'm still at the beginner phase of learning to use HPL3, and recently, I stepped into some problems I couldn't find any solutions for.

Sound_CreateAtEntity vs. Sound_Play

Is it bad practice to use Sound_CreateAtEntity whenever I want to play a sound?
Take this code for example:

void SoundButton_OnPlayerInteract(const tString &in asEntity) {        
    if(!Button_IsSwitchedOn("SoundButton")) {
        Sound_CreateAtEntity("Sample", "lab/Lab/Sample", "SoundDoor", 0.0f, false, 1.0f);
    } else {
        Sound_Stop("Sample", 0.5);
    }
}

How does the engine behave in this situation? Are the sounds loaded during the loading screen? Or the engine has to look for the FMOD bank files and import the sounds from them every time Sound_CreateAtEntity is called? Is it possible to load a sound without attaching it to an entity, and then use other functions to attach and play (Sound_Play) it?

Disabling chase sounds

Is it possible to disable sounds played automatically by the engine (without removing them from the SOMA sound banks)? Or should I just call Music_StopAll every time an enemy gets alerted?

Thanks! Smile
02-24-2018, 04:03 PM
Find


Messages In This Thread
Questions about playing sounds - by werckm - 02-24-2018, 04:03 PM
RE: Questions about playing sounds - by werckm - 02-24-2018, 07:22 PM
RE: Questions about playing sounds - by werckm - 02-25-2018, 11:36 AM
RE: Questions about playing sounds - by werckm - 02-25-2018, 05:05 PM
RE: Questions about playing sounds - by werckm - 02-25-2018, 07:01 PM
RE: Questions about playing sounds - by werckm - 02-26-2018, 09:36 PM



Users browsing this thread: 1 Guest(s)