Garry's Mod

Garry's Mod

131 个评价
Auto-Flashlight
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 特效
插件标签: 角色扮演, 风景
文件大小
发表于
更新日期
6.424 KB
2023 年 9 月 18 日 下午 8:02
2023 年 9 月 21 日 下午 1:13
2 项改动说明 ( 查看 )

订阅以下载
Auto-Flashlight

描述
Auto-flashlight will automatically switch your flashlight on when you are in dark areas, and will switch it off when in brighter areas.

Settings are available in the spawnmenu under Options -> Auto-Flashlight -> Settings.

However, if you prefer to use console variables:

  • cl_flashlight_auto (0/1): Whether or not auto-flashlight is enabled.
  • cl_flashlight_auto_threshold (0 .. 0.5): The threshold for the automatic flashlight to trigger. Higher values mean the flashlight will activate in brighter areas.
  • cl_flashlight_auto_frequency (0.05 .. 2): How often Auto-Flashlight should check to see if the player is in darkness.

Should work just fine with addons such as Third-Person Flashlight.

Comes with a basic developer API if developers want to change the functionality of how it works.

Flashlight icon credit: https://www.iconfinder.com/icons/10948174/
14 条留言
ph0roggy 1 月 25 日 上午 10:58 
what the guy said below, that would be genius
PÖIЙ† βLΛЙK 2024 年 5 月 3 日 下午 8:26 
Someone should add a setting where the flashlight is perpetually on, but the brightness fades in and out based on current light levels
Kendrick Lamar 2023 年 11 月 3 日 下午 2:08 
epic mod
:steamthumbsup:
Sr. Antônio! 2023 年 9 月 23 日 上午 11:56 
perfect!
Yavuzhan 2023 年 9 月 22 日 上午 11:28 
Yeah this is really sweet, good job!
ATP-1002 2023 年 9 月 22 日 上午 3:01 
This is some high-level coding where the game knows what to do when Y is near or around X with needing a map script.
Fantastic job!
Lombaxtard 2023 年 9 月 21 日 下午 1:16 
That should be enough
Thanks a lot for that :steamthumbsup:
Chev  [作者] 2023 年 9 月 21 日 下午 1:15 
I added the ability to change the frequency of the check. The minimum value is 0.05 seconds and maximum is 2 seconds.
Lombaxtard 2023 年 9 月 21 日 下午 12:22 
If you can, please
Even this simple check can add up and impact frames heavily, especially on a crappy cpu such as mine
Chev  [作者] 2023 年 9 月 21 日 下午 12:21 
Right now it runs every 0.1 seconds. The script is fairly lightweight so it shouldn't have a big performance impact. The main annoyance I've noticed so far is if you're going through light and dark areas really fast, the flashlight will flicker on and off. I could probably add a setting to adjust the timer frequency.