Triggering Sounds & Sanity Damage?
So I'm progressing on my map well, but I want the player to walk through an archway, (not a door) and have it trigger a brute sound as well as give Daniel some sanity damage with effects.(screen stretch and boom noise) By the way, I don't want a monster to come out, I just want the player to hear the noise and get scared. (A monster hasn't been placed anywhere on my map.) I have been trying for a while now, fixing errors and such. The best I get is, when starting the map, the brute noise plays although I've put it in the archway and NOT in the player start area. -.- I put a script box there too. I also can't get my key to work on the other door. wtf.. here's my entire script. Fix any errors, please?
void onstart()
{
AddUseItemCallback("", "key_1", "mansion_1", "UsedKeyOnDoor", true);
}
void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_1");
}
void onenter()
{
AddEntityCollideCallback("Player", "monsterscare1", "CollideAreaTest01", true, 1);
}
void CollideAreaTest01(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "enabled.snt", "wall_door_way02_3", 6.0f, false);
GiveSanityDamage(30, true);
}
**(key_1 is the name I named my key. mansion_1 is the name of the door I want to use the key on. monsterscare1 is the name of the script area I put along with the sound. wall_door_way02_3 is the name of the archway I want to use as an entity to trigger the sound.)**
I can tell something isn't right.. anyone help me out here? Thanks.
P.S. Anyone know how to make a text thing appear when the player looks at something? Like, the player looks at a broken window and a message says on the screen: "I wonder what happened here.." kind of like thoughts?
P.S.S. Anyone know how to work the level doors too? Lol, I'm a newbie. I know you just make a new map and put the name of it under the door's entity tab where it says new map. Just don't know how to have the TextEntry appear..
Ba-da bing, ba-da boom.
(This post was last modified: 06-23-2011, 10:56 PM by JenniferOrange.)
|