Raised This Month: $12 Target: $400
 3% 

Viewmodel bodygroup switch example


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hanna
Member
Join Date: Sep 2016
Old 09-04-2016 , 02:01   Viewmodel bodygroup switch example
Reply With Quote #1

This method forces game engine to think that in our hands there is no weapons. So we can completely rewrite the code of the main CS weapons. Why this way? Bcz
client side forces the animation replace 2 and not only. So we should completely resend everything from the server side to avoid bugs.
The way it's done is not very perfect, but it works in unique way, cz u can modify everything u want in simple way (not only view body switch, but damage, attack speed, recoil, rate and other).
There is three examples are attached, some people are saying the code is unreadable, but it's my style.

The blocking client side useful guide i found here (written by KCE):
https://forums.alliedmods.net/showthread.php?t=41265

From this thread, i've used method 1.

So, everything another part just was easy to complete. I' ve made 3 examples: knife, glock18, ak47.
You can put them together and test. While testing, use cl_lw 1 or 0 to see how it works.
I' ve seen once a person who made view body switch by another way, but it was buggy while using cl_lw 0. So...
Type in console switch_sex and set to 0 to view male hands. 1 is female.

Using this examples you can completely replace default CS weapon system and play with any bodygroup you want.

Updated: added shells, Glock18 Burst mode, removed some useless code again.
Updated: fix shoot event for other weapons, fix left-right hand auto switch
Attached Files
File Type: zip models.zip (1.12 MB, 381 views)
File Type: sma Get Plugin or Get Source (weapon_knife.sma - 1189 views - 3.3 KB)
File Type: sma Get Plugin or Get Source (weapon_glock18.sma - 1121 views - 6.8 KB)
File Type: sma Get Plugin or Get Source (weapon_ak47.sma - 1273 views - 5.1 KB)

Last edited by Hanna; 09-08-2016 at 16:34. Reason: A bit better description
Hanna is offline
Hanna
Member
Join Date: Sep 2016
Old 09-04-2016 , 16:11   Re: Viewmodel bodygroup switch example
Reply With Quote #2

Removed useless part of code from example files. So it's now more understandable. Download again and checkout.

Last edited by Hanna; 09-04-2016 at 16:12.
Hanna is offline
Hanna
Member
Join Date: Sep 2016
Old 09-04-2016 , 16:23   Re: Viewmodel bodygroup switch example
Reply With Quote #3

Tomorrow i will code all weapons.
So with all replaced weapons there will be no bug with knife and c4.
Hanna is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 09-04-2016 , 16:28   Re: Viewmodel bodygroup switch example
Reply With Quote #4

dont use CD_ID, stupid way.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Hanna
Member
Join Date: Sep 2016
Old 09-04-2016 , 16:41   Re: Viewmodel bodygroup switch example
Reply With Quote #5

Quote:
Originally Posted by Bos93 View Post
dont use CD_ID, stupid way.
Edit: Well, gonna test, found some ways.

Last edited by Hanna; 09-04-2016 at 19:32.
Hanna is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-05-2016 , 02:33   Re: Viewmodel bodygroup switch example
Reply With Quote #6

can you post a better desciprition? I understand nothing from the above one.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Hanna
Member
Join Date: Sep 2016
Old 09-05-2016 , 11:12   Re: Viewmodel bodygroup switch example
Reply With Quote #7

Quote:
Originally Posted by Craxor View Post
can you post a better desciprition? I understand nothing from the above one.
xD. Ok. A bit later. For now just short explanation.
1. To switch body on view model, first you need to make client think there is no weapon in our hands. Why? Because client sending anims too.
So we are using CD_ID in client update post and now emulating all weapons animations and fire 1 by 1 (like in examples).
I will include now knife with models.

Last edited by Hanna; 09-05-2016 at 11:14.
Hanna is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 09-05-2016 , 12:44   Re: Viewmodel bodygroup switch example
Reply With Quote #8

Quote:
Originally Posted by Craxor View Post
can you post a better desciprition? I understand nothing from the above one.
Same.

And the plugins it self are a TOTAL mess, its unreadable.
Syturi0 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 09-05-2016 , 12:51   Re: Viewmodel bodygroup switch example
Reply With Quote #9

Quote:
Originally Posted by Hanna View Post
xD. Ok. A bit later. For now just short explanation.
1. To switch body on view model, first you need to make client think there is no weapon in our hands. Why? Because client sending anims too.
So we are using CD_ID in client update post and now emulating all weapons animations and fire 1 by 1 (like in examples).
I will include now knife with models.
So basically what this does is:
- If i have for example, a Knife .mdl that have 5 different Knifes inside (on Body), i can freely switch them whiout animation bugs and stuff?
Syturi0 is offline
Hanna
Member
Join Date: Sep 2016
Old 09-05-2016 , 13:39   Re: Viewmodel bodygroup switch example
Reply With Quote #10

Quote:
Originally Posted by Syturi0 View Post
So basically what this does is:
- If i have for example, a Knife .mdl that have 5 different Knifes inside (on Body), i can freely switch them whiout animation bugs and stuff?
Right. No anim and body switch bug.
Hanna is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode