AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Realistic Bullet: Real-Life Bullet physics to CS - FINAL VERSION (https://forums.alliedmods.net/showthread.php?t=309377)

EFFx 07-23-2018 22:51

Realistic Bullet: Real-Life Bullet physics to CS - FINAL VERSION
 
4 Attachment(s)
REALISTIC BULLET


Release: 07/23/2018
Last Update: 02/24/2022

- Description
- This plugin is an attempt to re-create the real-life bullet physics for the Counter Strike 1.6. Follow the list of features:

1. Bullet crack when the bullet is supersonic
2. Bullet whizz when the bullet is subsonic.
3. Bullet drop when too far away from the end point of the bullet (bullet losing power and going down due gravity and air resistance).
4. Bullet penetrations. The bullet continues to penetrate entities until it loses enough power to not being able to penetrate anymore.
5. Bullet ricochet depending of the hit angle (controlled via .ini file).
6. Bullet bounce when it's velocity is too low.
7. Bullet rotation after every bounce, ricochet or penetrations.
8. Bullet view camera, so players can see where the bullet is going to.
9. Bullet sounds including bounce sound, hit sound depending of the texture or when ricocheting.
10. Bot support.
11. Equations to deal with damage, including distance, velocity, hit part of the body (obvious), ricochets and penetrations. The equation also support TK's.
12. Has a lot of bullet effects (use rbullet_trail_type to change).
13. Water physics.
14. Uses calculations to model an 'air resistance'.
15. Ability to change velocity, ricochet angle, bullet base damage, gravity or power of penetration using the .ini file.

- Cvars
rbullet_shotgunburst - How many bullets will be created in shotguns.
rbullet_trail - Bullet trail
rbullet_trail_color - Bullet trail color
rbullet_trail_color_intensity - Bullet trail color intensity
rbullet_trail_type - Bullet trail type
rbullet_trail_life - Bullet trail life
rbullet_ffa - FFA Mode (kill teammates)
rbullet_bullet_camera - Bullet's camera view when traveling
rbullet_allow_tradekills - Trade kill
rbullet_allow_penetration - Manages bullet penetration
rbullet_allow_ricochet - Manages bullet ricochet
rbullet_show_default_path - Displays the default path compared to the physics added
rbullet_default_trail_color - Beam color of the default path


Gameplay Images

https://imgur.com/J95UZG3.png https://imgur.com/dGWcWxV.png
https://imgur.com/VEMRL3J.png https://imgur.com/XCcjocA.png
https://imgur.com/wTKdssq.png https://imgur.com/ZXAOvee.png
https://imgur.com/X04R2Gz.png https://imgur.com/wMGLl2u.png


- Gameplay Videos (old versions)



- Impact sounds, ricochet, bullet whizz and bullet crack due
supersonic speed and bullet's camera view demonstrations:



- More details about impact sounds, bullet crack and whizz from
players far away from you.



- All damage checks avaliable




- Credits
Ricochet plugin, found here - https://forums.alliedmods.net/showthread.php?t=101383
Wall thickness code to calculate the penetration - https://forums.alliedmods.net/showpo...69&postcount=8

- Change log
Spoiler

Visinescu 07-24-2018 03:02

Re: Bullet Speed Management
 
Keep up the good work ツ !

SHIELD755 07-24-2018 06:44

Re: Bullet Speed Management
 
awwsome i gotta test this

HamletEagle 07-24-2018 08:11

Re: Bullet Speed Management
 
Did you try using FM_PlayBackEvent instead of CurWeapon? It's the proper way to detect each individual weapon shot.

EFFx 07-24-2018 14:06

Re: Bullet Speed Management
 
I'll check this out.

OBS: Try using slowbullet_speed 100, is so cool. Looks like Matrix.

edon1337 07-24-2018 15:51

Re: Bullet Speed Management
 
Good job :up:

Rivotril 07-24-2018 17:11

Re: Bullet Speed Management
 
Amazing job!

EFFx 07-24-2018 20:48

Re: Bullet Speed Management
 
Updated to v1.1:

Code:

- Fixed a log error with the pev().
- Changed the weapon fire function, and with it, the recoil is now avaliable.
- Changed  the default value of the bullet speed.
- Removed the chatcolor include (not necessary)

Also, thank you guys.

EFFx 07-26-2018 19:46

Re: Bullet Speed Management
 
Updated to v1.2:

Code:

. Fixed the damage block (sometimes it wasn't blocking)
. Fixed the deathmsg message (it shows now the weapon icon).
. Changed the way to set sv_maxvelocity in the plugin, sometimes it wasn't setting the value.

Observation:
I figured out that when you catch the death of anyone, with Ham_Killed or DeathMsg, sometimes the weapon id is not passed, so, I recommend to use get_user_weapon() to get the killer's weapon ID.

Like:

1. DeathMsg

PHP Code:

register_event("DeathMsg""event_DeathMsg""a"

PHP Code:

public event_DeathMsg()
{
    new 
iKiller read_data(1), szWeapon[32]
    
get_weaponname(get_user_weapon(iKiller), szWeaponcharsmax(szWeapon))
    
log_amx("iKillerID: %d, iVictimID: %d, Killer's WeaponName: %s"iKillerread_data(2), szWeapon[7])


Output:

Code:

iKillerID: 1, iVictimID: 6, Killer's WeaponName: ak47
2. Ham_Killed

PHP Code:

RegisterHam(Ham_Killed"player""ham_PlayerKilled"

PHP Code:

public ham_PlayerKilled(iVictimiKilleriShouldGib)
{
    new 
szWeapon[32]
    
get_weaponname(get_user_weapon(iKiller), szWeaponcharsmax(szWeapon))
    
log_amx("iKillerID: %d, iVictimID: %d, Killer's WeaponName: %s"iKillerread_data(2), szWeapon[7])


Output:

Code:

[bulletSpeed.amxx] iKillerID: 1, iVictimID: 28, Killer's WeaponName: ak47
So, both works. And I know that the player can throw a nade, change to AK47, kill the enemy with the HE, and it'll pass the weapon ID as AK47 (due the get_user_weapon() native), but, that barely happens. For now, it's the best way.

VoivoDpl 09-13-2018 05:31

Re: Bullet Speed Management
 
This doesn't block original damage / original "bullets" (at least for me). Also it doesn't support hit places and wallshots right ? And if shooting through "walls" would be added I recommend adding variable penetration based on weapon, texture and bullet travel distance :D.


All times are GMT -4. The time now is 02:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.