• How to make flechettes explode after hit?
    7 replies, posted
I'm making a flechette sniper rifle that fires 6 flechettes at once in a tight spread, but I want them to explode even after attaching onto the target. How do I modify the explosion damage and the hit damage too? Help would be appreciated!
Anyone?
How do you mean, are they somehow not detonating after hitting a prop/the world or do you want them to detonate after hitting a player/NPC? I don't think the latter is possible with Lua.
[QUOTE=MegaJohnny;21268306]How do you mean, are they somehow not detonating after hitting a prop/the world or do you want them to detonate after hitting a player/NPC? I don't think the latter is possible with Lua.[/QUOTE] Detonation after hitting an npc instead of just disappearing.
You'd have to code your own for that.
Not necessarily. You could detect them in collision and damage hooks and then trigger the explosion.
If it fires flechettes in a tight spread, that's not a sniper rifle anymore. Also don't you think flechettes are already a bit overused? We have seen flechettes guns, shotguns, rifles, grenades, it's kinda getting old. You could code your own flechette, that you open a few more possibilities and you would have a bit more merit. [editline]11:12PM[/editline] [QUOTE=Crazy Quebec;21271407]Not necessarily. You could detect them in collision and damage hooks and then trigger the explosion.[/QUOTE] I'd suggest that: Hook EntityTakeDamage, and when the hurt entity is a NPC or a player, and the inflictor is a flechette, just spawn an explosion there. Use ParticleEffect for the explosion, as for the damage itself, you could just increase the received damage a bit if only the NPC who got hit should be hurt. Else, just use util.BlastDamage. If you don't want the ear ringing sound effect, you could set the inflictor of the explosion to the flechette itself. Then, in EntityTakeDamage, if an entity receives blast damage from a flechette (DMG_BLAST), change its type to something else (not sure what type of damage the flechettes do when they explode, I think it's DMG_SHOCK, not sure).
[QUOTE=_Kilburn;21272726]If it fires flechettes in a tight spread, that's not a sniper rifle anymore. Also don't you think flechettes are already a bit overused? We have seen flechettes guns, shotguns, rifles, grenades, it's kinda getting old. You could code your own flechette, that you open a few more possibilities and you would have a bit more merit. [editline]11:12PM[/editline] I'd suggest that: Hook EntityTakeDamage, and when the hurt entity is a NPC or a player, and the inflictor is a flechette, just spawn an explosion there. Use ParticleEffect for the explosion, as for the damage itself, you could just increase the received damage a bit if only the NPC who got hit should be hurt. Else, just use util.BlastDamage. If you don't want the ear ringing sound effect, you could set the inflictor of the explosion to the flechette itself. Then, in EntityTakeDamage, if an entity receives blast damage from a flechette (DMG_BLAST), change its type to something else (not sure what type of damage the flechettes do when they explode, I think it's DMG_SHOCK, not sure).[/QUOTE] Its still a sniper rifle, i made it fire multiple projectiles so that it would do more damage (like the Jakob's Skullmasher in Borderlands) since I cant modify the flechette damage. The solution you came up with is pretty awesome since I added custom explode effects.
Sorry, you need to Log In to post a reply to this thread.