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
sound problems
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#13
RE: sound problems

^This.

The functions should be in onEnter(){
AddEntityCollideCallback("Player", "soundtrigger1", "soundtrigger1activate", true, 1);
Such as that.

Then in no category, you place the syntaxes with what you want it to do.
void soundtrigger1activate(string &in asParent, string &in asChild, int alState)
{
stuff that happens
for example:
PlayGuiSound("guardian_activated.snt", 1)
}

STUFF THATS WRONG:

Sound files need the ".snt" after the file you want to play. (Look in the actual folder to see if you have the right file.)
You have a function inside a function (void inside of a function), this isn't possible.

void OnStart()
{ ///STUFF TO ACTIVATE FUNCTIONS HERE
AddUseItemCallback( "", "DoorKey_1", "Door_3", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "doorslam_1","Collidedoorslam", true, -1);
AddEntityCollideCallback("Player", "Unlock_1","Room2Unlock", true, 1);
}

///THE ACTUAL FUNCTIONS GO HERE
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_3", false, true);
PlayGuiSound("unlock_door.snt", 1f);
RemoveItem("DoorKey_1");
}

void Collidedoorslam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Room_2", true, true);
PlayGuiSound("amb_hunt01.snt", 1f);
}

void Room2Unlock(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("Room_2", true, true);
PlayGuiSound("unlock_door.snt", 1f);
}
That would make the correct script. (There might be problems, just did this real quick.)
I just rearranged it real quick.
Also, PlayGuiSound is alot easier to use than PlaySoundAtEntity.
(This post was last modified: 12-02-2010, 04:15 PM by Akumasama.)
12-02-2010, 04:04 PM
Find


Messages In This Thread
sound problems - by THE/ILL/WILL - 12-01-2010, 07:44 PM
RE: sound problems - by Frontcannon - 12-01-2010, 07:56 PM
RE: sound problems - by THE/ILL/WILL - 12-01-2010, 08:22 PM
RE: sound problems - by LoneWolf - 12-01-2010, 08:27 PM
RE: sound problems - by THE/ILL/WILL - 12-01-2010, 08:34 PM
RE: sound problems - by Frontcannon - 12-01-2010, 08:47 PM
RE: sound problems - by THE/ILL/WILL - 12-01-2010, 08:58 PM
RE: sound problems - by Frontcannon - 12-01-2010, 09:13 PM
RE: sound problems - by THE/ILL/WILL - 12-01-2010, 10:01 PM
RE: sound problems - by Frontcannon - 12-01-2010, 10:07 PM
RE: sound problems - by THE/ILL/WILL - 12-02-2010, 03:02 AM
RE: sound problems - by Oscar House - 12-02-2010, 03:49 PM
RE: sound problems - by Akumasama - 12-02-2010, 04:04 PM



Users browsing this thread: 1 Guest(s)