Raised This Month: $ Target: $400
 0% 

SetViewModel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 15:16   SetViewModel
Reply With Quote #1

Now, what i want to make is a plugin that allows you to change the view model of the player. Example that the knife model weapon will be switch to an custom one.

206 CBaseCombatWeapon::SetViewModelIndex(int)
209 CBaseCombatWeapon::SetViewModel()

Are the functions i need to use i think. And the problem i'm having is that i'm not sure how to use it. Never realy tryed stuff with offsets and the only things i see it just changing a number or something. But this is a string i need to change or something. Also i don't know what the index one does.

Also don't know what to pick to get the offset.
FindSendPropOffs
FindDataMapOffs
FindSendPropInfo

SetEntDataString(entity, offset, const String:buffer[], maxlen, bool:changeState=false);

And this is prob the way to change the string.

Now what i wanna know is what i to do to get the info and how i can change it.

Thanks in advance!
V0gelz
__________________
V0gelz is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 03-31-2008 , 16:10   Re: SetViewModel
Reply With Quote #2

I've played with view models and was never able to get them to work. No matter what I did it seems to check the model for consistency against the original model and cause errors. It might be possible to change the knife model for EVERYONE (but that wasn't what I was trying to do ).
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 16:26   Re: SetViewModel
Reply With Quote #3

Like that the client doesn't allow commands like disconnect or other stuff beeing set by the server. But then again, how can you set a player model then. I saw its done true the sdk tools. Would there be the same function in the sdk tools to get this to work? Ill check the wiki page.
__________________
V0gelz is offline
TheDOO
Member
Join Date: Nov 2007
Old 04-03-2008 , 01:50   Re: SetViewModel
Reply With Quote #4

Quote:
Originally Posted by L. Duke View Post
I've played with view models and was never able to get them to work. No matter what I did it seems to check the model for consistency against the original model and cause errors. It might be possible to change the knife model for EVERYONE (but that wasn't what I was trying to do ).
Did it even check for consistency if sv_consistency was 0? I would think that would solve the problem temporarily. (Would let people use "cheat" models though, so that's not good)
TheDOO is offline
f64
Member
Join Date: Jun 2007
Location: Houston, TX USA
Old 08-29-2008 , 02:35   Re: SetViewModel
Reply With Quote #5

In DoD:S, Event_PlayerTeam changes the viewmodel skin to either skin1 (default)
or skin2. TF2 spy has 22 skins I think. Is this private code that changes this?

I can recompile my viewmodels to use many skins and rename the materials whatever I like.
The only thing missing is a way to say "use skin4".
__________________
Game: DOD:S
f64 is offline
Grrrrrrrrrrrrrrrrrrr
Senior Member
Join Date: Oct 2007
Old 09-01-2008 , 05:23   Re: SetViewModel
Reply With Quote #6

http://forums.alliedmods.net/showthread.php?t=76814 ?
__________________
Note: "r" letters = 19 ; CHEESE: I LIKE CHOCOLATE MILK
Grrrrrrrrrrrrrrrrrrr is offline
Send a message via AIM to Grrrrrrrrrrrrrrrrrrr
f64
Member
Join Date: Jun 2007
Location: Houston, TX USA
Old 09-01-2008 , 21:39   Re: SetViewModel
Reply With Quote #7

@Grrrrrrrrrrrrrrrrrrr,

Thanks for the link. I looked at that code and although I'm not a programmer or even a scripter,
I see that it appears to be switching a world_model instead of a view_model. It may be that the world_model
in DOD:S is linked via script to the view model, IDK.

I'm not asking how the view_model is switched or set, but rather, how the skin is being toggled.
This may be a client side script or untouchable code - again, IDK. Perhaps someone here knows or I would have to get a response from a Valve rep.

Switching skins obviously has the limitation of requiring the same reference model if you're sharing it between teams.
If you want a different reference model on each team , then you would have to set this different model.

edit:reference model info edit
__________________
Game: DOD:S

Last edited by f64; 09-01-2008 at 21:56.
f64 is offline
f64
Member
Join Date: Jun 2007
Location: Houston, TX USA
Old 09-02-2008 , 00:36   Re: SetViewModel
Reply With Quote #8

I meant to say that while there is a relationship between the world model and the view model,
I don't know if it's something that can be changed, judging by other posts.
That's why I was wondering about the skin toggle.

What does that linked script actually do.
__________________
Game: DOD:S
f64 is offline
Reply



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 20:47.


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