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
I can never get sounds to work correctly! help me!
tyranius Offline
Junior Member

Posts: 23
Threads: 6
Joined: May 2011
Reputation: 0
#1
I can never get sounds to work correctly! help me!

After a certain event happens I want to play a sound but it's not working at all. If I create a sound in the level editor it will play straight away even if I set it to not active, so I tried another approach and it's not working as well.

void OnStart()
{
SetEntityCallbackFunc("display_1", "MonsterAppear");
AddEntityCollideCallback("servant_grunt_1", "MonsterDisa", "MonsterGone", true, 1);
}

void MonsterAppear(string &in entity, string &in type)
{
GiveSanityDamage(30, true);
PlaySoundAtEntity("Sound_2", "react_scare4.ogg", "Player", 0.1f, false);
SetLightVisible("SpotLight_1", false);
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 2, "");
AddTimer("Timer1", 60, "MonsterGone");
}

void MonsterGone(string &in asTimer)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}

Please help!
05-12-2011, 07:52 PM
Find


Messages In This Thread
I can never get sounds to work correctly! help me! - by tyranius - 05-12-2011, 07:52 PM



Users browsing this thread: 1 Guest(s)