Frictional Games Forum (read-only)
Door Smash - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Door Smash (/thread-16751.html)

Pages: 1 2


Door Smash - BrooksyFC - 07-05-2012

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?


RE: Door Smash - No Author - 07-05-2012

Like someone is pounding on the door ?


RE: Door Smash - BrooksyFC - 07-05-2012

Yeah exactly like that. Just hitting it 2 or 3 times, with dust coming off it as it's being hit.


RE: Door Smash - No Author - 07-05-2012

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);

}


RE: Door Smash - BrooksyFC - 07-05-2012

That's brilliant thanks! I'll give the code a try when I'm at my PC next.


RE: Door Smash - No Author - 07-05-2012

(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


RE: Door Smash - BrooksyFC - 07-07-2012

Right I've added all that and the script in the level, but still nothing happens


RE: Door Smash - No Author - 07-07-2012

(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 ?


RE: Door Smash - BrooksyFC - 07-07-2012

I've put the script in front of the door, but when I move through it, no script activates


RE: Door Smash - No Author - 07-07-2012

(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.