[Include] rTurret - Easily create interactive turrets!
#21

Update: Version 1.5

This update requires the ColAndreas plugin for the new LoS features.

Turrets now have LoS capabilities! To enable, simply set your turret behavior to one of the aiming behaviors. By default, turrets with aiming behaviors will shoot only if there is a line of sight to a player. For all behaviors, bullets no longer go through walls and will collide with solid objects if there are any in their path (this can be disabled with the ToggleTurretLOS function). Special thanks to the creators of ColAndreas for making this possible!

Improved predictive aim algorithm, as a result predictive aim is now enabled by default for aim behaviors. Several other toggle defaults have been changed. Check the front page for a detailed list.

Added Turret Health system. Health is turned off by default. When toggled on, health will automatically deplete if the turret is shot and will be destroyed once health reaches 0. See updated filterscript for example usage:
  • Float:GetTurretHealth(turretid);
  • SetTurretHealth(turretid, Float:health);
  • ToggleTurretHealth(turretid, toggle, Float:sethealth = -1.0);
  • OnPlayerShootTurret(playerid, weaponid, turretid, Float:fX, Float:fY, Float:fZ);
  • OnTurretDeath(turretid, killerid, weaponid);
Added LoS features:
  • ToggleTurretLOS(turretid, toggle);
    • Toggle whether the turret's bullets will end its path against a solid object
  • ToggleTurretLOSAim(turretid, toggle);
    • Applicable to aim behaviors only, toggles whether the turret will shoot once there is a line of sight to a player, otherwise will remain inactive. Must have turret LoS toggled on.
  • OnTurretBulletCollision(turretid, Float:x, Float:y, Float:z);
    • Called when a bullet collides with a solid object.

Bug fixes/tweaks:
  • Eliminated invalid streamer id console spam which were just false positives (hopefully)
  • Improved predictive aiming.
  • Increased default bullet area radius for improved accuracy.
  • Fixed a bug where turrets with 3d aiming would miss their shots at an idle player
  • Due to bullet hit inaccuracies with idle players, idle players will now instantly lose health instead of a physical bullet being created, assuming the turret has a targeting behavior.
Download:
v1.5 Pastebin
v1.5 Example filterscript
Reply
#22

No responses so far. Any feedback would be appreciated!
Reply
#23

Dude... I was amazed by the original post, and with LoS and solid object stopping it i am convinced to implement this in my new gamemode, as a feature for military perimeter protection +rep
Reply
#24

Thanks, let me know if you have any suggestions.
Reply
#25

Quote:
Originally Posted by Corekt
Посмотреть сообщение
No responses so far. Any feedback would be appreciated!
I haven't had a chance to test the new version because the ColAndreas plugin isn't working for me, hopefully I can get it working soon. Thanks again, for the amazing include!
Reply
#26

Minor update (v1.5.1)

I fixed several bugs, most important one being that players weren't taking damage when the callback OnTurretHitPlayer wasn't implemented. You can remove the callback now if you don't need it.

Also added TurretDamagePlayer which forces turret damage on a player regardless of their location, (Get/Set)TurretBulletOffset and (Get/Set)TurretBulletRot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)