is it possible to recreate/modify the impale effect from the crossbow_bolt ent? I want to either remove the impale effect from the bolt ent, or use the bolt ent as a nail to nail props instead of ragdolls.
I know I can just make my own bolt/nail ent and it'd be easier, I just want to know if it's possible to modify the hl2 bolt ent for science.
I did this, but I don't have the code
What you want to do is to find whenever a bolt is removed using simple hooks (a bolt is removed instantly when it hits a prop /ragdoll/npc/anything that's not the world - so it perfectly fits your case) and upon removal run a trace (with the forward direction of the bolt) for the first hit entity, then another trace (ignoring the first hit entity) to look for another surface behind the first entity, and if that distance is below your threshold: apply a weld between the two entities. the bolt would still disappear so you'd want to create another bolt effect and parent it to the first entity or something for the effect to make sense (along with sparks if you really want)
Hey here's the code for the bolt impale. In case anyone has any other wacky ideas pertaining to crossbow bolts.
https://hg.alliedmods.net/hl2sdks/hl2sdk-ob-valve/file/8089d47822be/game/server/hl2/weapon_crossbow.cpp#l280
Threw together a SWEP that shoots crossbow bolts and I've got some issues.
1.) SendWeaponAnim is sending the reload anim instead of vm_primaryattack on PrimaryAttack, no big deal but still annoying.
2.) If I set crossbow bolt velocity past 3000 the bolt comes out at a very wrong angle and the bolt seemingly doesn't move any faster, even if force is multiplied by a ridiculous value. Bolts work perfectly fine below 3000 force.
Sorry, you need to Log In to post a reply to this thread.