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
Door Smash
BrooksyFC Offline
Senior Member

Posts: 329
Threads: 11
Joined: Jul 2011
Reputation: 6
#1
Door Smash

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?

Think A Little, Change A Lot
07-05-2012, 10:29 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#2
RE: Door Smash

Like someone is pounding on the door ?

[Image: the-cabin-in-the-woods-masked-people.jpg]
07-05-2012, 10:52 AM
Find
BrooksyFC Offline
Senior Member

Posts: 329
Threads: 11
Joined: Jul 2011
Reputation: 6
#3
RE: Door Smash

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

Think A Little, Change A Lot
07-05-2012, 10:56 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#4
RE: Door Smash

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

}

[Image: the-cabin-in-the-woods-masked-people.jpg]
07-05-2012, 11:13 AM
Find
BrooksyFC Offline
Senior Member

Posts: 329
Threads: 11
Joined: Jul 2011
Reputation: 6
#5
RE: Door Smash

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

Think A Little, Change A Lot
07-05-2012, 11:28 AM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#6
RE: Door Smash

(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

[Image: the-cabin-in-the-woods-masked-people.jpg]
07-05-2012, 11:34 AM
Find
BrooksyFC Offline
Senior Member

Posts: 329
Threads: 11
Joined: Jul 2011
Reputation: 6
#7
RE: Door Smash

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

Think A Little, Change A Lot
07-07-2012, 05:08 PM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#8
RE: Door Smash

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

[Image: the-cabin-in-the-woods-masked-people.jpg]
07-07-2012, 05:16 PM
Find
BrooksyFC Offline
Senior Member

Posts: 329
Threads: 11
Joined: Jul 2011
Reputation: 6
#9
RE: Door Smash

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

Think A Little, Change A Lot
07-07-2012, 05:21 PM
Find
No Author Offline
Posting Freak

Posts: 962
Threads: 10
Joined: Jun 2012
Reputation: 13
#10
RE: Door Smash

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

[Image: the-cabin-in-the-woods-masked-people.jpg]
(This post was last modified: 07-07-2012, 05:31 PM by No Author.)
07-07-2012, 05:23 PM
Find




Users browsing this thread: 3 Guest(s)