Forum

> > CS2D > General > Yet Another Feature Request
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Yet Another Feature Request

2 replies
To the start Previous 1 Next To the start

old Yet Another Feature Request

Mami Tomoe
User Off Offline

Quote
But alas, the feature development for CS2D has stopped.

Still, it would be splendid to have access to the raw incoming damage using the cs2d lua hook hit hook.

Currently, if you take 10 damage but only have 5 health, there is no way to use the hook to know that you (theoretically) took 10 damage which inevitably resulted in your demise.

This is useful how:
Custom health scripts - We cannot calculate how much damage a player is taking unless the player has the maximum health possible (250), which heavily impacts what can be done with Lua to modify how the health calculation works.
Custom damage scripts - Stuff such as DpS counters and custom armours and other calculations.

The idea is:
Add rawincdmg (raw incoming damage) and potentially rawincdmgreduc (raw incoming damage after armour reduction).

The former should be a matter of seconds to add, whilst the latter depends on how you calculate the damage for players.

Currently, as it stands, it is not possible to know how much damage a player has been inflicted with, only how much damage the player ended up taking.

Why is this important?
Because I recently discovered a bug with one of my files file cs2d [MT] Percent Health Module where the damage you take will eventually reach 1 DpS no matter what is hitting you (even a Laser) because the script would set your health to 1, and so anything you get damaged by will always deal 1 damage according to the cs2d lua hook hit hook.
Therefore Lua will always think the player took 1 damage, even if the player took much more.

Timestamped: https://youtu.be/JZo9QqSp42c?t=79
Notice how the damage taken drops the lower health the player is.

old Re: Yet Another Feature Request

mrc
User On Online

Quote
As for me, I would like them to make the Hostages have unique IDs so that we could use the setpos command on them, so I could make a script that they teleport when someone used them has teleported. But since they won't put anything else in the game, everything we ask for will be in vain.

old Re: Yet Another Feature Request

DC
Admin Off Offline

Quote
@user Mami Tomoe & @user mrc:
I didn't close the feature request thread for fun. In other words: This won't be added. Sorry!

@user Mami Tomoe:
It's also because I can't / don't want to add so many parameters to a high frequency hook like cs2d lua hook hit (which already has quite a lot of parameters anyway). Each parameter comes with a performance cost.

There is a workaround to improve the majority of cases:
You know the used weapon so you can use cs2d lua cmd itemtype to get the dmg. For snipers you would have to add extra logic by retrieving weaponmode from the hit source cs2d lua cmd player. so you can get dmg_z1 / dmg_z2 when necessary. If that value is significantly higher than rawdmg you can use that value instead of the rawdmg value. It's not a perfect fix but in most cases - unless there's some meat shield in line of fire - the target should receive the full weapon damage.

Unfortunately this doesn't fix explosions, turrets, NPC damge etc.

@user mrc: Hostages do have unique IDs but they use their own independent system and are not "dynamic objects". So none of the dynamic object commands would ever work with them. Changing this would be a pretty big task. (It's like that because hostages were implemented before all the other dynamic object things were added)
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview