BrooksyFC
Senior Member
Posts: 329
Threads: 11
Joined: Jul 2011
Reputation:
6
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Door Smash
Like someone is pounding on the door ?
|
|
07-05-2012, 10:52 AM |
|
BrooksyFC
Senior Member
Posts: 329
Threads: 11
Joined: Jul 2011
Reputation:
6
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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);
}
|
|
07-05-2012, 11:13 AM |
|
BrooksyFC
Senior Member
Posts: 329
Threads: 11
Joined: Jul 2011
Reputation:
6
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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.
|
|
07-05-2012, 11:34 AM |
|
BrooksyFC
Senior Member
Posts: 329
Threads: 11
Joined: Jul 2011
Reputation:
6
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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 ?
|
|
07-07-2012, 05:16 PM |
|
BrooksyFC
Senior Member
Posts: 329
Threads: 11
Joined: Jul 2011
Reputation:
6
|
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 |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
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.
(This post was last modified: 07-07-2012, 05:31 PM by No Author.)
|
|
07-07-2012, 05:23 PM |
|
|