(12-14-2010, 11:34 PM)Frontcannon Wrote: Add this in Collide_Area and activate 'Show Debug Messages' in the debug menu (F1):
AddDebugMessage("this should be a sound", false);
Hmmm, no debug messages appeared when I collided with the Area... I'm stumped.
Just in case it will help, I've posted my entire script below (don't worry, it isn't that long
).
//=========================================
void OnStart()
{
AddEntityCollideCallback("player", "Child_Cry_1", "Collide_Area", true, 1);
AddEntityCollideCallback("player", "slamdoorpianoplay", "Hallway_Collide", true, 1);
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
}
}
void Collide_Area(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("this should be a sound", false);
PlaySoundAtEntity("BabyCry", "scare_baby_cry5.ogg", "Child_Cry_Scare", 1.0f, false);
AddTimer("BabyCryStop", 4.0f, "BabyCry")
}
void BabyCry(string &in asTimer)
{
StopSound("BabyCry", 1.5f);
}
void Hallway_Collide(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("Door should start to close here, player looks at door", false);
StartPlayerLookAt("mansion_door_swing_close", 1.0f, 3.5f, "");
AddTimer("MansionDoorClose", 0.6f, "LookAtDoor");
}
void LookAtDoor(string &in asTimer)
{
AddDebugMessage("Door should close and lock, player should be shocked", false);
SetSwingDoorClosed("mansion_door_swing_close", true, true);
PlaySoundAtEntity("ShockBreathe", "react_breath1.ogg", "Player", 0.5f, false);
StopPlayerLookAt();
StopSound("ShockBreathe", 1.0f);
SetSwingDoorLocked("mansion_door_swing_close", true, false);
AddTimer("PianoPlay", 5.0f, "Ghost_Piano");
}
void Ghost_Piano(string &in asTimer)
{
AddDebugMessage("Play piano here, sanity damage", false);
PlaySoundAtEntity("PianoPlay1", "general_piano02.ogg", "Piano_Play_1", 2.0f, false);
GiveSanityDamage(20.0f, true);
StopSound("PianoPlay1", 4.0f);
}
//===========================================
void OnEnter()
{
}
//===========================================
void OnLeave()
{
}
Hopefully there is a problem with my formatting so I can fix it quickly
.