preister / Celts_Altis_Life

Celts Clan Arma 3 Altis Life RPG Multiplayer mission
6 stars 5 forks source link

Is it possible to make rubber bullets less OP? #74

Open Duubz opened 9 years ago

Duubz commented 9 years ago

At the moment one hit, even on the players foot will knock them KO. Is it possible to make them more like normal bullets except they knockout instead of killing when player health gets to about 20?

preister commented 9 years ago

Yeah, I'm pretty sure we can do pretty much anything we want with this, here is the current code (core\functions\fn_handleDamage.sqf):

//rubber bullets
        if(_projectile in ["B_9x21_Ball"] && _curWep in ["SMG_02_F"]) then {
            if((side _source == west && playerSide != west)) then {
                private["_isVehicle","_isQuad"];
                _isVehicle = if(vehicle player != player) then {true} else {false};
                _isQuad = if(_isVehicle) then {if(typeOf(vehicle player) == "B_Quadbike_01_F") then {true} else {false}} else {false};
                _damage = false;    
                [_unit,_source] spawn life_fnc_handleDowned;
            };

            if(side _source == west && playerSide == west) then {
                _damage = false;
            };
        };

and like you said the current behavior is just to check if the player got hit by a rubber bullet - anywhere, disregarding as well any protection the player might have - and just puts him or here into the downed state.

So what you want this to be changed to would be?

Does that sound about right? (If you want more don't be shy to ask ;) )

The only problem I really see is that there might be edge cases where you end up killing the target accidentally - not sure how easy it is to calculate the damage of a projectile to determine if its damage would kill the player.

On a side note to a related topic, I ran over this little gem on Armaholic: http://www.armaholic.com/page.php?id=27122

Duubz commented 9 years ago

Hi mate, that's fine. Killing the suspect on the odd occasion isn't an issue, as log as it doesn't happen too often. We can add it in and test it out and refine it if need be.

preister commented 9 years ago

After looking a bit longer at the code I think we should have a chat about this, not about the functionality itself just want to check what plans you have in regards of stuff like this in the future (lets give the usual extreme example: how about "watercannons" as cop vehicle weapons?) - there is a lot of code duplication which creates strange inconsistencies between tazing and rubber bullets etc.

Edit 1: Made a branch for it so we can start experimenting with this stuff a little.

preister commented 9 years ago

ToDo List:

preister commented 9 years ago

Part of #97

preister commented 9 years ago

Not totally satisfactory yet.

preister commented 9 years ago

OK the issue which currently exists is the way Arma 3 calculate damage, it doesn't calculate damage or death with a single value but the damage is split over different body part, any body part reaching damage value 1 will cause death - as far as we figured out.

So handle damage needs a bit of a rework to take this into account, another feature this could enable is to create some more advanced damage behaviors (fe. a rubber bullet does only do damage if the hit is on the head or body, or if the damage on the legs reaches 1 you are forced to crawl etc.)

Duubz commented 9 years ago

I really like the sound of that. It would allow us to potentially make more functions for the medic, such as repairing broken bones or whatever.

preister commented 9 years ago

OK might be worth looking into finding a nice medic system then, there are a bunch of scripts on Armaholic as I remember (breaking bones, inner bleeding etc)

Edit: fe. http://www.armaholic.com/page.php?id=26120