SA-MP Forums Archive
[Include] rTurret - Easily create interactive turrets! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] rTurret - Easily create interactive turrets! (/showthread.php?tid=525988)

Pages: 1 2


Re: rTurret - Highly customizable turrets! - Corekt - 01.07.2015

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



Re: rTurret - Easily create interactive turrets! - Corekt - 02.07.2015

No responses so far. Any feedback would be appreciated!


Re: rTurret - Easily create interactive turrets! - liquor - 03.07.2015

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


Re: rTurret - Easily create interactive turrets! - Corekt - 03.07.2015

Thanks, let me know if you have any suggestions.


Re: rTurret - Easily create interactive turrets! - Onfroi - 09.07.2015

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!


Re: rTurret - Easily create interactive turrets! - Corekt - 18.07.2015

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.