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
Adding a Sound Triggered by an Area
Samuelblitz Offline
Junior Member

Posts: 16
Threads: 4
Joined: Feb 2011
Reputation: 0
#1
Adding a Sound Triggered by an Area

Hello everyone, i'm pretty new to scripting / amnesia editing in general and there's one thing im confused about right now.

I have a fairly basic map set up right now with some basic scripts being used, and i realized i wanted to add some noises to my environment

So far i have tried these methods:

- Placing a "Sound" from within the level editor. (No matter how much i tweaked the sound's settings, i could never hear it in-game)

- Creating a script area in the level editor, and then scripting a collidecallback so that it would play a sound from a nearby entity.

This is what my script looked like:

void OnStart()
{
AddEntityCollideCallback("Player", "monsterscare1", "CollideAreaTest01", true, 1);

}

void CollideAreaTest01(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "enabled.snt", "sloped_square_shelf_1", 6.0f, false);

AddDebugMessage("Entered area!", false);

}


Thanks in advance to anyone that can help!
03-01-2011, 12:48 AM
Find


Messages In This Thread
Adding a Sound Triggered by an Area - by Samuelblitz - 03-01-2011, 12:48 AM
RE: Adding a Sound Triggered by an Area - by Nye - 03-02-2011, 09:45 PM



Users browsing this thread: 4 Guest(s)