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


Messages In This Thread
RE: Amnesia Script and Sound Questions - by NaxEla - 12-09-2012, 06:15 AM



Users browsing this thread: 1 Guest(s)