So, I've been working on some ModScripts for OXCE+ and wanted to share what I have so far.
I am actually aiming for some documentation of the various scripting possibilities but did not yet find the time to write something meaningful. So examples will have to do for know.
I will start of with two of my debug scripts which I used for some damage scaling and understanding how XCOM applies damage. (See attached file debug.rul)
I am using two hooks which are part of the hit and damage calculations: hitUnit and damageUnit.
Both are called in quick succession after each other, every time a unit will potentially receive damage.
The first hook (hitUnit) receives power, part and side and is expected to also return these values. So we have the opportunity to change the power of an attack, the body part which was hit or the side of the armor where the hit connected.
The second hook (damageUnit) has variables for all the damage that is applied after a succesful hit (like to_health, to_armor, to_stun, etc.). Here you can change the amount of damage that is applied to the respective type.
One potential use of this would be a weapon which enables for body part targeting. I have included such an example as bodypart_targeting.rul.
We define three new Tags: AUTO_IS_KNEESHOT, AUTO_IS_ARMSHOT & AUTO_IS_HEADSHOT. When applied to a gun, the scripts will check for that tag on the weapon and apply fatal wounds to the bodypart which has been targeted.
(My meal is getting cold, so I will add more information later..