Artificial Bullet Spread(regarding velocity_by_aim)[SOLVED]
Sorry to post 2 topics asking for help so close to each other, especially after I figured out the simple solution to my last question. But this one is different, this one I have no clue about and have been searching for an answer for hours now.
Again with WeaponMod, I am trying to make a sawed-off shotgun. The main problem is that WeaponMod doesn't come with a simple native for creating a bullet with spread(bullets always go straight and ignore recoil), so I have to create bullets dynamically as fast-moving entities. I can make a bullet that moves straight, but I can't seem to get the bullet to fire at an angle. I've been searching for hours and I know that I have to do something to alter the velocity or angle values, but I can't just change them without breaking the plugin as far as I know. So how can I make this bullet fire in a random direction(angles should be -5 to 5 degrees). Code:
Of course, if there is a more simple way to do this, please tell me. I'm hurting my head. |
Re: Artificial Bullet Spread(regarding velocity_by_aim)
You shouldn't do that. Bullets aren't supposed to be "random". A bullet direction depends on player movement direction, type of material the player is on (ground, air, water, etc.), player's velocity and maybe some other things I can't remember right now.
Then again you could just add that random angles but it's a sloppy way of doing it. Realism would have nothig to do with it in this case. |
Re: Artificial Bullet Spread(regarding velocity_by_aim)
I realize all that, but its far too complicated for me with the little amount of Pawn that I know. For now I just want bullets that don't go straight in front of you every time.
|
Re: Artificial Bullet Spread(regarding velocity_by_aim)
Take a look at the shotgun secondary attack from the HL source code. I don't think you can do the multi damage but you can do TakeDamage with Ham Sandwich.
|
Re: Artificial Bullet Spread(regarding velocity_by_aim)
Couldn't he just use this?
(message_const.inc) Code:
#define TE_MULTIGUNSHOT 126 // Much more compact shotgun message |
Re: Artificial Bullet Spread(regarding velocity_by_aim)
That won't do any damage, but it'll create the effect I guess.
|
Re: Artificial Bullet Spread(regarding velocity_by_aim)
Is it possible to check where those fake bullets end up?
|
Re: Artificial Bullet Spread(regarding velocity_by_aim)
No, it's calculated on the client with TE_MULTIGUNSHOT.
|
Re: Artificial Bullet Spread(regarding velocity_by_aim)
I'm looking at the SDK code for the shotgun right now, but I don't see how this helps me. It's completely different and none of it is compatible with amxx.
Code:
|
Re: Artificial Bullet Spread(regarding velocity_by_aim)
You could use the traces generated by TE_MULTIGUNSHOT...
|
| All times are GMT -4. The time now is 21:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.