Author Topic: Health Multiplier of less than 1? [Solved]  (Read 1708 times)

The multiplier just doesn't seem to work. It works fine with anything above 1.
Code: [Select]
%damage = %this.directDamage * 0.5 - %this.directDamage;
%damageType = $DamageType::Direct;
if(%this.directDamageType)
{
%damageType = %this.directDamageType;
}
%col.damage(%obj,%pos,%damage,%damageType);
« Last Edit: May 05, 2013, 01:57:39 PM by tommybricksetti »

The multiplier just doesn't seem to work. It works fine with anything above 1.
Code: [Select]
%damage = %this.directDamage * 0.5 - %this.directDamage;
%damageType = $DamageType::Direct;
if(%this.directDamageType)
{
%damageType = %this.directDamageType;
}
%col.damage(%obj,%pos,%damage,%damageType);
why do you need this if the value is always negative.
why are you trying to deal negative damage.
please explain.
if you are trying to heal a person %col.addHealth(positivevalue);
« Last Edit: April 29, 2013, 10:09:40 PM by Alphadin »

why do you need this if the value is always negative.
why are you trying to deal negative damage.
please explain.
if you are trying to heal a person %col.addHealth(positivevalue);
I'm trying to make it so when u get shot, you take .5x the damage.

Get rid of " - %this.directDamage"

yeah math error there
%var*0.5 - %var will be equal to -0.5*%var

yeah math error there
%var*0.5 - %var will be equal to -0.5*%var
Basically what it's doing is just
Code: [Select]
-%this.directDamage*0.5. This is because the code doesn't overwrite the damage that is being done i.e. it overlaps it. So using this method I would need to subtract half of the direct damage on impact.

Basically what it's doing is just
Code: [Select]
-%this.directDamage*0.5. This is because the code doesn't overwrite the damage that is being done i.e. it overlaps it. So using this method I would need to subtract half of the direct damage on impact.
IF you are trying to add 0.5 damage, then the damage will be 0.5.
if you are trying to add 0.5 ontop of the regular damage, then the multiplier isn't 0.5, it's 1.5.

either way, you probably don't want the number to be negative

IF you are trying to add 0.5 damage, then the damage will be 0.5.
The former.

The former.
if you are trying to add 0.5 ontop of the regular damage, then the multiplier isn't 0.5, it's 1.5.
so it's %damage *= 1.5;

so it's %damage *= 1.5;
No. I quoted the part I said. I said the "former" not the latter.
« Last Edit: May 05, 2013, 08:15:42 AM by tommybricksetti »

Code: [Select]
%dmg = %col.getDamageLevel();
%pow = %this.directDamage;
%sub = 0.5 * %pow;
%col.setDamageLevel(%dmg - %sub);
Got it!

so what you're doing is taking the current damage, then subtracting half the damage from a weapon?
what. you don't/ shouldn't be doing that.
just do

%dmg = %this.directDamage * 0.5;
%col.damage(%obj,%pos,%dmg ,%damageType);

so what you're doing is taking the current damage, then subtracting half the damage from a weapon?
what. you don't/ shouldn't be doing that.
just do

%dmg = %this.directDamage * 0.5;
%col.damage(%obj,%pos,%dmg ,%damageType);
No.