Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
Explosions!
Hey Dear Forum members
Today, I've been tweaking an explosion effect I've been developing. So far, I'm liking the effects, but I wanted to make it autentic by making the player fly backwards and hitting a wall!
But something that bothers me is my function: AddBodyForce("Player", -21.238f, 2.0f, -25.407f, "world");
is supposed to send the player to coordinates -21.238, 2.0 (for height) and -25.407 and I followed the tutorial on http://wiki.frictionalgames.com/hpl2/tut...ript/force . But when I call it, nothing happends? Is there a way to just send the player backwards until a wall hits him? Maybe with a script area that will stop him ?
The second thing is, how the heck do I turn off FadeSepiaColorTo(3,0.2f); once I called it ?
Kind Regards,
//Twitchez
(This post was last modified: 04-15-2012, 09:32 PM by Twitchez.)
|
|
04-15-2012, 09:32 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Explosions!
the numbers aren't coordinates is the amount of force you hit the body with
|
|
04-15-2012, 09:36 PM |
|
Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
RE: Explosions!
Yeah, I read now and I must have missunderstood it. Is it possible to call the AddBodyForce and then make it stop when I hit a Script area?
Ive also tried increasing AddBodyForce("Player", -500.0f, 2.0f, -500.0f, "world"); but nothing happends.
(This post was last modified: 04-15-2012, 09:45 PM by Twitchez.)
|
|
04-15-2012, 09:39 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Explosions!
Well if he is supposed to hit the wall it will stop at the wall if not the force is too strong then it may fly through the wall x)
Try AddBodyImpulse
|
|
04-15-2012, 09:52 PM |
|
Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
RE: Explosions!
Still doesn't work :/ Even though I try really high numbers.
For example: AddBodyImpulse("Player", -500.0f, 2.0f, -500.0f, "world"); or AddBodyForce("Player", -500.0f, 2.0f, -500.0f, "world");
My Code:
void function_explode(string &in asChild, string &in asParent, int alState)
{
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0, false);
SetPropHealth("Stone", 0.0f);
StartScreenShake(0.7f, 1.0f, 0.2f, 0.7f);
StartEffectFlash(0.2, 1.0, 0.2);
//To make him fly...
AddBodyForce("Player", -500.0f, 2.0f, -500.0f, "world");
CreateParticleSystemAtEntity("", "ps_area_fog_falling.ps", "Exp_area", false);
AddTimer("", 0.01, "Exp_Flash");
}
(This post was last modified: 04-15-2012, 10:12 PM by Twitchez.)
|
|
04-15-2012, 10:09 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Explosions!
AddPlayerBodyForce
|
|
04-15-2012, 10:19 PM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Explosions!
AddBodyForce is for bodies in an entity. For instance, you would use AddBodyForce open an individual desk drawer; since the main body of the desk is static, simply using AddPropForce likely won't yield any sort of desirable result.
You'll need values in the thousands to see movement. Try something like 15,000 instead of 500. Tweak the 2 until you get the appropriate movement. I'd wager a 4000 might give you the upwards jump you're looking for.
|
|
04-15-2012, 10:25 PM |
|
Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
RE: Explosions!
Thanks It worked out very fine now! Thanks a lot!
Now, to the second question I wrote, how do I turn off these screen effects?
FadeSepiaColorTo
FadeImageTrailTo
FadeRadialBlurTo
(This post was last modified: 04-15-2012, 10:53 PM by Twitchez.)
|
|
04-15-2012, 10:49 PM |
|
DRedshot
Senior Member
Posts: 374
Threads: 23
Joined: Jun 2011
Reputation:
11
|
RE: Explosions!
You fade them to their default value, which for these three's case, is 0.0f
FadeSepiaColorTo(0.0f , 1.0f);
FadeImageTrailTo(0.0f , 1.0f);
FadeRadialBlurTo(0.0f , 1.0f);
(This post was last modified: 04-15-2012, 10:58 PM by DRedshot.)
|
|
04-15-2012, 10:58 PM |
|
Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
RE: Explosions!
Aha, thanks again DRedshot, you helped me again today lol.
Weird that using "(0.0f , 0.0f)" didn't work, that you would have to wait a second before the screen effects take off.
Anyway, thanks again everyone
//Twitchez
|
|
04-15-2012, 11:03 PM |
|
|