Re: Explanations of CC features for the community! [23/12/08]
I don't know if this is supposed to be exclusively CapnBubs' thread or not, but either way I'd like to take a moment of your time to explain the Cortex Command damage system. Why? Because it's more complex than many people think.
If you've ever seen a mod that has actors with an initial health that's not 100, you'll probably see a load of comments outlining why that's the wrong thing to do: How it affects resale value of the unit, mostly. My main concern is that health is actually a rather small part of the unit's endurance. Health is like the amount of blood left in the actor: Wounds will cause it to leak out, but the body can be torn up or killed instantly with a blunt impact without any indication from the actor's health value. Take a look at the Light Soldier's head.
Code:
AddEffect = Attachable
PresetName = Soldier Head A
Mass = 36
Sharpness = 1
HitsMOs = 1
GetsHitByMOs = 1
SpriteFile = ContentFile
FilePath = Coalition.rte/Actors/Soldier/HeadA.bmp
FrameCount = 1
SpriteOffset = Vector
X = -7
Y = -7
AngularVel = 6
EntryWound = AEmitter // The wound that is applied if a bullet first pierces the actor.
CopyOf = Wound Flesh Entry
ExitWound = AEmitter // A second wound that is applied if a bullet has enough power to go through the actor.
CopyOf = Wound Flesh Exit
AtomGroup = AtomGroup
AutoGenerate = 1
Material = Material
CopyOf = Armoured Flesh
Resolution = 4
Depth = 0
DeepCheck = 0
JointStrength = 25
JointStiffness = 0.1
BreakWound = AEmitter // This wound is applied to the torso when this body part is gibbed.
CopyOf = Wound Flesh Body
JointOffset = Vector
X = 0
Y = 5
ImpulseDamageThreshold = 100 // I added this code in, it should go in the main body code. It controls how effective blunt hits are: If this impulse limit is exceeded, the actor will take 10 points of damage.
GibImpulseLimit = 250 // If this impulse limit is exceeded, the body part will instantly gib.
GibWoundLimit = 6 // The number of wounds the body part can endure before gibbing.
GibSound = Sound
CopyOf = Flesh Body Blunt Hit
GibImpulseLimit and GibWoundLimit are very important for the actor's survivability: Look at the zombie. Its wounds do very little damage, but you can kill them by exceeding their GibWoundLimit when they still have more than 50 health left.
So how do wounds work? They're emitters that are applied to the actor when it's pierced by an MOPixel or MOSParticle, or if something attached to the actor is broken and has a defined BreakWound. Damage is dependent on the wound, not the gun. You can amp up your death cannon so it shoots a bullet with infinite sharpness, but the wound it creates will still only do as much damage as the wound from a handgun. The damage that wounds do is actually very simple to calculate:
Code:
AddEffect = AEmitter
PresetName = Wound Flesh Entry
Mass = 0.0001
HitsMOs = 0
GetsHitByMOs = 0
SpriteFile = ContentFile
FilePath = Base.rte/Effects/Wounds/FleshWoundA.bmp
FrameCount = 1
SpriteOffset = Vector
X = -1
Y = -2
AtomGroup = AtomGroup
AutoGenerate = 1
Material = Material
CopyOf = Flesh
Resolution = 2
Depth = 5
DeepGroup = AtomGroup
AutoGenerate = 1
Material = Material
CopyOf = Flesh
Resolution = 3
Depth = 5
DeepCheck = 0
JointStrength = 10000
JointStiffness = 1
DrawAfterParent = 1
AddEmission = Emission
EmittedParticle = MOPixel
CopyOf = Drop Blood
Spread = 0.1
MaxVelocity = 4
MinVelocity = 1
BurstSound = Sound
CopyOf = Flesh Penetration Hit
EmissionEnabled = 1
EmissionCountLimit = 35 // The number of times that the wound bleeds.
EmissionsIgnoreThis = 1
ParticlesPerMinute = 100 // The rate at which the wound bleeds.
BurstSize = 10
BurstScale = 3
BurstDamage = 5 // The amount of damage dealt when the wound is first applied.
BurstTriggered = 1
EmissionDamage = 0.04 // The amount of damage dealt when the wound bleeds. Multiply by EmissionCountLimit to see how much health is lost by bleeding.
Flash = None
FlashOnlyOnBurst = 0
It's not a very in-depth look at exactly how everything works, but I hope it helps.