![]() |
Explosions! - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Explosions! (/thread-14827.html) |
Explosions! - Twitchez - 04-15-2012 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/tutorials/script/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 RE: Explosions! - SilentStriker - 04-15-2012 the numbers aren't coordinates is the amount of force you hit the body with RE: Explosions! - Twitchez - 04-15-2012 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. RE: Explosions! - SilentStriker - 04-15-2012 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 RE: Explosions! - Twitchez - 04-15-2012 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"); } RE: Explosions! - Your Computer - 04-15-2012 AddPlayerBodyForce RE: Explosions! - palistov - 04-15-2012 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. RE: Explosions! - Twitchez - 04-15-2012 Thanks ![]() Now, to the second question I wrote, how do I turn off these screen effects? FadeSepiaColorTo FadeImageTrailTo FadeRadialBlurTo RE: Explosions! - DRedshot - 04-15-2012 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); RE: Explosions! - Twitchez - 04-15-2012 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 |