pushdir

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

braindead

FNG / Fresh Meat
Aug 22, 2009
918
346
0
Merry Ol' England
Hey Benjamin and anyone else, that may need this for future reference

The issue was, that when in the air, the velocity and direction of the push was hitting him even further into the direction he was travelling, so I put in this bit of code, so that if he wasn't stood still or walking, the pushdir would have less of an affect

Code:
                if( controller.target != none &&  (  controller.target.physics == PHYS_Walking || controller.target.physics  == PHYS_None ) )
        {    
                       RetVal = Super.MeleeDamageTarget(hitdamage*1.70, pushdir*50);
        }
        else
        {
                       RetVal = Super.MeleeDamageTarget(hitdamage*1.70, pushdir*9);
         }
This however doesn't solve the issue we have, that if you are crouched, the pushdir doesn't take effect.
Has anyone ever noticed this with the Patty or FP? and if so, is it an engine limitation or are we missing some code here?
 

webley

FNG / Fresh Meat
Oct 14, 2010
172
43
0
www.wolfpackclan.com
yes, the throw is very much an issue on some maps, allowing lift off to aid the finding of glitches - players can use the geometry of a map to exploit the pushdir to throttle them like a ramp

e.g.

YouTube - Ramping Glitch

without toning down the distance pushed, would there be a way to lower trajectory??

hope you can help on this projects benjamin :)

and as braindead said, players can avoid it when crouching - is this engine limitation? (At the moment players take double damage when crouching as a tradeoff for not being thrown)

i have however found a new value at 23 which seems nice - not as far as i would of liked - so im going to change the AI so he doesnt stop raging until his thrown you twice at the value of 23, instead of 1 throw at 50 - but i much rather solve the trajectory issue
 
Last edited:

Benjamin

Grizzled Veteran
May 17, 2009
3,631
635
113
France
I'd take the player's vertical velocity and adjust pushdir based on that - I guess you don't want the combined velocity to exceed the maximum vertical velocity achievable with a jump. Basically, if you're at the highest point of your jump it should only push you horizontally, or at a similar angle.

From those videos I can see that the actual force is much too strong though, it's a bit over the top being able to be thrown all the way over the other side of the map. I'd be interested to see what it looks like now that you've lowered the value to 23.
 

webley

FNG / Fresh Meat
Oct 14, 2010
172
43
0
www.wolfpackclan.com
yea, i think im going to create the AI to double tap at a value of 23, otherwise someone will find a glitch with a single tap at 50

to mess aroudn with physics etc is not the right way to go about this, thats what ive decided

thanks benjamin
 
Last edited:

webley

FNG / Fresh Meat
Oct 14, 2010
172
43
0
www.wolfpackclan.com
I'd take the player's vertical velocity and adjust pushdir based on that - I guess you don't want the combined velocity to exceed the maximum vertical velocity achievable with a jump. Basically, if you're at the highest point of your jump it should only push you horizontally, or at a similar angle.

From those videos I can see that the actual force is much too strong though, it's a bit over the top being able to be thrown all the way over the other side of the map. I'd be interested to see what it looks like now that you've lowered the value to 23.

could you still help us with the crouching issue? where player is not effected by pushdir if crouching?

that would be amazing if you could
 

webley

FNG / Fresh Meat
Oct 14, 2010
172
43
0
www.wolfpackclan.com
Tahnks marco

were abouts should i be looking at or adding this code?

also ive kind of taken out the geometry effects by just calculating the way the monster is facing. is there any way to add a slight z axis jump effect in the "calcuate based on the way monster is facing"??

sorry for the rushed post, gotta head off out

if(Controller!=none && Controller.Target!=none)
{
//calculate based on relative positions
/////////webey commented out the following
//PushDir = (damageForce * Normal(Controller.Target.Location - Location));
//}
//else
//{
//calculate based on way Monster is facing
PushDir = damageForce * vector(Rotation);
}
 

Marco

Active member
May 23, 2009
644
227
43
Finland
Something alike this:
Code:
function ClawDamageTarget()
{
    local vector PushDir;
    local float UsedMeleeDamage;

    if( MeleeDamage > 1 )
        UsedMeleeDamage = (MeleeDamage - (MeleeDamage * 0.05)) + (MeleeDamage * (FRand() * 0.1));
    else UsedMeleeDamage = MeleeDamage;

    if(Controller!=none && Controller.Target!=none)
    {
        PushDir = (damageForce * Normal(Controller.Target.Location - Location));
        PushDir.Z = FMax(200,PushDir.Z);
    }
    else PushDir = damageForce * vector(Rotation);
    if ( MeleeDamageTarget(UsedMeleeDamage, vect(0,0,0)) )
    {
        if( Pawn(Controller.Target)!=None )
            Pawn(Controller.Target).AddVelocity(PushDir);
        PlaySound(MeleeAttackHitSound, SLOT_Interact, 2.0);
    }
}
 

braindead

FNG / Fresh Meat
Aug 22, 2009
918
346
0
Merry Ol' England
Hey Benjamin

Yes, the Addvelocity seemed to do the trick, although the code I put in is slightly different from Marco's it seems to work a treat.

Thanks guys for your help