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
Explosions!
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#1
Explosions!

Hey Dear Forum members Idea

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


The second thing is, how the heck do I turn off FadeSepiaColorTo(3,0.2f); once I called it Huh ?


Kind Regards,

//Twitchez
(This post was last modified: 04-15-2012, 09:32 PM by Twitchez.)
04-15-2012, 09:32 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Explosions!

the numbers aren't coordinates is the amount of force you hit the body with

04-15-2012, 09:36 PM
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#3
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
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
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
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#5
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
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Explosions!

AddPlayerBodyForce

Tutorials: From Noob to Pro
04-15-2012, 10:19 PM
Website Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#7
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
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#8
RE: Explosions!

Thanks Smile 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
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#9
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
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#10
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 Smile




//Twitchez
04-15-2012, 11:03 PM
Find




Users browsing this thread: 1 Guest(s)