Implementing Script to Drive Boneflexdrivers

I’m a 3D modeler by trade so this isn’t much my game.
I’ve been working for the past few on some vertex animations which I’ve gotten working just fine in SFM, but would like to get things going in Garry’s Mod. Unfortunately the boneflexdrivers aren’t supported by Gmod, even though it’s apart of the 2013 SDK.

I did however find someone else’s script which I believe is meant to emulate the flexdrivers through GLua, though when placing it in an addon it throws
“attempt to index global ‘matproxy’ (a nil value)” on line 11 of the script.

GLua gives me a headache. My only idea is that it needs to be tied onto a specific entity? Which makes me question why the developer placed the script in the autorun folder though. Any help would be appreciated.

Are you sure you are running the code clientside? You are probably running the code serverside

I think you’re right, the file is placed under autorun/client, it must be operating fine because it only happened when I tried opening using lua_openscript, rather than when I start a server, which I ran because I didn’t see any changes, (I see now there is a lua_openscript_cl which I presume just runs the script on the client.)

The script must just not do what I expected, so I may have to scrap my plans.

Yeah, that’s why. The script is probably working fine, you don’t need to do lua_openscript_cl on it.
Have you actually implemented the material proxy in the material of the entity? I have no idea what are you trying to achieve, but you need to define a material proxy in the material.

For example, add this in the vmt:

Proxies {
     BoneFlexDriverProxy {
          boneflexdrivers "input the values here"
1 Like

Ah that makes sense, I didn’t realize you could actually make new proxies through Lua. I’ll look through to see what inputs I need and give that a shot.