RE: problem with scare script
I know it has been a while since I last made this post, I had to take a break from the custom story for a bit but I am back at it now. I still can't seem to get it to work and I have taken what you guys have said into consideration. Here is what my code is currently.
////////////////////////////
// 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);
}
It is giving the same error and aborting the game, I am unsure of the problem.
|