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
crowbar no effect when destroy door
Hartmann Offline
Member

Posts: 52
Threads: 18
Joined: Jun 2012
Reputation: 0
#1
crowbar no effect when destroy door

i made a script for a crowbar destroying a door. the door opens but no sound or breaking effecks will show please help!. and the door is still there when the crowbar is used. here is my whole hps


void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddUseItemCallback("", "crowbar_1", "castle_no_grav_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "Idle");
}

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("castle_no_grav_1", false, true);
AddPropImpulse("castle_no_grav_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("castle_no_grav_1", true);
SetSwingDoorClosed("castle_no_grav_1", false, false);
SetMoveObjectState("castle_no_grav_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

void OnEnter()
{
}


////////////////////////////
// Run when leaving map
void OnLeave()
{

}
(This post was last modified: 06-21-2012, 08:39 PM by Hartmann.)
06-21-2012, 08:34 PM
Find


Messages In This Thread
crowbar no effect when destroy door - by Hartmann - 06-21-2012, 08:34 PM



Users browsing this thread: 1 Guest(s)