Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia Script and Sound Questions
The Rock Worm Offline
Senior Member

Posts: 714
Threads: 83
Joined: Nov 2011
Reputation: 16
#1
Amnesia Script and Sound Questions

I'm nearing completion of The Dark Depths story. It will be a short one with two sequels. I've played with sequel possibilities on the forum, but I've finally thought up an official story line, one I hope you will not see coming. I just hope my first story will be scary despite being short.

I do have two questions that I'm not sure on the answer.

Question 1: How do I have a trigger box send you to the next map? Example: You start in Dumb1.map and enter the script box to send you to Dumb2.map.

Question 2: Is it possible to have a monster trigger a script box to play a sound? Example: You're in a wooden house, and a monster far away steps into the trigger, playing a wooden creak sound. As he steps closer to you, he 'plays' more sounds, each one louder because its script area is closer to you.

Now The Dark Depths mostly uses stuff available in Amnesia/Penumbra, but anything outside of the standard stuff I will give credit to the original creator(s). One example is http://www.frictionalgames.com/forum/thr...#pid186525 EntART3t and Hardarm have a cool SciFi interior design that I'm using for my current story and plan on using it in my future stories.

I hope to get an answer to my questions soon, not sure on a release date as my life can keep me busy, but know that The Dark Depths will be available to download soon.
12-09-2012, 05:11 AM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#2
RE: Amnesia Script and Sound Questions

(1) ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
Put this inside the function called by the "AddEntityCollideCallback". And change the names to protect the innocent.




(2) AddEntityCollideCallback("ImADoofus", string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

"ImADoofus" = Name of the monster in the editor, so he will trigger the Areas.
(This post was last modified: 12-09-2012, 05:33 AM by Rapture.)
12-09-2012, 05:32 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: Amnesia Script and Sound Questions

1. Make an area, then add a collide callback that will change the map when the player collides with the area. The script will look like this:

void OnStart()
{
AddEntityCollideCallback("Player", "AreaName", "ChangeMap", true, 1);
}

void ChangeMap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("Dumb2.map", "PlayerStartArea_1", "", "");
}


2. You can make multiple script areas, then the monster will collide with each area as he gets closer and play the sound at the area he collided with. The script will look like this:

void OnStart()
{
for(int i=1, i<=10; i++)
{
AddEntityCollideCallback("monster_name", "CreakArea_"+i, "PlayerCreakSound", true, 1);
}
}

void PlayCreakSound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("creak", "scare_wood_creak_mix.snt", asChild, 0.1f, false);
}

You can call the creak area names CreakArea_1, CreakArea_2, CreakArea_3, etc...
The 10 that I put in bold is the amount of script areas you have for the creaking.

Hope this can help Smile

In Ruins [WIP]
(This post was last modified: 12-09-2012, 06:16 AM by NaxEla.)
12-09-2012, 06:15 AM
Find
The Rock Worm Offline
Senior Member

Posts: 714
Threads: 83
Joined: Nov 2011
Reputation: 16
#4
RE: Amnesia Script and Sound Questions

(12-09-2012, 06:15 AM)NaxEla Wrote: 1. Make an area, then add a collide callback that will change the map when the player collides with the area. The script will look like this:

void OnStart()
{
AddEntityCollideCallback("Player", "AreaName", "ChangeMap", true, 1);
}

void ChangeMap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("Dumb2.map", "PlayerStartArea_1", "", "");
}


2. You can make multiple script areas, then the monster will collide with each area as he gets closer and play the sound at the area he collided with. The script will look like this:

void OnStart()
{
for(int i=1, i<=10; i++)
{
AddEntityCollideCallback("monster_name", "CreakArea_"+i, "PlayerCreakSound", true, 1);
}
}

void PlayCreakSound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("creak", "scare_wood_creak_mix.snt", asChild, 0.1f, false);
}

You can call the creak area names CreakArea_1, CreakArea_2, CreakArea_3, etc...
The 10 that I put in bold is the amount of script areas you have for the creaking.

Hope this can help Smile
Both look great and should work. I am currently free and trying to test the Sound Script, but wondering where do I place the coding?
12-13-2012, 11:21 PM
Find




Users browsing this thread: 2 Guest(s)