RE: crowbar no effect when destroy door
Take a look at your TimerSwitchShovel Function.
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
PlaySoundAtEntity also requires an entity to be played at (this could also be a script area, or a normal entity). So what you need to do is this:
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "PUTENTITY NAME HERE", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
So, for example, whenever I use crowbars I have that sound played at the crowbar being used. So the code that I have for mine is:
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("", "puzzle_place_jar.snt", "crowbar_joint_1", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
Also, here is your code for the CollideAreaBreakDoor:
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);
}
Now, You do actually have an entity defined for the sounds and PS effects. Have you created a script area with the name AreaBreakEffect and put it somewhere like the doorhandle? If not, you should try that and see if it works.
|