The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]Scripting problem with playing sound
Dobbydoo Offline
Member

Posts: 50
Threads: 6
Joined: Aug 2011
Reputation: 0
#1
[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 Sad
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.)
08-10-2011, 07:59 PM
Find


Messages In This Thread
[SOLVED]Scripting problem with playing sound - by Dobbydoo - 08-10-2011, 07:59 PM



Users browsing this thread: 1 Guest(s)