(04-10-2012, 01:12 PM)Apjjm Wrote: Can you upload your map with script file?
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MusicStart", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "MonsterAttack", true, 1);
AddEntityCollideCallback("Player", "door_slam", "DoorSlam", true, 1);
AddEntityCollideCallback("Player", "Light_area", "Lights", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "Lights1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scary1", true, 1);
SetEntityPlayerInteractCallback("ptest_cellar_wood01_1", "Bang1", true);
AddUseItemCallback("", "Key_3", "ptest_cellar_wood01_4", "KeyOnDoor2", true);
AddUseItemCallback("", "key_4", "ptest_cellar_wood01_3", "keyondoor4", true);
AddUseItemCallback("", "key_laboratory_1", "freedom_door", "keyondoor3", true);
AddUseItemCallback("", "The_gone_key", "Lockeddoor_1", "KeyOnDoor1", true);
}
void Scary1(string &in asParent, string &in asChild, int alState)
{
if(HasItem("The_gone_key"))
{
SetEntityActive("agrippa_headless_1", true);
PlaySoundAtEntity("", "alois_amb_idle.snt", "Player", 0, false);
}
}
void Lights1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("bridge_torch_2", true, true);
SetLampLit("bridge_torch_3", true, true);
PlaySoundAtEntity("", "Scary_sound.snt", "Player", 0, false);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_3", true, true);
SetLampLit("torch_static01_4", true, true);
}
void DoorSlam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "05_event_door_bang.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(15.0f, true);
}
void keyondoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("freedom_door", false, true);
PlaySoundAtEntity("", "unlock_door", "freedom_door", 0, false);
RemoveItem("key_laboratory_1");
}
void MonsterAttack(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("grunt", 5.0f, 2.0f, "");
SetEntityActive("grunt", true);
ShowEnemyPlayerPosition("grunt");
AddTimer("", 4.0f, "stoplookenemy1");
GivePlayerDamage(99.0f, "", true, false);
SetPlayerActive(false);
}
void stoplookatenemy1(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}
void keyondoor4(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ptest_cellar_wood01_3", false, true);
PlaySoundAtEntity("", "unlock_door", "ptest_cellar_wood01_3", 0, false);
RemoveItem("key_4");
}
void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Lockeddoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Lockeddoor_1", 0, false);
RemoveItem("The_gone_key");
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ptest_cellar_wood01_4", false, true);
PlaySoundAtEntity("", "unlock_door", "ptest_cellar_wood01_4", 0, false);
RemoveItem("Key_3");
}
void Bang1(string &in asEntity)
{
}
void MusicStart(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Ominous Noises - The Tortured Soul Scary Sound Effects.ogg", true, 0.8f, 1, 0, true);
}