• Viewmodel Animations Help
    7 replies, posted
How would I go about changing the position of the left hand on viewmodels?
[QUOTE=DrunkSquirrel;46610609]How would I go about changing the position of the left hand on viewmodels?[/QUOTE] The only way that I know of is to decompile the hand view model and change the position there. But I guess there's another way of in-game bone tweaking.
You can change it with Swep Construction Kit but it will not be a model but only script which can be placed in weapon code. It will only work for swep not a single model!!!!
[QUOTE=JakusPL;46619518]You can change it with Swep Construction Kit but it will not be a model but only script which can be placed in weapon code. It will only work for swep not a single model!!!![/QUOTE] That honestly depends on the model and if it even has the bone.
[QUOTE=baldursgate3;46611817]The only way that I know of is to decompile the hand view model and change the position there. But I guess there's another way of in-game bone tweaking.[/QUOTE] Sorry if the question was a bit vague, but I'm needing to do this in Lua. I'm trying to make it so I can have "powers" used in first person. (IE. Launching flames from your hand, etc)
[QUOTE=DrunkSquirrel;46621082]Sorry if the question was a bit vague, but I'm needing to do this in Lua. I'm trying to make it so I can have "powers" used in first person. (IE. Launching flames from your hand, etc)[/QUOTE] Take a look at this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/effects/stunstick_admin_baton_effects.lua.html[/url] Both of the hooks ( PostPlayerDraw and PostDrawViewModel ) will be what you'd need to "start" the effects if they attach to the player, ie flaming hands while active in thirdperson for others, and first-person for yourself. As for launching a fireball, you'd need another effect for that and SetVelocity on it ( an entity could be a good way of going about doing it, because it could be a resized "hoverball" as the core to detect touch and the flames could surround it from within the entity Draw function.
[QUOTE=Acecool;46621178]Take a look at this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/effects/stunstick_admin_baton_effects.lua.html[/url] Both of the hooks ( PostPlayerDraw and PostDrawViewModel ) will be what you'd need to "start" the effects if they attach to the player, ie flaming hands while active in thirdperson for others, and first-person for yourself. As for launching a fireball, you'd need another effect for that and SetVelocity on it ( an entity could be a good way of going about doing it, because it could be a resized "hoverball" as the core to detect touch and the flames could surround it from within the entity Draw function.[/QUOTE] This helped because I was unclear with how the effects are gonna work and I see this is a great example :D! Okay so that out of the way, the only thing left is to manipulate the viewmodel hand/bone, any tips/clues?
You can try outputting the bones.. I'm not sure if viewmodels have them in the hands or not as I've never messed with them, but a simple output would confirm or deny... Bone functions: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/wiki_links/bone.html[/url] The ones to look at first would be: Entity:GetBoneCount ( Entity:GetModelPhysBoneCount wouldn't work because the viewmodel isn't a physics model; the player entity would have a physics model though unless player isn't yet initialized ), Entity:GetBoneName, etc.. You'd use a numbered for loop starting at 0 ending in n - 1, or starting at 1 and ending at n; can't recall for bones.. Something like this: [code]local _p = LocalPlayer( ); local _vm = _p:GetViewModel( ); for i = 0, _vm:GetBoneCount( ) - 1 do print( "Bone Name: ", _vm:GetBoneName( i ) ); end[/code] You should be able to determine if they're hand bones..
Sorry, you need to Log In to post a reply to this thread.