Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HL/CS] Adding new client message : ViewModel #199

Open
Arkshine opened this issue Feb 16, 2013 · 15 comments
Open

[HL/CS] Adding new client message : ViewModel #199

Arkshine opened this issue Feb 16, 2013 · 15 comments

Comments

@Arkshine
Copy link

Small feature but still one of the most wanted functionality people would like to see : having the possibility to change render properties of the view model, through a new message named ViewModel.

Proposed code :

hud.h

class CHud
{
    public:

    [...]
    void _cdecl MsgFunc_ViewModel( const char *pszName, int iSize, void *pbuf );
    [...]
};

hud.cpp

void __MsgFunc_ViewModel(const char *pszName, int iSize, void *pbuf)
{
    gHUD.MsgFunc_ViewModel( pszName, iSize, pbuf );
    return 1;
}

void CHud::Init( void )
{
    [...]
    HOOK_MESSAGE( ViewModel );
    [...]
}

hud_msg.cpp

void CHud::MsgFunc_ViewModel( const char *pszName, int iSize, void *pbuf )
{
    BEGIN_READ(pbuf, iSize);
    cl_entity_t *view = gEngfuncs.GetViewModel();
    if ( view )
    {
        view->curstate.rendermode       = READ_BYTE();
        view->curstate.renderfx         = READ_BYTE();
        view->curstate.rendercolor.r    = READ_BYTE();
        view->curstate.rendercolor.g    = READ_BYTE();
        view->curstate.rendercolor.b    = READ_BYTE();
        view->curstate.renderamt        = READ_BYTE();
        view->curstate.skin             = READ_BYTE();
        view->curstate.body             = READ_BYTE();
    }
}

There is no need to register it on the server, that's something the coders will do themselves.
I think it's a reasonable feature, easy to review/implement, and will be in favor of a better gameplay immersion (it reminds me quake!).

As side-note, it has been tested on HL by someone and me and we can confirm it's working fine.
Proof:

Thanks for considering this cool feature.

@ghost ghost self-assigned this Feb 16, 2013
@bogdyutzu
Copy link

+1 For this. Will be cool if is possible to set also the body of view model

@Arkshine
Copy link
Author

Nevermind my last sentence about not working for me. It works now, the reason was I was not up-to-date and was still using old game location.

@bogdyutzu : I guess it could be useful, I've edited the first post.

@Egon-Spengler
Copy link

100% agree with this feature request, it would be amazing to see this added and it would open up a whole new world of fun possibilities for coders and players.

@dystopm
Copy link

dystopm commented Feb 17, 2013

Awesome request.

Also, would be good to set a param to reset it's values, and another client message "WeaponModel" which will be the same for p_* models, don't you think?

@StarsailorAMX
Copy link

Sexy

@DeMNiX
Copy link

DeMNiX commented Apr 23, 2019

bump

@RauliTop
Copy link

Really cool.

New possibilities to scripters

@oaus
Copy link

oaus commented Apr 24, 2019

@mikela-valve Is it possible to add for the next release?

@mikela-valve mikela-valve assigned mikela-valve and unassigned ghost Apr 25, 2019
@mikela-valve mikela-valve added this to the Future Release milestone Apr 25, 2019
@Droads2
Copy link

Droads2 commented Apr 25, 2019

Please, if this functionality is implemented, if possible, make support for integer values, instead of byte arguments.

@afwn90cj93201nixr2e1re
Copy link

It's not a good idea.
Now we set viemmodel at client-side thru precache list idexes.
@mikela-valve

@x-Eagle-x
Copy link

x-Eagle-x commented Jun 14, 2019

This solves yet another mystery, there was a thread on amdd about changing view-models rendering years ago, and it's confirmed to be possible.
Good work everyone who worked on this, especially Arkshine for sharing it.

@SmiteIsTrashBro
Copy link

So, any news on this? Have been waiting for this feature

@DarthMan
Copy link

DarthMan commented Dec 9, 2020

On TFC only, it's possible to render viewmodels, all you gotta do is set render mode for the player entity.

SaintWish added a commit to MSRevive/MasterSwordRebirth that referenced this issue Nov 27, 2021
@ab2331
Copy link

ab2331 commented Mar 22, 2023

        view->curstate.skin             = READ_BYTE();
        view->curstate.body             = READ_BYTE();

should be long instead of byte allowing more combinations of submodels

        view->curstate.skin             = READ_LONG();
        view->curstate.body             = READ_LONG();

@rtxa
Copy link

rtxa commented Nov 21, 2023

Now it would be the time to implement this in the 25th anniversary update for mod-makers considering how easy to implement and review is this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests