Garry's Mod

Garry's Mod

Improved Crossbow Bolt
121 Comments
salmon for dinner 30 Jul @ 6:06pm 
I love you.
[C4]кружка 29 Jul @ 12:48pm 
if crossbow bolt could explode combine turret..
puhtato 5 Jul @ 7:29am 
another great thing about this mod is that admin cleanup actually deletes the bolt meaning you don't have a bunch of unremoveable bolts in your game
ValsdalV  [author] 3 Jun @ 12:44pm 
You can try setting all bolt damage options (both player and NPC) to an immense value. If crossbow bolts are still inflicting only 10 damage when the options says 1000000, then no doubt you have an addon that Is completely resetting the damage value to what it wants. In that case, until you figure out the culprit, nothing more can be done I'm afraid.

You are right that my addon does not touch VJ crossbow bolts, as they are a different entity from HL2 bolts
Birthday Boye 3 Jun @ 11:52am 
So an override damage script would be nice if its ever possible, forcefully referring the convars dmg to your addon.
Birthday Boye 3 Jun @ 11:46am 
exactly, (edited as 165 but does not applied unlike every npc>ply dmg convars, still at 10) by the time i want to add some enemy variety for my mindless hardcore combine horde fight, testing weapons and bumping up the damage for them. Notice that it won't apply the modified damage for anything no matter type of work around i took, finding conflicting addon that somehow tampering the crossbow damage for npc and so on. I think "vj base crossbow" works best for now with its high damage output (100), but minimal reload time per shot (almost rapid fire without mere mininal spread, down right aimbot) and yet high velocity steel rod are still left to be desired for it... (npc VJ hl2 crossbow does not effected by this mod)
ValsdalV  [author] 3 Jun @ 11:15am 
It definitely sounds like something is interfering with the damage calculations... Try to deactivate the 'hitgroup damage' option of this addon, if you have it set, and see if it changes anything.

Also, did you have this damage issue before installing this addon?
Birthday Boye 3 Jun @ 10:24am 
It already was in skill 2, typed in the convar in game console to skill 4 to refresh the issue i'm having before swtiching back to 2, worst mistake of my life... had to redo skill config all over again, but no matter modifying the damage in game or cfg text, it still does 10 damage no matter what... (only players to npc, not vice-versa) I thought this addon would atleast remedy this issue but it nullified.the crossbow damage completely instead... Looking back, this addon looks dope as hell and i think i can't live without it. But can't in my life be able to fix that oddly specific issue, perhaps i need to data mine little bit more to find the root cause of it. Though I wonder it if can be done to forcefully applying the said damage with own script than referring to the convar, think it was possible do such thing?
ValsdalV  [author] 3 Jun @ 1:39am 
@Birthday Boye
NPC damage inflicted to players is scaled by the 'skill' ConVar. If you want them to inflict the same damage you have set in this addon's options menu, the 'skill' ConVar has to be set to 2 (Normal difficulty).

