Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 07-28-2007, 01:41 PM   #1
Carbonis
 
 
 
Guest
Posts: n/a
Flashlight and Suit

Just a quick question this time...

Could anyyone direct me to the code or other file which deals with limiting the flashlight function to the suit - ie. the code which enable the player to use the flashlight only when the player is wearing the HEV suit.

Thanks!
 
Reply With Quote
Old 07-28-2007, 07:01 PM   #2
Keair
 
 
 
Guest
Posts: n/a
In the functions CHL2_Player::SuitPower_RemoveDevice and CHL2_Player::SuitPower_AddDevice (found in dlls/HL2_Player.cpp) there is a line that checks whether or not the suit is equiped. In both methods simply comment out the return command underneath those if statements and recompile.

This, in theory, allows you to use SuitDeviceBreather, SuitDeviceSprint, SuitDeviceFlashlight, which are all called into being through those functions. However, I think sprint has some other failsafes... I don't know about the breather, though.

If you don't care, then you're good. If you do, that's where the suit is stopping the flashlight.

You probably couldn't find where the code was because these methods were all called inside of if statement conditionals. A practice that I really discourage. It's too hard to read and doesn't really do anything horribly beneficial.
  Reply With Quote
Old 07-29-2007, 12:59 AM   #3
Carbonis
 
 
 
Guest
Posts: n/a
Thanks, now I can go and add my own additional suit item
  Reply With Quote
Old 08-08-2007, 04:55 AM   #4
Penumbra
 
 
 
Guest
Posts: n/a
There are some fail-safes for the Sprint functionality, but these are all located inside the same HL2_Player.cpp!
So, walk through the code and comment out the IsSuitEquiped() methods and you are going like a fast Gordon Freeman
  Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 08:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.