Author |
Topic: thermal vision (heat detection) |
uprize |
General Member Since: Jan 13, 2008 Posts: 24 Last: Oct 23, 2008 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Monday, Oct. 20, 2008 05:10 am |
|
I am interested in incorporating a feature into my mod for Thermal Detection, similar to nightvision except it is heat detection instead.
Im sure it would possible, so does anyone have any ideas/links that may help? If someone already has something similar that I can use I would be grateful and will give credit.
Cheers |
|
|
|
JerryTube |
|
General Member Since: Mar 4, 2007 Posts: 88 Last: Jul 1, 2013 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Monday, Oct. 20, 2008 07:23 am |
|
Heres my basic script,
Code: player_setup()
{
level.HUDItem[ "thermal_mode" ] = newHudElem();
level.HUDItem[ "thermal_mode" ].x = -80;
level.HUDItem[ "thermal_mode" ].y = 50;
level.HUDItem[ "thermal_mode" ].alignX = "right";
level.HUDItem[ "thermal_mode" ].alignY = "top";
level.HUDItem[ "thermal_mode" ].horzAlign = "right";
level.HUDItem[ "thermal_mode" ].vertAlign = "top";
level.HUDItem[ "thermal_mode" ].fontScale = 1.75;
level.HUDItem[ "thermal_mode" ].alpha = 1.0;
level.HUDItem[ "grain" ] = newHudElem();
level.HUDItem[ "grain" ].x = 0;
level.HUDItem[ "grain" ].y = 0;
level.HUDItem[ "grain" ].alignX = "left";
level.HUDItem[ "grain" ].alignY = "top";
level.HUDItem[ "grain" ].horzAlign = "fullscreen";
level.HUDItem[ "grain" ].vertAlign = "fullscreen";
level.HUDItem[ "grain" ].alpha = 0.4;
level.HUDItem[ "grain" ].sort = -3;
level notify( "blinking_weapon_name_hud_elem" );
level endon( "blinking_weapon_name_hud_elem" );
if ( !isdefined( level.HUDItem[ "thermal_mode" ] ) )
return;
for( i = 0 ; i < level.HUDItem[ "thermal_mode" ].size ; i++ )
level.HUDItem[ "thermal_mode" ][ i ].alpha = 0.5;
level.HUDItem[ "thermal_mode" ].alpha = 1;
for(;;)
{
level.HUDItem[ "thermal_mode" ] fadeOverTime( 0.2 );
level.HUDItem[ "thermal_mode" ].alpha = 0;
wait 0.2;
level.HUDItem[ "thermal_mode" ] fadeOverTime( 0.2 );
level.HUDItem[ "thermal_mode" ].alpha = 1;
wait 0.2;
}
}
thermal_mode()
{
level.player endon( "death" );
inverted = "0";
level.player notifyOnCommand( "switch thermal", "+usereload" );
level.player notifyOnCommand( "switch thermal", "+activate" );
for (;;)
{
level.player waittill ( "switch thermal" );
if ( inverted == "0" )
{
set_vision_set( "ac130_inverted", 0 );
//if ( isdefined( level.HUDItem[ "thermal_mode" ] ) )
level.HUDItem[ "thermal_mode" ] settext ( "-THERMAL MODE-" );
level.HUDItem[ "grain" ] setshader ("ac130_overlay_grain", 640, 480);
inverted = "1";
}
else
{
set_vision_set( "normal", 0 );
level.HUDItem[ "thermal_mode" ] settext ( &"" );
level.HUDItem[ "grain" ] setshader ("");
inverted = "0";
}
}
}
You might have to change it a bit to work with MP, and you also have to precache the shaders. |
|
|
|
uprize |
General Member Since: Jan 13, 2008 Posts: 24 Last: Oct 23, 2008 [view latest posts] |
|
|
|
xholyx |
|
General Member Since: Oct 17, 2007 Posts: 116 Last: Sep 7, 2010 [view latest posts] |
|
|
|
Sevenz |
|
General Member Since: Apr 24, 2006 Posts: 2390 Last: May 10, 2013 [view latest posts] |
|
|
|
ITOE_MC |
General Member Since: Sep 3, 2006 Posts: 342 Last: Nov 12, 2009 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Wednesday, Oct. 22, 2008 07:04 pm |
|
Quote: and how does the mp night vision work? is it hardcoded?
There's no .vision file for it, and I never could find a .gsc in the raw files that obviously dealt with it. |
|
|
|
uprize |
General Member Since: Jan 13, 2008 Posts: 24 Last: Oct 23, 2008 [view latest posts] |
|
|
|
_INSANE_ |
|
General Member Since: Nov 7, 2008 Posts: 352 Last: Jul 10, 2011 [view latest posts] |
|
|
|
|