Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved How do I use particle system for this scare?
Author Message
DarkSnowman Offline
Junior Member

Posts: 13
Joined: Sep 2011
Reputation: 0
Post: #1
Wink How do I use particle system for this scare?
Ok I am working on my custom story and I need someone to help me figure out how to create banging on a particular door (like someone banging a door very hard) and I know you have to use particles to do it but I have no idea how. Can someone tell me how?
(This post was last modified: 12-05-2011 12:32 AM by DarkSnowman.)
12-04-2011 11:58 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #2
RE: How do I use particle system for this scare?
Im not sure this is what you mean, but you can SetPropHealth("door", 0.5f); and that would bang the door pretty hard (might break it a bit)

12-05-2011 12:23 AM
Find all posts by this user Quote this message in a reply
Statyk Offline
Modmau5

Posts: 3,609
Joined: Sep 2011
Reputation: 198
Post: #3
RE: How do I use particle system for this scare?
Set a script area near the door the the player will walk into the activate the script and name it "bangarea". Go into the script and try this (fill in capitalizations with your own info):

//________________________________

void OnStart()
{
AddEntityCollideCallback("Player", "bangarea", "bang_func", true, 1);
}

void bang_func(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("DOORNAME", 10, 10, ""); //This makes the player turn to the banging door
PlaySoundAtEntity("", "BANGINGSOUND.snt", "DOORNAME", 0, false); //The sound of the thuds. Find which one you like best.
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "DOORNAME", true); //The debris off the door. You can change the .ps if you don't like this one.
AddTimer("", YOURTIME+f, "lookawayfromdoor"); //This timer leads to the "look away" script to stop looking at the door and giving player control.
}

void lookawayfromdoor(string &in asTimer)
{
StopPlayerLookAt();
}

//_________________________________

Remember, in the timer, to put the amount of seconds you want to stay looking at the door. an example of this would be: 1 or 1.2f, understand?

(This post was last modified: 12-05-2011 12:26 AM by Statyk.)
12-05-2011 12:25 AM
Visit this user's website Find all posts by this user Quote this message in a reply
DarkSnowman Offline
Junior Member

Posts: 13
Joined: Sep 2011
Reputation: 0
Post: #4
RE: How do I use particle system for this scare?
(12-05-2011 12:25 AM)Statyk Wrote:  Set a script area near the door the the player will walk into the activate the script and name it "bangarea". Go into the script and try this (fill in capitalizations with your own info):

//________________________________

void OnStart()
{
AddEntityCollideCallback("Player", "bangarea", "bang_func", true, 1);
}

void bang_func(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("DOORNAME", 10, 10, ""); //This makes the player turn to the banging door
PlaySoundAtEntity("", "BANGINGSOUND.snt", "DOORNAME", 0, false); //The sound of the thuds. Find which one you like best.
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "DOORNAME", true); //The debris off the door. You can change the .ps if you don't like this one.
AddTimer("", YOURTIME+f, "lookawayfromdoor"); //This timer leads to the "look away" script to stop looking at the door and giving player control.
}

void lookawayfromdoor(string &in asTimer)
{
StopPlayerLookAt();
}

//_________________________________

Remember, in the timer, to put the amount of seconds you want to stay looking at the door. an example of this would be: 1 or 1.2f, understand?
Perfect Big Grin this is just what I was looking for! Thanks for the help~!
12-05-2011 12:31 AM
Find all posts by this user Quote this message in a reply
Statyk Offline
Modmau5

Posts: 3,609
Joined: Sep 2011
Reputation: 198
Post: #5
RE: How do I use particle system for this scare?
No Problem brah =] lol Glad to help

12-05-2011 12:33 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)