I've just tested this in Sandbox with some NPCs just to make sure, they were all equipped with a crossbow: Enemy Rebel, Metro-Police and Alyx (turned hostile with a mod) all inflict the expected amount of damage on Normal difficulty. Combine soldiers don't know how to use a crossbow by default, so most of the time they just stand there being pacifists
Birthday Boye 2 Jun @ 1:02pm 
I came to subscribe this addon for the sole reason of skill.cfg didn't do jack shit on crossbows damage modifiers. Oof
Birthday Boye 2 Jun @ 12:57pm 
Is it just me or the rebel and combine npc (with retail-like animation addon so they don't t-pose) didn't inflict any damage to me? (wanting to add a certain combine as if they were snipers in zippy's horde addon, but with them dealing zero damage to me at all is ruining my day in adding interesting enemies... Care to patch it out maybe? thanks
Sanders 29 Apr @ 5:38am 
ok cool and thank you
ValsdalV  [author] 29 Apr @ 1:05am 
@Sanders
That's only a visual glitch I have not yet figured out a fix for. About the accuracy, yeah, there's a little bit of trajectory adjustments that I do to help, but not much more can be done. Also Sanders, with the new addon update the E2 trails script you posted should now work (I tested the AntCore one)

@COMBINE_UNIT_4652 @TACTICALCORNDOG
My best guess is that they simply didn't have enough time to add more features to the crossbow bolt... I know for certain they wanted it to be able to stick to its target, there's a comment in the code that mentions this
Sanders 28 Apr @ 5:54am 
umm with improved_crossbowbolt_hipfire it doesnt seem to do the whole firing from the crossbow more like a distance from it also when we do this its no longer as accurate neat idea though!
COMBINE_UNIT_4655 26 Apr @ 4:32pm 
@TACTICALCORNDOG I know right
TACTICALCORNDOG 26 Apr @ 4:09pm 
i serched up cross (as one does) and i found this, thank you and why couldnt valve make this default in the source engine
ValsdalV  [author] 31 Jan @ 5:12am 
@Gabriel ML
Yes, the admin cleanup removes all of them
Gabriel ML 29 Jan @ 9:01pm 
Does this mod removes the crossbow bolts when i hit on "clean up everything"?
ValsdalV  [author] 8 Jan @ 5:59am 
@ Winn

The first step is fetching a physics object (representing a moving part of the ragdoll itself) that you want to pin.
You can get it from a line/hull trace or from an entity's PhysicsCollide hook data.

You then have to find a wall or prop to pin the ragdoll's physics object to.
This addon looks for them by firing a new line trace starting from the collision position and moving 96 units in the direction of the bolt's velocity.

If a wall/prop is found, what's left to do is teleport the ragdoll's physics object to that line trace's hit position (a bit of vector math is required to adjust the target position, or the ragdoll will be embedded in the wall and glitch out) and then weld it in place with a phys_constraint or a phys_ballsocket entity.

That's pretty much the gist of it
Winn 7 Jan @ 12:32pm 
That'd be great :)
ValsdalV  [author] 7 Jan @ 9:26am 
If you want to have fun yourself with lua scripts I can explain broadly how I implemented ragdoll pinning in this addon @Winn
Winn 5 Jan @ 2:30pm 
This is an awesome mod. Do you think you could also make other entities pin ragdolls? Or is there any way I can replicate the ragdoll pinning to an entity?
ValsdalV  [author] 30 Dec, 2024 @ 8:43am 
@gm_Redlerman16 D'oh! It will be fixed in the next update
gm_Redlerman16 30 Dec, 2024 @ 7:23am 
found this error, fix?

[Improved Crossbow Bolt] lua/entities/icb_boltprop/init.lua:131: bad argument #3 to 'WorldToLocal' (Vector expected, got no value)
1. WorldToLocal - [C]:-1
2. SetParentFromTrace - lua/entities/icb_boltprop/init.lua:131
3. CreateBoltProp - lua/entities/improved_crossbowbolt/sv_entity_collision.lua:343
4. BoltHitEntity - lua/entities/improved_crossbowbolt/sv_entity_collision.lua:72
5. unknown - lua/entities/improved_crossbowbolt/init.lua:270
greegor130274 22 Dec, 2024 @ 4:13am 
WOW
ValsdalV  [author] 18 Nov, 2024 @ 1:25am 
@ᑕOᗰᗷIᑎE_ᑌᑎIT_4649☣

We'll have to see if it will be possible to add custom entities to the game with workshop addons in the future. At the moment I can only see models/maps/sounds
COMBINE_UNIT_4655 17 Nov, 2024 @ 10:45am 
This would be great fort the half life 2 workshop.
Human01 9 Sep, 2024 @ 9:08am 
nice daft punk reference lool
ValsdalV  [author] 12 Jul, 2024 @ 12:50pm 
I copied your settings and it still doesn't crash for me, it has to be one of the settings of the zetabots that creates a conflct.

What if you leave the crossbow bolt settings the same as you just posted, but only change the 'Player damage' to 0? Does it still crash?
Solar 12 Jul, 2024 @ 11:04am 
pin serverside ragdolls - ON
cleanup time - Never remove
Player damage - 200
Npc damage - 200
velocity - 10.000

these are the settings that im using
ValsdalV  [author] 12 Jul, 2024 @ 10:58am 
Perfect. All that's really left to do is try changing only one of these options at a time to see what causes the crash.

I would have done this myself, but the game works as it should here, leaving me no way to properly test your issue
Solar 12 Jul, 2024 @ 10:19am 
yep that worked, no crash
ValsdalV  [author] 12 Jul, 2024 @ 5:08am 
Ok, since the game is still is not crashing on my end, I ask you to try this:

change your host settings like so:
Pin serverside ragdolls -> off
Cleanup time -> Remove immediately
Player damage -> 0

If it no longer crashes with the settings changed like so, then there's hope to fix this issue
Solar 12 Jul, 2024 @ 3:41am 
when i shoot them with the crossbow both single and multiplayer it just abruptly crashes instantly, and i do have keep corpses enabled
ValsdalV  [author] 12 Jul, 2024 @ 3:16am 
@Solar If you mean this addon here:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2773405248
I've been shooting at them for quite some time, with no crashes. I'm using the default options for the bots if that matters and, as the author suggests, I'm playing in singleplayer mode.

I've however noticed a bug with that addon, zeta players spawn a double ragdoll corpse when the sandbox option 'Keep corpses' is toggled off. The double ragdoll spawns regardless of the weapon used to deal the lethal hit, so maybe your crash has something to do with that.
Solar 10 Jul, 2024 @ 2:16am 
so far ive seen it crash with the zetabots
ValsdalV  [author] 9 Jul, 2024 @ 10:27am 
Can you list some of them so I can check?
Solar 9 Jul, 2024 @ 3:56am 
some nextbots crash the game instantly upon being shot at with this mod enabled
ValsdalV  [author] 22 Jun, 2024 @ 4:59am 
Thanks @Vance, you are definitely right about the 3500 velocity and I'll add some bonus info for the people that are interested: in Half-Life 2 the crossbow bolt travels at 3500 hammer units per second in multiplayer (which is the maximum velocity allowed by the physics engine) and 2500 when in singleplayer. In addition to that, the initial speed when shooting while underwater is cut to 1500 HU/s.

You can't really make this improved bolt move exactly like the original, you can get pretty close with the right values, but after a bounce the trajectories will diverge substantially, because of the way I implemented its movement.
Vance 22 Jun, 2024 @ 12:43am 
For all of those who are looking for the same speed and drop from the original crossbow it's 3500 Velocity and 0.5 Drop.

Great addon btw, loving it!
ValsdalV  [author] 17 May, 2024 @ 1:33am 
@ilikespamroll Hey thank y- wait, what?
ilikespamroll 11 May, 2024 @ 12:33pm 
this is what i have always wanted. i am extremely gay for the one who made this mod.
ValsdalV  [author] 20 Apr, 2024 @ 9:28am 
Yeah, that's the title of a famous Daft Punk song
city1288 18 Apr, 2024 @ 6:12pm 
The thumbnail sounds like the lyrics from daft punk
ValsdalV  [author] 9 Apr, 2024 @ 4:47am 
There's been some issues lately with the Steam Workshop, addons/discussions disappearing and stuff. Try and reload the page and if that still doesn't fix the issue, just wait a little bit
Enviyon 9 Apr, 2024 @ 1:53am 
i'm sorry for just spam in comments..
i dont see for the first time discussion "suggetions / bugs"
ValsdalV  [author] 7 Apr, 2024 @ 9:17am 
Nice!
The problem was entirely with my addon, it was not a conflict or broken files
Enviyon 7 Apr, 2024 @ 8:49am 
it's all works now
Thx
ValsdalV  [author] 7 Apr, 2024 @ 7:04am 
I think I've figured it out, let me know if this new update fixes your issue
Enviyon 7 Apr, 2024 @ 2:05am 
in multiplayer, I turned off all addons, but left yours on, and anyway I have a crossbow bolt that goes right through everything when you're close to something, I don't know what happen
but it's maybe my files in gmod broken