Left 4 Dead 2

Left 4 Dead 2

414 个评价
Stable Third-person Shotgun Sound Fix script
   
奖励
收藏
已收藏
取消收藏
Game Content: Scripts
文件大小
发表于
更新日期
4.282 KB
2 月 27 日 上午 8:06
3 月 3 日 上午 6:41
2 项改动说明 ( 查看 )

订阅以下载
Stable Third-person Shotgun Sound Fix script

描述
Another simple script I made way earlier, but decided to leave it unpublished as I thought someone's script would be better.
Years later, turns out that was not the case and VSLib was still used.
Why is it that all these shotgun sound fixes still use a library that conflicts with other versions of itself.
42 条留言
HazyAPI 11 月 5 日 上午 9:43 
Nice job! this is the only one works on the dedicated server. You can hear yourself and your teammates shotgun firing sound, whether in first-person or third-person perspective.
Unfortunately, in first-person view, the shotgun sound effect plays twice almost every time a shot is fired and i can't see the laser effect of my own gun in third-person view. :steamsad: Is there any way to solve this?
Wabisuke 10 月 30 日 上午 1:01 
@Shadowysn
Thanks for your information. Now I can confidently tackle more complex approaches.
Shadowysn  [作者] 10 月 30 日 上午 12:14 
@Wabisuke 4 Dead
I understand now. Unfortunately I know no method that can let you move the first-person camera around without moving the arms.
Wabisuke 10 月 29 日 上午 11:49 
@Shadowysn I meant to ask whether it would be possible to move the viewmodel camera independently of the arm.
Shadowysn  [作者] 10 月 29 日 上午 11:31 
I forgot to add that the origin and angles are all at or near 0,0,0 vector and angles for parented objects because they are displayed at their parent's origin and angles. Using origin from entity will offset the camera too much, you treat it like local origin and angles like Vector(0, 15, 0) or QAngle(15, 0, 0) for example.
Shadowysn  [作者] 10 月 29 日 上午 11:17 
@Wabisuke 4 Dead
No worry, I had to think about the questions for a while as I was busy roped in for half the day to exercise.

You can set the rotation and position of the camera with SetOrigin and SetAngles , but this has to be done after SetParent and SetParentAttachment .

I might not understand the second question exactly, but you could use SetOrigin just by itself for the camera.
Wabisuke 10 月 29 日 上午 10:50 
@Shadowysn I apologize for bothering you during your busy time, but I would appreciate it if you could answer these two questions to let me know only whether it's possible or not.
Wabisuke 10 月 28 日 下午 11:46 
@Shadowysn
Do you know how to change the rotation and positon of a viewmodel camera in VScript?

Is there a way to copy only the position of a camera when attaching it, without copying its rotation? This is because 30 ticks per second is insufficient for the camera's movement.
Wabisuke 10 月 27 日 上午 8:18 
@Shadowysn
Thank you! Your information is really helpful :health:
Shadowysn  [作者] 10 月 27 日 上午 8:16 
local client = Ent(1);
local viewModel = NetProps.GetPropEntity(client, "m_hViewModel");

local armsDyn = SpawnEntityFromTable("prop_dynamic", {
model = "models/weapons/arms/v_arms_bill.mdl",
solid = 0,
origin = client.GetOrigin(),
});

DoEntFire( "!self", "SetParent", "!activator", 0, viewModel, armsDyn );
NetProps.SetPropInt(armsDyn, "m_MoveType", 0);
NetProps.SetPropInt(armsDyn, "m_fEffects", (1 << 0)|(1 << 7)|(1 << 9)); // EF_BONEMERGE|EF_BONEMERGE_FASTCULL|EF_PARENT_ANIMATES