Garry's Mod

Garry's Mod

890 个评价
Better Flashlight [v1.0]
2
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 特效
插件标签: 快乐, 角色扮演, 风景
文件大小
发表于
更新日期
376.202 KB
2 月 13 日 上午 11:43
7 月 20 日 下午 3:55
8 项改动说明 ( 查看 )

订阅以下载
Better Flashlight [v1.0]

描述
A simple script to enhance the HL2 flashlight, in third person the flashlight will always come from the player's view instead of the player model's hand, gives players the ability to choose a custom color and texture for it, and some more

For Developers
This addon overrides the behavior of the default flashlight, but I made sure you can still check for the player's flashlight.

Instead of using Player:FlashlightIsOn() you can use Player:GetNWBool("FlashlightIsOn"), Player:FlashlightIsOn() will always return false if the user is using this addon

The addon respects the Player:CanUseFlashlight() property and runs the PlayerSwitchFlashlight event to check if the player can switch it's flashlight on or off.

As for sound, it does not use or add a custom sound, it uses the default HL2 soundscript "HL2Player.FlashLightOn" and "HL2Player.FlashLightOff", so basic sound replacements should work.

Client ConVars
Name
Default
Purpose
cl_betterflashlight_local_player_only_shadows
1
If set to 1, only your flashlight will cast shadows
cl_betterflashlight_local_player_only_hl2_style
0
If set to 1, only your flashlight will "pullback" when too close to a wall or object, ignoring other players settings
cl_betterflashlight_glow
1
If set to 1, player flashlights will emit a glow when looked at
cl_betterflashlight_beam
1
If set to 1, player flashlights will emit a visible beam
cl_betterflashlight_beam_alpha
100
The transparency of the beam of a player flashlight
cl_betterflashlight_config_r
255
Your flashlight's color. Red component
cl_betterflashlight_config_g
255
Your flashlight's color. Green component
cl_betterflashlight_config_b
255
Your flashlight's color. Blue component
cl_betterflashlight_config_a
255
Your flashlight's color. Alpha component. NOT USED.
cl_betterflashlight_config_near_z
96
Your flashlight's extra near-z distance, this will try to avoid casting your own shadow
cl_betterflashlight_config_angle_lerp
0
Your flashlight's smooth turning factor, 0 is disabled
cl_betterflashlight_config_fov
60
Your flashlight's field-of-view
cl_betterflashlight_config_texture
"effects/flashlight001"
Your flashlight's texture.
cl_betterflashlight_config_hl2_style
1
Your flashlight's HL2-style setting.

Server ConVars
Name
Default
Purpose
sv_betterflashlight_override_default
1
Enable or disable overriding the default flashlight
sv_betterflashlight_follow_viewpunch
1
If set to 1, player flashlights will follow their viewpunch
sv_betterflashlight_disable_in_vehicle
0
Not recommended, buggy. If set to 1, flashlight is always off when in a vehicle
sv_betterflashlight_disable_in_vehicle_only_driver
1
Works with setting above, the restriction will only apply if you are the driver of the vehicle
sv_betterflashlight_debug
0
Debug overlays, only works with sv_cheats and developer ConVars
127 条留言
🕊 Peace&Death ⚰ 12 月 6 日 下午 10:32 
♥♥♥♥♥ не работает
Kris The Moss Collector 12 月 3 日 下午 9:37 
my only issue is any addon that uses the original flashlight like the aux power mod that adds the episode 2 standalone flashlight battery or map events that turn off your flashlight dont seem to work most likely because of this "Instead of using Player:FlashlightIsOn() you can use Player:GetNWBool("FlashlightIsOn"), Player:FlashlightIsOn() will always return false if the user is using this addon"
nugett 11 月 20 日 下午 7:53 
does this work with dynamic flashlight mod?
LennySmash 11 月 17 日 上午 9:17 
Its me or there was an option to change the light position on the character (head,hands) and its not here anymore ?
ThatGeekyNoLife 11 月 15 日 下午 7:34 
well it used to work and i guess not anymore, i am on the x64 branch but I really wish it still had old features before v1.0 like the option to choose where the flashlight comes from, it was pretty useful and a cool feature, i always had it on my hand, hopefully it comes back someday
Moldiverse 11 月 2 日 上午 6:52 
Goat
Ozkii 10 月 28 日 下午 5:42 
thats oki, tho i did tried the default value, 96, even tried higher ones, but i would still see my PM's shadow, even after doing Send too. Btw my model was the P2 Chell one, so i doubt it can cause an issue?? Thats why it should be double-checked, it would be very weird that it only works for you?
Liokindy  [作者] 10 月 28 日 下午 3:25 
I will work on it and add a far z option when I have the time
Liokindy  [作者] 10 月 28 日 下午 3:22 
I tested multiple playermodels with weird and normal proportions and yeah, they cast their own shadow, that's why I set the default near Z high and made it adjustable. I haven't ran into issues like "the flashlight getting stuck behind the head" due, unless they mean the head casting shadows
Liokindy  [作者] 10 月 28 日 下午 3:21 
This is why I made it a setting, and also the ability to turn off shadows.