01.07.2015, 06:48
Update: Version 1.5
This update requires the ColAndreas plugin for the new LoS features.Download:
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:Added LoS features:
- 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);
- 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.
v1.5 Pastebin
v1.5 Example filterscript