The system that handles collision events and deals damage doesn't have the information of which sub-physics-shape caused a collision, so that wouldn't be possible without larger changes. Only the main/compound phys info/obj can be the one that supplies the Damage value.
Damn.
So is there no real way to fix melee weapons damaging Anne when she carries them, then?
f you only want a part of a weapon dealing the damage then maybe a separate (physics) object could be attached, with CEntityAttached or other means? I don't know how or if that would work correctly with melee weapons though.
Hmm, someone would have to give that a try to find out.
The Damage T-script value for melee/impact (not guns) isn't an absolute value, it's a multiplier. Actually "Damage" and "DamageMultiplier" are one and the same for that (if both are set then DamageMultiplier has the final say). This multiplier is applied to the impact energy/force value from the physics collision, so damage scales by impact magnitude. The default damage multiplier, when no T-script param is supplied, is 1.
Good to know. So is it possible to set that value
above 1?
Concerning the other various damage params, I'd probably not add anything natively but instead add necessary script hooks so it would be possible to have more script control over damage calcs. That would allow for implementing simple filtering like not damaging the player or more elaborate stuff such as for example a cattle prod that required a recharge time before it can deal damage again.
That'd be great...it's too bad none of us really seem to understand the scripting language all that well, though.
I was actually wondering, since you said you might be able to help out with some scripting, Lee, if you would be willing to create that Stamina script I requested a while ago? Hopefully it isn't too complicated:
- A limited amount of Stamina, valued from 1-100 (would be nice to have a HUD component to show the value of Stamina from 1-100, just like the health indicator, but not critical).
- Jumping makes Anne lose 25 Stamina.
- Hold a custom key to "sprint" - moving Anne about 1.5x faster at a cost of about 15 Stamina per second. Play a sound when sprinting and increase the FOV by about 5.
- Overall, make the player move about 1.15x faster to make up for the fact that bunny hopping is no longer an option.
- Play a sound when Stamina reaches 50, and a sound when Stamina reaches 0 to indicate that the player is tired.
- Make the player unable to jump or sprint for 2 seconds once their Stamina runs out, as well as making the player move slower overall for this time (just under regular speed at about 0.85x). Stamina should not regenerate for these 2 seconds.
I'm also wondering whether you might be able to replace the current HUD health "count" with a bar component instead? It's not crucial, but would be nice to have.
Lastly, I'm curious as to exactly how the float Speed value applies to CAnimals? It seems increasing Speed above 1 doesn't do all that much, as the dinosaurs still move quite slowly. I'd like to see about increasing the carnivore's Speed value in the level in order to make up for the increased speeds which would be available should the Stamina script get made, but as of right now I can't figure out how to get them to go faster than their normal run speed.