Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 67 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: thermal vision (heat detection)
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
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 [pimp]
Share |
JerryTube
General Member
Since: Mar 4, 2007
Posts: 88
Last: Jul 1, 2013
[view latest posts]
Level 3
Im a fan of MODSonair
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.
Share |
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Monday, Oct. 20, 2008 07:51 am
Hi Mr Grain

Where exactly do I call that in my script? Woud it be possible for you to PM me an example of it working so I can see how it was implemented? Thanks.
Share |
xholyx
General Member
Since: Oct 17, 2007
Posts: 116
Last: Sep 7, 2010
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Wednesday, Oct. 22, 2008 12:30 pm
notifyoncommand is SP only, dunno if u want singleplayer Uprize...
also set_vision_set wont set the vision in mp, and if it will (with visionsetnaked("visionfile") ) then it will change for everybody
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Wednesday, Oct. 22, 2008 04:08 pm
and how does the mp night vision work? is it hardcoded?
Share |
ITOE_MC
General Member
Since: Sep 3, 2006
Posts: 342
Last: Nov 12, 2009
[view latest posts]
Level 5
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.
Share |
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Oct. 22, 2008 10:13 pm
this is for MP not SP.
I am sure it must be possible, wouldn't it be something similar to the nightvision setup?
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Monday, Dec. 1, 2008 02:24 am
The best i could do for myself was keep editing the color settings and have it inverted to kinda give you that ''feel'' of heat vision.... only its not... but It kinda gets you close.

Just edit the default_night.vision file to some settings you like, and upload it into your mod.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»