OpenClonk Bugtracker - OpenClonk
View Issue Details
0002047OpenClonkEnginepublic2018-11-24 08:082018-11-24 08:08
ReporterMarky 
Assigned To 
PrioritynormalSeverityfeatureReproducibilitysometimes
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002047: Feature request: More options for damage tracking
DescriptionOver the years I created quite a few damage systems for projects, but the main problem with them lies mostly in engine limitations:
* Damage(int change, int cause, int by_player)
* CatchBlow(int level, object by)
This usually means that they need to create custom damage system calls (DoDmg in CR Hazard, WeaponDamage in OC, although that is mostly compatible with the aforementioned calls)

Damage() can override the actual damage value that is dealt, so it should preferrably be used for modification of the damage only. Adding effects here means misusing the function, and can cause problems with call structure (let's say you have a damage call that creates straw particles in a strawman and an inherited function that later modifies the damage to 0 <= then there should have been no particles.
Also, in my opinion, it lacks the object that causes the damage, and a parameter for custom info that can be provided in DoEnergy/DoDamage (Hazard had their own damage types, such as bio damage, as an integer - but I think that passing proplists or whatever the user desires is more flexible).

CatchBlow() happens only from the (now nonexisting) punches, and when a C4D_Object hits you "physically". I'd like to replace this with a new callback, but keep calling both the new and old function from the engine for a while, so that scripts can be adapted.
The problem here is, that CatchBlow() is not triggered by explosion damage, and you do not have the cause and causing player of the damage. You can do some guessing with GetController() of the object for causing player, but still...
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2018-11-24 08:08MarkyNew Issue