Area specific Damage

From The DarkMod Wiki
Jump to navigationJump to search

Originally written by Ishtvan on

So D3 already has a system of damage areas. They are in the AI def files, but it looks like these reference other predefined points on the AI, and I'm not sure where those are (IE, what the actual coordinates of *Neck is).

I remember seeing something like Joint_waist followed by some coordinates in a def file, so maybe that's how you define the points?

It looks like these kind of are defined by boundary points, like chest is "*waist-*Rshld-*Lshldr-*Neck". Head is defined by "*Neck" which I guess means "everything above the neck joint" I don't know how the code knows to use everything above and not everything below, because legs are "*Hips", which looks like the same syntax. (maybe it defaults to the smallest area when the model is partitioned at that joint?)

monster_demon_imp.def (Modified so it only takes damage to the head)

 "damage_zone head"            "*Neck"
 "damage_zone chest"            "*waist -*Rshldr -*Lshldr -*Neck"
 "damage_zone left_arm"         "*Lshldr"
 "damage_zone right_arm"         "*Rshldr"
 "damage_zone legs"            "*Hips"

 "damage_scale head"            "1"
 "damage_scale left_arm"      "0"
 "damage_scale right_arm"   "0"
 "damage_scale legs"            "0"
 "damage_scale chest"         "0"