Author Topic: How do I set a projectile to do more damage to a bot?  (Read 409 times)

I have projectile check events but there is no bot function.

I tried variables but it doesn't seem to work.

I'm trying to get projectiles to do more damage than a normal projectile to a specific bot.

you need to use code. package projectile::onDamage and have it check if the hitmask is a bot. if true, add damage or multiply and parent the function.

it might actually be projectile::damage but idk


I need silver bullets to deal damage to specific types of bots.

you need to overwrite functions in code.

There is no variable?
I'm not so sure what you're really looking for, but projectile damage variable was never a thing, you have to make an add-on that will do this for you.

I'm not so sure what you're really looking for, but projectile damage variable was never a thing, you have to make an add-on that will do this for you.

I could have sworn this existed.

it might actually be projectile::damage but idk

But what is the VARIABLE so I can use VCE

projectile damage is (usually) defined in the datablock of a projectile, so it cannot be directly modified in-game

HOWEVER

You can hook into armor::damage and make sure you are hitting a bot, then check to see if the projectile is a certain damageType and reduce or increase the %damage as needed

Here would be a quick example script
Quote from: code
function Armor::Damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
    Parent::Damage(%this, %obj, %sourceObject, %position, %damage, %damageType);

    //Make sure we are hitting a bot
    if(%obj.getClassName() $= "AIPlayer")
    {
        //Default sword does double damage
        if(%damageType $= "Sword")
        {
               %damage *= 2;
        }
    }
}
there are other ways to achieve the same effect such as using projectile::damage as phantos suggested

if you call the parent prior to changing the damage its not going to have an effect...

if you call the parent prior to changing the damage its not going to have an effect...
oops, thanks conan

function Armor::Damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
    //Make sure we are hitting a bot
    if(%obj.getClassName() $= "AIPlayer")
    {
        //Default sword does double damage
        if(%damageType $= "Sword")
        {
               %damage *= 2;
        }
    }
    Parent::Damage(%this, %obj, %sourceObject, %position, %damage, %damageType);
}