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
#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


Messages In This Thread
RE: Amnesia Script and Sound Questions - by The Rock Worm - 12-13-2012, 11:21 PM



Users browsing this thread: 1 Guest(s)