Now that we don't have to deal with working from existing content (that is to say, HL2DM player models and their animation sets), one huge burden I'm trying to not have to deal with again is the multiplication of "holdtypes".
In Gmod, we had a dozen of those, often with very little differences.
With s&box, my goal is to have fewer, but tweakable types.
The starting point for that: the first iteration of this new "holditem" type.
attribute 'contenteditable' not allowedattribute 'blocktype' not allowed
The idea is that you can make the Citizen hold anything by specifying:
• The general body pose: right now, a 2x2 combination of narrow/wide item, spreading the arms & light/heavy, dropping the pelvis)
• The handedness: right hand or left hand... or both!
• The "attack" type: here, a medium throw or a far throw.
• The hand pose: select from a library of 18 (so far) hand poses, or any point in-between neighboring poses.
If you wanted to show the Citizen carrying a crate, your code would ask the Animgraph for a handedness of 2H, you'd set the body pose to 4 and the hand pose to 0.02, then you'd parent a crate model to the attachment named "middle_of_both_hands", which is always positioned in the middle of an imaginary line traced between both hands of the character!
If you wanted to show a grenade weapon, you'd instead set the handness to RH, the body pose to 1, the hand pose to 0.11, and you could switch the "attack" type between 1 and 2 depending on whether or not you want a small throw and a large throw (kind of like in the Counter-Strike games!)
attribute 'contenteditable' not allowedattribute 'blocktype' not allowed
There are compromises to find in the implementation of these systems: for example, I was envisioning, at first, a system that would use a variety of floats (bend/curl/roll/spread) so that you could control the pose of each finger very precisely. But... for now, a bunch of pre-made poses is "good enough", and in the future, it might just make more sense to just let people who want to have such precise control to somehow do it via code!
As the systems get extended in such ways, I find shortcomings to solve... well, that's really just a nicer way to say "decisions I took earlier are now getting in my way." And it's a matter of continuing to iterate more and more on them! ??
These parameters will spread to other holdtype branches; next on my list is being able to switch between a 2-handed and 1-handed (RH) pistol!