Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/sites/a/ on line 20
Wavelength | Your Game Editing Resource | Entity Effects on View Model
Welcome, Guest! Login | Register

Entity Effects on View Model [Print this Article]
Posted by: omega
Date posted: Apr 26 2003
User Rating: 5 out of 5.0
Number of views: 7161
Number of comments: 4
This is a really simple tutorial; I wrote this a while back, and the original version was quite large. This simplified version is literally tiny, for what it does.

When you add this code, your view model (v_weapon.mdl) will take on the same properties as the character has. If the player has a glowshell, the v_ model will have a glowshell with identical settings. You can change this so that it doesn't rely on the player itself, ie: to make an overloading effect as seen in Gunman Chronicals.

Simply open up view.cpp and step inside V_CalcNormalRefDef

and make this change.

right after:

    // view is the weapon model (only visible from inside body )
    view = gEngfuncs.GetViewModel();


    view->curstate.rendermode       = ent->curstate.rendermode;
    view->curstate.renderfx         = ent->curstate.renderfx;
    view->curstate.rendercolor.r    = ent->curstate.rendercolor.r;
    view->curstate.rendercolor.g    = ent->curstate.rendercolor.g;
    view->curstate.rendercolor.b    = ent->curstate.rendercolor.b;
    view->curstate.renderamt        = ent->curstate.renderamt;

Simple huh?

Rate This Article
This article is currently rated: 5 out of 5.0 (1 Votes)

You have to register to rate this article.
User Comments Showing comments 1-4

Posted By: Jorg40 on Apr 27 2005 at 19:01:55
I shall remove the "?"s right?

Posted By: Revvy on Apr 28 2005 at 14:49:09
Yeah, that's a problem that seems to have popped up in a bunch of tutorials. I think they're tab characters not showing up right.

Posted By: Jorg40 on Apr 29 2005 at 14:31:23
But the wholde code doesnt work at all, I have added my own code in the satchel code that the player will be cloaked when fire, but the model dont get transparent by adding your code at the right place. :(

So I dont know what to do...Edited by Jorg40 on Apr 29 2005, 20:09:48

Posted By: Jorg40 on May 01 2005 at 16:27:12
I mean the weapon model...

You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005

Latest Comments
knock knock
General | News
By: MIFUNE | Dec 31 2017
knock knock
General | News
By: omega | Dec 22 2016
knock knock
General | News
By: MIFUNE | Oct 10 2015
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
knock knock
General | News
By: Whistler | Nov 05 2011
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (1 guest)
About - Credits - Contact Us

Wavelength version:
Valid XHTML 1.0! Valid CSS!