Author Topic: Could someone edit the Proto-17's projectile to do damage and push back?  (Read 2398 times)

So that when the laser hits an enemy or yourself they get damaged by 10 and get pushed back the same as if you fired it? And if it bounces as well just in case they're separate for some reason? I think this'll make it more fun and a slightly more useful combat item but I'm not sure how to do it.
« Last Edit: February 06, 2016, 06:29:31 PM by gr8dayseth »

would be really easy if i knew how to get the player that's hit by the bullet. the 10 damage thing though is no problem. Go into the Proto17projectile datablock and change the directDamage from 5 to 10.

Code: [Select]
function Proto17Projectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
    //Make sure we hit a player or bot
    if(%col.getClassName() $= "Player" || %col.getClassName() $= "AIPlayer")
    {
        %target = %col;
        %col.setVelocity(VectorAdd(%col.getVelocity(),VectorScale(%col.getPosition(),"-16")));
    }
    serverPlay3D(Proto17BounceSound,%pos);
}
« Last Edit: January 23, 2016, 11:55:45 PM by Goth77 »

the 10 damage thing though is no problem. Go into the Proto17projectile datablock and change the directDamage from 5 to 10.
I actually forgot to mention that it doesn't do any damage at all even with that there, and it was already set to 5

oh awesome, and convenient timing too because I was literally just about to post when you posted that. anyways I'll try that when I get the chance later but still need the damage thing

Go into the Proto17projectile datablock and change the directDamage from 5 to 10.

just tried it since I can now, neither worked, those problems are probably connected somehow

You must have done something wrong?

I went ahead and packaged it for ya....

-snip-
« Last Edit: January 23, 2016, 06:14:22 AM by Goth77 »

oh yeah I guess I did lol cause that works, thanks
one more thing though is it possible to make it so the player that gets hit also gets knocked back in the direction the laser hit them? the little up velocity can stay though that's probably a good idea to have combined with that

« Last Edit: January 23, 2016, 06:15:59 AM by Goth77 »

still just does the up velocity

still want this because friends are gonna be playing soon and I want to mess around with them using this

I feel like it shouldn't be that difficult honestly

I feel like it shouldn't be that difficult honestly
It's not, I ended up crashing out after being up for 30+ hours, sorry.

Here ya go http://www.filedropper.com/weaponproto17_3

whoops forgot I even had this
anyways that version seems to fling the victom in one of two diagonal directions instead of towards the direction the laser's going, and it has way too much force

It actually flings them in the direction opposite to where they are aimed, and yeah the velocity is a bit much