ZScript Player Limb System
Posted: Sun Feb 27, 2022 2:18 am
I'm learning ZScript, but still some stuff goes way over my head. So I am a bit confused how to go about doing this.
Simply I wish to add a Limb System for Players a-la Deus Ex, Fallout, Tarkov, where limbs have different health values, and different effects when crippled.
Rough ideas of what I plan to have:
* There are five limbs: right/left arms, right/left legs, and head. For all intents and purposes Torsos are irrelevant.
* When limbs are damaged, the player's health pool will take the damage as well.
* To work around limitations, limb hitbox actors can't die, when they reach 1 hitpoint, it more or less results in them becoming crippled.
* When either leg gets crippled it slows the player down by 25% each (I assume this can be done with Power actors or dummies, the trick is getting the game to register the events for the player to gain the effect) as well as preventing the player from jumping/kicking/etc.
* Falling damage also affects the limb health of legs (I have custom fall damage behaviour in the code, I would assume the damage the player takes from the fall should transfer with a damage children action or whatever)
* When one arm is crippled crippled it would prevent players from using 2H/DW weapons, if both arms are crippled the Player cannot use any weapon (I presume this would work via a dummy token actor which would automatically deselect any held weapon, and jump to either the deselect state when the player switches weapons or a Crippled weapon state sort of like HD's dummy sprintweapon actor)
* Headshots are easy, when they drop down to 1, the player dies instantly. I suppose if the head hitbox health is low enough, it would cause a shaky cam effect for better immersion.
* Stimpacks and the such can heal the player's main health pool, but only all limbs by a small amount, instead the player would be dependent on splints (would restore 50% limb health) or Trauma Packs (restore limbs to full health) [Medikits would make a fine placeholder as an example]
* Limb Hitboxes follow the player, sprinting, jumping, etc.
* A drug item that would ignore the crippled limbs effect as a bonus effect for testing as well, it also protects limbs from damage by 25% for a short time (Berserk Packs would make a fine placeholder)
Simply I wish to add a Limb System for Players a-la Deus Ex, Fallout, Tarkov, where limbs have different health values, and different effects when crippled.
Rough ideas of what I plan to have:
* There are five limbs: right/left arms, right/left legs, and head. For all intents and purposes Torsos are irrelevant.
* When limbs are damaged, the player's health pool will take the damage as well.
* To work around limitations, limb hitbox actors can't die, when they reach 1 hitpoint, it more or less results in them becoming crippled.
* When either leg gets crippled it slows the player down by 25% each (I assume this can be done with Power actors or dummies, the trick is getting the game to register the events for the player to gain the effect) as well as preventing the player from jumping/kicking/etc.
* Falling damage also affects the limb health of legs (I have custom fall damage behaviour in the code, I would assume the damage the player takes from the fall should transfer with a damage children action or whatever)
* When one arm is crippled crippled it would prevent players from using 2H/DW weapons, if both arms are crippled the Player cannot use any weapon (I presume this would work via a dummy token actor which would automatically deselect any held weapon, and jump to either the deselect state when the player switches weapons or a Crippled weapon state sort of like HD's dummy sprintweapon actor)
* Headshots are easy, when they drop down to 1, the player dies instantly. I suppose if the head hitbox health is low enough, it would cause a shaky cam effect for better immersion.
* Stimpacks and the such can heal the player's main health pool, but only all limbs by a small amount, instead the player would be dependent on splints (would restore 50% limb health) or Trauma Packs (restore limbs to full health) [Medikits would make a fine placeholder as an example]
* Limb Hitboxes follow the player, sprinting, jumping, etc.
* A drug item that would ignore the crippled limbs effect as a bonus effect for testing as well, it also protects limbs from damage by 25% for a short time (Berserk Packs would make a fine placeholder)