Frictional Games Forum (read-only)

Full Version: Door Smash
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey guys, I want to make a script where if the player walks towards this door, the door starts being smashed like when the monster smashes down the door, however I don't want any damage to the door. Just for it to be hit about 2 or 3 times.

Does anyone have any ideas?
Like someone is pounding on the door ?
Yeah exactly like that. Just hitting it 2 or 3 times, with dust coming off it as it's being hit.
Here's the script :
void OnStart()
{
AddEntityCollideCallback("Player", "AreaStartPoundingDoor", "StartPoundDoor", true, 1);
}
void StartPoundDoor(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("pound", "hit_wood", "AreaPoundDoorEffect", 0, false);
CreateParticleSystemAtEntity("pound_dust","ps_hit_wood","AreaPoundDoorEffect", false);
AddTimer("PoundLoop", 3, "TimerDoorPound");
}
void TimerDoorPound(string& asTimer)
{
PlaySoundAtEntity("pound", "hit_wood", "AreaPoundDoorEffect", 0, false);

CreateParticleSystemAtEntity("pound_dust","ps_hit_wood","AreaPoundDoorEffect", false);

}
That's brilliant thanks! I'll give the code a try when I'm at my PC next.
(07-05-2012, 11:28 AM)BrooksyFC Wrote: [ -> ]That's brilliant thanks! I'll give the code a try when I'm at my PC next.
Your welcome. Smile
Right I've added all that and the script in the level, but still nothing happens
(07-07-2012, 05:08 PM)BrooksyFC Wrote: [ -> ]Right I've added all that and the script in the level, but still nothing happens
The sound and the dust ?
I've put the script in front of the door, but when I move through it, no script activates
(07-07-2012, 05:21 PM)BrooksyFC Wrote: [ -> ]I've put the script in front of the door, but when I move through it, no script activates
I think I forgot to tell you that you need to make a script area(AreaPoundDoorEffect) on the door.

Oh yeah, you should put AddPropImpulse("YourDoorName", -2,0,0,"World"); in the void StartPoundDoor and in the void TimerDoorPound , to make the door move like it's been hit.
Pages: 1 2