• EntityFireBullets Hook - Grabbing bullet?
    5 replies, posted
Is there anyway I could define the bullet? To attach a trail or some thing to it?
To add a smoke trail or whatever you'd have to create your own bullet entity & method of firing it. For an example see [url]https://github.com/Captainshaun/PirateShipWars2/blob/master/entities/entities/psw_ballbearing.lua[/url] and [url]https://github.com/Captainshaun/PirateShipWars2/blob/master/entities/weapons/weapon_psw_musket.lua#L53[/url]
[QUOTE=zerf;47147607]To add a smoke trail or whatever you'd have to create your own bullet entity & method of firing it. For an example see [url]https://github.com/Captainshaun/PirateShipWars2/blob/master/entities/entities/psw_ballbearing.lua[/url] and [url]https://github.com/Captainshaun/PirateShipWars2/blob/master/entities/weapons/weapon_psw_musket.lua#L53[/url][/QUOTE] I know this, but since its fas2, I don't wanna just edit the base.
EntityFireBullets is called just before when the hitscan bullets are fired, they are not physical, they do not actually exist. What you can do is either: 1) Block the bullet from that hook and create a custom bullet entity with all the stuff you need 2) Since all you want is an effect, make a Lua effect and dispatch that effect from that hook. You know the shoot position, you know the direction the bullet is heading.
[QUOTE=Robotboy655;47147668]EntityFireBullets is called just before when the hitscan bullets are fired, they are not physical, they do not actually exist. What you can do is either: 1) Block the bullet from that hook and create a custom bullet entity with all the stuff you need 2) Since all you want is an effect, make a Lua effect and dispatch that effect from that hook. You know the shoot position, you know the direction the bullet is heading.[/QUOTE] I'm thinking of creating a invisible/second bullet with the same info, but with 0 damage etc, but how would I send/shoot this bullet? (If I do this I can still attach the trail to it right?)
You cannot attach a trail to a bullet ( Because bullets by default don't exist physically in the world, google and read what hitscan weapon is ), only if you actually code an entity that will act as a bullet and attach a trail to that. As I said, again, best thing you can do is to emit a Lua effect from that hook so it looks like the bullet has a trail. Or go for the create entity route.
Sorry, you need to Log In to post a reply to this thread.