The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collapse area not working?
KeysOfMyMind Offline
Junior Member

Posts: 15
Threads: 1
Joined: Jan 2012
Reputation: 0
#1
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.)
03-23-2013, 01:37 PM
Find


Messages In This Thread
Collapse area not working? - by KeysOfMyMind - 03-23-2013, 01:37 PM
RE: Collapse area not working? - by Lizard - 03-23-2013, 01:57 PM
RE: Collapse area not working? - by KeysOfMyMind - 03-23-2013, 04:08 PM
RE: Collapse area not working? - by Lizard - 03-23-2013, 04:21 PM
RE: Collapse area not working? - by KeysOfMyMind - 03-23-2013, 05:11 PM
RE: Collapse area not working? - by Lizard - 03-23-2013, 05:28 PM
RE: Collapse area not working? - by KeysOfMyMind - 03-23-2013, 07:42 PM
RE: Collapse area not working? - by NaxEla - 03-24-2013, 08:24 AM
RE: Collapse area not working? - by Lizard - 03-23-2013, 11:48 PM
RE: Collapse area not working? - by KeysOfMyMind - 03-24-2013, 10:48 AM
RE: Collapse area not working? - by KeysOfMyMind - 03-24-2013, 03:48 PM
RE: Collapse area not working? - by KeysOfMyMind - 03-24-2013, 05:03 PM



Users browsing this thread: 4 Guest(s)