Page 3 of 3

Re: [Solved] How to dissociate direct hit and AOE?

Posted: 01 Jun 2014, 12:22
by steeffeen
see http://forum.maniaplanet.com/viewtopic.php?t=27903 regarding the actual topic of this thread

Re: [Solved] How to dissociate direct hit and AOE?

Posted: 04 Jun 2014, 19:30
by fleo
djhubertus wrote:I have the same, gauge sound are looping and to stop, player need to leave server.
I found a trick to avoid that (at least the time to find where that glitch is from): Because that loop started only when a player eliminated his last opponent with his custom weapon in the Slot_A, I unequipped this weapon right after the elimination. So I put this line of code at the end of the OnArmorEmpty event:

Code: Select all

ActionBind(Event.Shooter,CSmMode::EActionSlot::Slot_A,CSmMode::EActionInput::None);
It's no big deal because the round ends right after.

Re: How to dissociate direct hit and AOE?

Posted: 05 Jun 2014, 09:57
by fleo
I have another question to come back to the actual topic of this thread:
Cerovan wrote:Nevertheless, with a custom-created weapon, you can specify the damage done by a direct hit and those within an AoE (http://maniaplanet.github.io/documentat ... eapon.html).

Look at the values "Damage Radius" and "Damage Radius Attenuation" in the Gameplay explosion tab of the bullet :thumbsup:
I used that but I'm now wondering, is it possible to create a bullet which makes a +2 for a direct hit, a +1 for hit by aoe and nothing further? Because I put Damage Radius = 2 and Damage Radius Attenuation = 1 and damages = 200 so the weapon deals between 200 and 100 damages (+2 or +1) from a distance of 0 to 1m.

The problem is if the explosion is not so close to the target (between 1 and 2m to be exact), damages are between 100 and 0. So it doesn't make a +1 (that's what I want) but the victim feels an impact (because of the sound triggered when you're hit, even if the damages are lower than 100 and event if I discard the onhit event). It's quite confusing during a play, you're not sure if you've been hit or not...

Is it possible to create a damage attenuation between 200 and 100 then directly 0? Or something similar. Thx!

Re: [Solved] How to dissociate direct hit and AOE?

Posted: 05 Jun 2014, 11:42
by phil13hebert
You could just verify that the damage is under 100 and pass if it is.

Code: Select all

if (Event.Param1 == "damage" && ...) {
    if (Event.Param2[0] < 100) {
        PassOn(Event);
    } else {
        // Remove armor
    }
}

Re: [Solved] How to dissociate direct hit and AOE?

Posted: 05 Jun 2014, 12:44
by fleo
What's the difference between discard and passon? Because I'm doing what you said with the discard function. The victim is not really hit (no +1, no hit sound, no damages) but there is that disturbing sound, you know the same as during warm-up.

I just thought about a simple solution, I'll short the radius to 1m and if a player gets some damages (from 1 to 199), I'll transform this amount to 100 to have a +1. Should work.