problem with scare script
I want to make it so that a door flings open and there is a man (corpse) standing on the other side, and then he suddenly disappears.
It gives me an error and terminates the program when I launch and I can't find the problem.
Here's my code:
(*note the code im talking about is CorpseDoorScare*)
////////////////////////////
// Run when starting map
void OnStart()
{
SetEntityPlayerInteractCallback("mansion_1", "GetCrowDoorQuest", true);
AddUseItemCallback("", "crowbar_1", "mansion_1", "CrowDoorBreak", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "LampScare", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "CorpseDoorScare", true, 1);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
void GetCrowDoorQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("", "crowdoorquest");
}
void CrowDoorBreak(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "break_wood_metal", asEntity, 0.0f, false);
PlaySoundAtEntity("", "impact_metal_high", asEntity, 0.0f, false);
SetPropHealth(asEntity, 0);
GiveSanityBoostSmall();
SetEntityActive("crowbar_broken_1", true);
RemoveItem(asItem);
SetMessage("GameMessage", "crow_door_message", 4);
}
void CompleteCrowDoor(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("", "crowdoorquest");
}
void LampScare(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("ScriptArea_2", 2, 3, "StopLook");
AddPropImpulse("arabic_carafe_3", 10, 0, 0, "world");
GiveSanityDamage(3, true);
SetPlayerActive(true);
}
void StopLook()
{
StopPlayerLookAt();
}
void CorpseDoorscare(string &in asParent, string &in asChild, int alState);
{
SetPlayerActive(false);
SetEntityActive("corpse_male_1", true);
AddPropImpulse("mansion_6", 20, 0, 0, "world");
StartPlayerLookAt("corpse_male_1", 2, 3, "StopLook2");
PlaySoundAtEntity("", "insanity_baby_cry_custom", asEntity, 0.0f, false);
PlaySoundAtEntity("", "insanity_imageflash01_custom", asEntity, 0.0f, false);
}
void StopLook2()
{
StopPlayerLookAt();
SetEntityActive("corpse_male_1", false);
SetPlayerActive(true);
}
FYI, the custom sounds are in a folder within my custom story that is labeled correctly, they work in other maps so I know that's not the problem.
(This post was last modified: 06-13-2013, 08:15 PM by zergling50.)
|