Dobbydoo
Member
Posts: 50
Threads: 6
Joined: Aug 2011
Reputation:
0
[SOLVED]Scripting problem with playing sound
I want to make a sound play when I walk to a chair, but I get a strange error everytime I try. I don't know what I have done wrong and I've been trying to find a solution for hours
The error message I get is: main (13,1) : ERR : Unexpected token '{'
Here is my coding:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "Sound", true, 1);
}
void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "05_event_door_bang.snt", "Player", 0, false);
}
///////////////////////////////////////////////////////////////////////
{
AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("key_1", "OnPickup");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("key_1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster_grunt", true);
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("monster_grunt", "PathNodeArea_8", 0, "");
}
/////////////////////////////////////////////////////////////////////
(This post was last modified: 08-10-2011, 08:16 PM by Dobbydoo .)