Nightvision effect - how to? Created 14 years ago2010-07-15 11:07:12 UTC by Tracker Tracker

Created 14 years ago2010-07-15 11:07:12 UTC by Tracker Tracker

Posted 14 years ago2010-07-15 11:07:12 UTC Post #283064
Hi!

I'd like to know how can I make a nightvision in HL? I suppose it involves some coding, but still, it must be possible, since it was implemented in Opposing Force and Counter-Strike. The second thing is, how can we change the color of nightvision? I think there should be a tutorial about this, or something. Thanks in advance,
  • Tracker
Posted 14 years ago2010-07-15 12:09:50 UTC Post #283065
Well depends on how you want to use it - If you want only the effect without the player having control over it, you can simply add an env_fade with the modulate flag and a light green colour (you can change the fade colour to anything you want). It will create the light green effect but You wont be able to use key commands to toggle it, only in hammer triggers. Another way would be coding ofc, though I'm not sure how to do that.
Skals SkalsLevel Designer
Posted 14 years ago2010-07-15 13:53:09 UTC Post #283066
I think the VDC has an article on this, im to lazy to search for it.
brendanmint brendanmintBrendan
Posted 14 years ago2010-07-15 14:12:01 UTC Post #283068
CS's and Op4's night vision goggles do more than just make everything green, they also increase brightness and contrast (I think).
Oskar Potatis Oskar Potatis🦔
Posted 14 years ago2010-07-15 16:45:28 UTC Post #283074
I remember op4's night vision being really weird. It acted as if a pointlight entity was following the character around. because things would just be green until you got close to them, then they'd get brighter. But I dunno, I don't know much about HL coding.
Posted 14 years ago2010-07-15 18:03:16 UTC Post #283076
perhaps you can create a code and then bind a key to it, which acts as an env_fade for the greenness and in console increases brightness and when turned off decreases it.
Skals SkalsLevel Designer
Posted 14 years ago2010-07-15 18:03:31 UTC Post #283077
perhaps you can create a code and then bind a key to it, which acts as an env_fade for the greenness and in console increases brightness and when turned off decreases it.

Double post?
Skals SkalsLevel Designer
Posted 14 years ago2010-07-15 21:56:01 UTC Post #283080
http://developer.valvesoftware.com/wiki/Vision_Nocturna
think its gldsrc

EDIT: never mind, i though nightfall was a gldsrc mod, its not.
brendanmint brendanmintBrendan
Posted 14 years ago2010-07-16 12:35:45 UTC Post #283095
The env_fade method works, except it has a limited time before it fades in/out. However, I found out in HL SDK that it is possible to change the code in a way I need, I only need to bind the effect to a key somehow. But it mustn't be impossible. (And I need some testing, too). So it is clear that Valve has provided us with the possibility of making Nightvision effects, we just need to implement it. All in all, I think I'll be able to do it now. (If not, I'll look for help again. :D)

EDIT: No luck at all. Somehow there is no way to compile the HL SDK 2.3 - without it, I just can't do that. BTW, the help files said

"Among others, the following parameters can be altered:
  • Support for "viewentity" ( i.e., seeing through the eyes of a specified entity )"
and in view.cpp I saw:

/*
// Example of how to overlay the whole screen with red at 50 % alpha
#define SF_TEST
#if defined SF_TEST
{
	screenfade_t sf;
	gEngfuncs.pfnGetScreenFade( &sf );
	sf.fader = 255;
	sf.fadeg = 0;
	sf.fadeb = 0;
	sf.fadealpha = 128;
	sf.fadeFlags = FFADE_STAYOUT | FFADE_OUT;
	gEngfuncs.pfnSetScreenFade( &sf );
}
#endif
*/

This is the key to success I think. Too bad I can't use it, because MSVC 5.0 can't compile it - maybe someone else can use it.
Posted 14 years ago2010-07-16 12:54:14 UTC Post #283099
HLSDK? MSVC? This is too much for my brain to handle.
Skals SkalsLevel Designer
Posted 14 years ago2010-07-16 13:34:37 UTC Post #283101
Why don't you just try mapping for op4?

I believe the nightvision thing is a sprite. try poking around the op4 sprites folder

the sprites that start with of_nv are the sprites. export the bmp's and change them to any color you want.
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 14 years ago2010-07-16 14:12:19 UTC Post #283103
The reason against op4 is that very few people play it nowadays. But I will check out the sprites folder anyway...
Posted 14 years ago2010-07-16 16:57:15 UTC Post #283119
Very few?

You kidding me? I see most of my buds play it almost every day!
Suparsonik SuparsonikI'm going off the edge to meet my maker.
You must be logged in to post a response.