Collapse area not working?
So I have an area setup called push
And an area called collapsearea
I want collapsearea to be set to active when I collide with the area called push.
The push are will throw the player into the "collapsearea".
Once the player collides with this area it drains 60 percent of his health and drains all of his sanity normally making him collapse.
for some reason it doesn't work.
=======================================================
Specific scare talked about:
void OnStart()
{
AddEntityCollideCallback("Player", "Push", "Push", true, 1);
AddEntityCollideCallback("Player", "collapsearea", "collapsearea", true, 1);
}
void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Door_Slam", "react_pant.snt", "Push", 0, false);
SetEntityActive("collapsearea", false);
AddPlayerBodyForce(-8000000, 0, 0, false);
}
void collapsearea(string &in asParent, string &in asChild, int alState)
{
SetPlayerSanity(0);
SetPlayerHealth(45);
CreateParticleSystemAtEntity("doorbash", "ps_dust_impact.ps", "collapsearea", false);
PlaySoundAtEntity("", "scare_slam_door.snt", "collapsearea", 0, false);
}
=======================================================
Full script:
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "mansiondoor1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_2", "CollideAreaBreakDoor", true, 1);
AddEntityCollideCallback("Player", "Push", "Push", true, 1);
AddEntityCollideCallback("Player", "Door_Slam", "Slam", true, 1);
AddEntityCollideCallback("Player", "SlamStart", "SlamStart", true, 1);
AddEntityCollideCallback("Player", "BlowOpenEnd", "BlowOpenEnd", true, 1);
AddEntityCollideCallback("Player", "pianostop", "pianostop", true, 1);
AddEntityCollideCallback("Player", "collapsearea", "collapsearea", true, 1);
AddTimer("pianotimer", 0, "pianotimer");
}
void pianotimer(string &in asTimer)
{
PlaySoundAtEntity("piano", "general_piano03.snt", "piano", 0, false);
AddTimer("pianotimer", 18, "pianotimer");
}
void pianostop(string &in asParent, string &in asChild, int alState)
{
StopSound("piano", 0);
RemoveTimer("pianotimer");
AddPropImpulse("piano", 0, 0, 100, "world");
SetLeverStuckState("piano", -1, true);
PlaySoundAtEntity("piano", "break_wood.snt", "piano", 0, false);
CreateParticleSystemAtEntity("piano", "ps_dust_impact.ps", "impact", false);
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("mansiondoor1", false, true);
AddPropImpulse("mansiondoor1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("mansiondoor1", true);
SetSwingDoorClosed("mansiondoor1", false, false);
SetMoveObjectState("mansiondoor1", 1);
PlaySoundAtEntity("","break_wood_metal", "ScriptArea_Dust", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "ScriptArea_Dust", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}
void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Door_Slam", "react_pant.snt", "Push", 0, false);
SetEntityActive("collapsearea", false);
AddPlayerBodyForce(-8000000, 0, 0, false);
}
void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansiondoor13", true, true);
SetSwingDoorLocked("mansiondoor13", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("", "10_close_door.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("","break_wood.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("","sanity_flick.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("","scare_slam_door.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("","insanity_imageflash01.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("","insanity_muffled_steps.snt", "Door_Slam", 0, false);
PlaySoundAtEntity("","scare_slam_door.snt", "Door_Slam", 0, false);
}
void SlamStart(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansiondoorstart", true, true);
SetSwingDoorLocked("mansiondoorstart", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "SlamStart", 0, false);
PlaySoundAtEntity("", "10_close_door.snt", "SlamStart", 0, false);
PlaySoundAtEntity("","break_wood.snt", "SlamStart", 0, false);
PlaySoundAtEntity("","break_wood.snt", "SlamStart", 0, false);
PlaySoundAtEntity("","scare_slam_door.snt", "SlamStart", 0, false);
PlaySoundAtEntity("","scare_slam_door.snt", "SlamStart", 0, false);
}
void collapsearea(string &in asParent, string &in asChild, int alState)
{
SetPlayerSanity(0);
SetPlayerHealth(45);
CreateParticleSystemAtEntity("doorbash", "ps_dust_impact.ps", "collapsearea", false);
PlaySoundAtEntity("", "scare_slam_door.snt", "collapsearea", 0, false);
}
(This post was last modified: 03-23-2013, 01:39 PM by KeysOfMyMind.)
|