Garry's Mod

Garry's Mod

113 ratings
[Lua lib.] $poseparameter
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Model
Addon Tags: Cartoon, Roleplay
File Size
Posted
Updated
12.116 KB
15 Apr, 2020 @ 8:14am
20 Oct, 2020 @ 8:35am
4 Change Notes ( view )

Subscribe to download
[Lua lib.] $poseparameter

Description
/// This library is a resource for future addons, but it is also an optional requirement if you wish to be able to see custom poseparameter sequence-blends where possible, for that extra bit of attention to detail. Models will still work perfectly fine without it, however. ///

What is this addon?
With Garry's Mod you typically only have a handful of poseparameters defined within its standard code to apply to a playermodel. These include 9-blend movement of the entirety or parts of the playermodel, the yaw and pitch of the head, rollercoaster animations and rotating the grip along the steering wheel of a vehicle. Beyond this, there is little else to hook into, which I personally felt was quite a shame because there is a lot of potential left unused.

This addon defines *NEW* pose-parameter rules that are maintained entirely on the client realm, which allows models to spark more expressive features and livelihood than ever before, assuming that the model utilises them.

With this library of new poseparameters published, any content creator can pick up from this documentation and follow along to make their models more expressive as a result, just like I myself have always sought to do, step by step.

Subscribing to this mod ensures that you are able to experience these new boundaries of animations and sequence blends where possible; as not seen previously in Garry's Mod with previous models or valve_biped standards.

Addons currently utilising this library (made by me):
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2061992305
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2061999849

/// FOR CONTENT CREATORS /// What poseparameters are now included and how do I apply them to my models?
Defining new poseparameters to the qc-file of your compiled library works identically as with any of the previously available poseparameters, however I strongly recommend copying the preset syntax in this text and applying it identically to your model so as to ensure that everything works the way it is supposed to. The high and low bounds are set as they are for a reason, so please inherit the $poseparameter lines below as they are provided, with no tweaking.

1. Horizontal velocity
Same principle as rollercoaster animations, but it is instead being based on the horizontal plane. It is based on the player's velocity, as in how fast they are zooming along the ground with vertical velocity working independently. Can be used to have the character brace for a high-speed impact, as an example.
$PoseParameter "horizontal_velocity" -1 1 0
Example:
$Sequence "sit_rollercoaster" { "sit_fast_x" "sit_fast_x" "sit_fast_x" "sit_fall_z" "a_sit" "sit_fall_z" "sit_fast_x" "sit_fast_x" "sit_fast_x" activity "ACT_GMOD_SIT_ROLLERCOASTER" 1 blend "vertical_velocity" -1 1 blend "horizontal_velocity" 1 -1 fadein 0.2 fadeout 0.5 fps 30 addlayer "head_rot_y_01" addlayer "head_rot_z_01" loop }
2. Vitality
This poseparameter is directly tied to the current vital signs of the player, meaning that as the player accumulates or loses health, an expression can be blended to and from to simulate an expression of pain or distress, as well as confidence and security.
$PoseParameter "vitality" -100 100 0
Example:
$Sequence "vitality_01" { "health_low" "default" "health_high" blendwidth 3 delta fadein 2 fadeout 2 // hidden fps 30 blendcenter "default" blend "vitality" -100 100 // This subtract line guesses the animation name and frame index. There is no way to determine which $animation and which frame was used. Change as needed. subtract "default" 0 weightlist "weights_face" }
3. Idling (Combat stances)
This poseparameter uses a complex mathematical function f(x) to blend between states, where x represents time accumulated since the last combatant action was taken. This means that as time passes from the player performing a combat-oriented action, the playermodel may blend towards a less tense position, or even put their gun to the side, assuming that the player isn't actively aiming down their sights, pulling the trigger, or reloading their weapon, among other things.
$PoseParameter "idling" -200 0 0
Example:
$Sequence "idling_01" { "a_idle_long" "default" blendwidth 2 delta fadein 2 fadeout 2 // hidden fps 30 blendcenter "default" blend "idling" -200 0 // This subtract line guesses the animation name and frame index. There is no way to determine which $animation and which frame was used. Change as needed. subtract "a_idle" 0 weightlist "weights_aim" }

Other poseparameters are currently in the works and may likely be added to the library in the future.
Expect upcoming publications on my workshop to make rigorous use of this library where it is possible.
13 Comments
Evoliflöckchen 5 Sep, 2022 @ 6:23pm 
i still cant download the characters:steamthumbsdown:
Carlos Lopez 15 Oct, 2020 @ 9:19am 
@Mailer It's cool.
Mailer  [author] 15 Oct, 2020 @ 8:51am 
@Carlos Lopez - Should be fixed now. I am sorry it took so long for me to get back to it.
Carlos Lopez 9 Jun, 2020 @ 11:21pm 
Sometimes when I hit a player or I get hit in multiplayer, I get this error.

[[Lua lib.] $poseparameter] lua/autorun/client/poseparameter_lib.lua:357: attempt to perform arithmetic on field 'originalhealth' (a nil value)
1. v - lua/autorun/client/poseparameter_lib.lua:357
2. unknown - lua/includes/modules/hook.lua:84

Can you help me figure out what's causing this? Thanks!
Rit 20 Apr, 2020 @ 12:22pm 
oh now i see, thanks
Mailer  [author] 20 Apr, 2020 @ 12:07pm 
@[SBCPC] Ritalio - Steam imposes a 2 MB limit. Thankfully the focus only really needs to be on the ears as they gradually raise.
Rit 20 Apr, 2020 @ 11:48am 
Why is the preview gif for the addon so small
Mailer  [author] 20 Apr, 2020 @ 1:18am 
@GIGABABAIT - Almost certainly, yeah. The valve_biped standard is renowned for not letting itself be customized very early. But you'd also have to decompile the animation set itself and make your own of that as well, since you need to tell which sequences should be assigned to which poseparameters and so on. Though thankfully once you've done that you won't have to do it again since any further models can just include the same custom animation set again in the future; if that is any consolation.
80Hg 20 Apr, 2020 @ 12:26am 
Really nice! I assume implementation of things like this in default playermodels would require decompilation, right?
-.- 17 Apr, 2020 @ 11:57pm 
jkkil