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
Script Help Activate sound when open door!
Bramme Offline
Junior Member

Posts: 13
Threads: 5
Joined: Jan 2012
Reputation: 0
#1
Activate sound when open door!

When i open my door i want the sound to be activated. But its not working its just silanceSad
This is my script and i dont know if i have done something wrongConfused

void OnStart()
{
AddUseItemCallback("", "keystudy_1", "Door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_study_1", "mansion_1", "KeyOnDoor2", true);
AddEntityCollideCallback("Player", "ScriptArea_2", "MonsterCloset", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "rustningbort", true, 1);
SetEntityPlayerInteractCallback("note_letter_2", "spawn_func", true);
SetEntityPlayerInteractCallback("mansion_3", "Doorgris", true);
SetEntityPlayerInteractCallback("Door_1", "Ljud", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_1", false, false);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, false);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
}

void MonsterCloset(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_nice_complete_1", true);
}
void rustningbort(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_nice_complete_1", false);
}
void spawn_func(string &in item)
{
SetEntityActive("servant_grunt_1", true);
}
void Doorgris(string &in item)
{
SetEntityActive("pig_corpse_2", true);
}
void Ljud(string &in item)
{
SetEntityActive("Sound_2", true);
}
void OnLeave()
{

}




//___________________
01-06-2012, 11:49 PM
Find
Krymtel Offline
Member

Posts: 105
Threads: 9
Joined: Oct 2011
Reputation: 3
#2
RE: Activate sound when open door!

Try typing "unlock_door.ogg" instead of just "unlock_door" for your PlaySoundAtEntitiy callback. Have you checked out the wiki for Amnesia mapping and scripting? Your script is a bit unorganized and maybe this can help.

Eidolon Total Conversion (WIP)
(This post was last modified: 01-07-2012, 12:40 AM by Krymtel.)
01-07-2012, 12:36 AM
Find




Users browsing this thread: 1 Guest(s)