Porting L4D2 weapons (skins included) to 13's viewmodel system.

Hey, this isn’t a request thread, but, if anyone was looking to use L4D2 weapons and skins in garrysmod 13, I can port them over and fix all the animations to get it working with 13’s consistent viewmodel system. (I’m terrible at coding)

Here’s what they look like without fixing.

http://cloud-4.steampowered.com/ugc/615042282616027277/DC4455DAAC258F082821A7A455EFBA766B10D1AC/[/t]

As you can see, the thumbs are screwed up, as well as L4D2 uses different Activity names for its guns unlike CSS.

Here’s a scar skin with the thumbs fixed, and all animations played correctly. (including sounds)

[t]http://cloud-3.steampowered.com/ugc/615043645855285129/01A0DB4E7D43AF74F59F299CC0D190CB8A9BA322/[/t]

As you can see, it works with the hands system.

[t]http://cloud-2.steampowered.com/ugc/612791762199154587/AEE46330F984822D457203916BC000F4B9BD71A4/

If this is the wrong section, please do direct me to the right one. I thought about the modelling section, then realized a lot of coders don’t really go there, so I decided to post here.

This sounds like it could be really useful, personally I’d love to see the models fixed up.

I can also fix the world models as they use a different attachment bone.

Also I can rig stuff like swords to the animations (katana and whatnot) so you can slash stuff.

My friend is working on a l4d2 weapons pack atm, and to get the animations to work he basically abuses sequences.

Abuses sequences? What?

Anyway, adding ACT enums for view models isn’t really a problem.

He uses resetsequence instead of SendWeaponAnim.

You can fix all of this in Lua, I’ve done it before and put some L4D2 skins of weapons on a server. And you can use SendWeaponAnim just fine for most of them. Like for bashing: use ACT_VM_SECONDARYATTACK, melee weapons use ACT_VM_HITCENTER for swinging animations.

Finger bones are a bit hard to fiddle with though

The base bone just needs to be rotated to be at the correct anatomical angle, I did it before in the GetViewModelPosition hook, but I don’t have the angles I used to correct this, since I ended up removing it anyway since it was pretty hard to notice on the melee SWEPs I used.

Well I tried it with SCK but no matter how much I fiddle with some of the bones I can never get it to look 100% right.

I did it as an offset of the angle to the wrist (or whatever bone is the large hand bone, I forgot which one) bone, that way it’s always in the right position. And you have to use that hook because while the view model animates you need to update this angle offset.

This isn’t abusing, this is what you are supposed to do if there are no ACTs available. Although it is recommended to use http://wiki.garrysmod.com/page/Entity/SendViewModelMatchingSequence instead of ResetSequence for view models.

Why? The wiki claims there is virtually no difference.

That’s what _Kilburn told me.

[editline]26th February 2014[/editline]

The wiki didn’t claim that “there is virtually no difference.”, it said that there seems to be none. I updated the page.

I can add or remove the ACT_ sequences, and I can also rename activities or sequence names. It’s not hard at all. Also I can rename the gun sounds and when they activate for specific purposes.

Basically how I fix the bones, is I decompile them, rotate the bone 180 degrees, and mirror the rotation animations on the y and z axis.

You can only use ACTs that are defined with Lua. Otherwise additional Lua trickery is required.

Indeed, but for simplicity’s sake I can use the CSS activities.