<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Turret</id>
	<title>Turret - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Turret"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Turret&amp;action=history"/>
	<updated>2026-04-29T10:21:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Turret&amp;diff=33951&amp;oldid=prev</id>
		<title>Dragofer at 12:35, 19 April 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Turret&amp;diff=33951&amp;oldid=prev"/>
		<updated>2025-04-19T12:35:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:35, 19 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Predicts its target&amp;#039;s position based on its movement.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Predicts its target&amp;#039;s position based on its movement.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Can be destroyed with fire arrows/mines by default, producing fx like sparks and breaking into pieces. Alternatively, it can be switched on/off via a simple trigger i.e. from a button.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Can be destroyed with fire arrows/mines by default, producing fx like sparks and breaking into pieces. Alternatively, it can be switched on/off via a simple trigger i.e. from a button.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Comes with a separate rotating platform and recoiling barrel.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Similarly to the security camera, both the turret and its projectiles are highly customizable.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Similarly to the security camera, both the turret and its projectiles are highly customizable.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Offers script control to fire at specific entities or positions using the &amp;quot;attack&amp;quot; and &amp;quot;attackPosition&amp;quot; events.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Offers script control to fire at specific entities or positions using the &amp;quot;attack&amp;quot; and &amp;quot;attackPosition&amp;quot; events.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dragofer</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Turret&amp;diff=33950&amp;oldid=prev</id>
		<title>Dragofer: Created page with &quot;==Turret==  The turret is an advanced stationary sentry. It&#039;s designed to be linked with one or more security cameras, automatically attacking the closest target that is visible to a security camera. Not to be confused with the Camgoyle, which is a security camera that can also attack enemies. The following features are offered by the turret:  * Fires explosive, high-velocity projectiles at the closest enemy detected by linked security cameras. Enable &quot;seeAIs&quot; on the sec...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Turret&amp;diff=33950&amp;oldid=prev"/>
		<updated>2025-04-19T12:29:37Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Turret==  The turret is an advanced stationary sentry. It&amp;#039;s designed to be linked with one or more security cameras, automatically attacking the closest target that is visible to a security camera. Not to be confused with the Camgoyle, which is a security camera that can also attack enemies. The following features are offered by the turret:  * Fires explosive, high-velocity projectiles at the closest enemy detected by linked security cameras. Enable &amp;quot;seeAIs&amp;quot; on the sec...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Turret==&lt;br /&gt;
&lt;br /&gt;
The turret is an advanced stationary sentry. It&amp;#039;s designed to be linked with one or more security cameras, automatically attacking the closest target that is visible to a security camera. Not to be confused with the Camgoyle, which is a security camera that can also attack enemies. The following features are offered by the turret:&lt;br /&gt;
&lt;br /&gt;
* Fires explosive, high-velocity projectiles at the closest enemy detected by linked security cameras. Enable &amp;quot;seeAIs&amp;quot; on the security camera and update the &amp;quot;team&amp;quot; spawnarg if you&amp;#039;d like it to fire at AIs.&lt;br /&gt;
* Predicts its target&amp;#039;s position based on its movement.&lt;br /&gt;
* Can be destroyed with fire arrows/mines by default, producing fx like sparks and breaking into pieces. Alternatively, it can be switched on/off via a simple trigger i.e. from a button.&lt;br /&gt;
* Similarly to the security camera, both the turret and its projectiles are highly customizable.&lt;br /&gt;
* Offers script control to fire at specific entities or positions using the &amp;quot;attack&amp;quot; and &amp;quot;attackPosition&amp;quot; events.&lt;br /&gt;
* Its view can be sent to a camera screen.&lt;br /&gt;
* There is also a script-based flamethrower version as an unofficial download [https://drive.google.com/file/d/1f9BA_tMoYjAgxx-00X8u1T-VmF_fHKJ0/view?usp=sharing here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Entities and Prefabs==&lt;br /&gt;
&lt;br /&gt;
The official thread can be found here: https://forums.thedarkmod.com/index.php?/topic/22307-212-turrets/&lt;br /&gt;
Turret entities can be found in &amp;#039;&amp;#039;AI/Machines/Turret&amp;#039;&amp;#039; and inherit from &amp;#039;&amp;#039;atdm:turret_base&amp;#039;&amp;#039;. Prefabs can be found in &amp;#039;&amp;#039;AI/Machines&amp;#039;&amp;#039;. The projectiles can be found in &amp;#039;&amp;#039;Internal/Weapons/Projectiles&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Spawnargs==&lt;br /&gt;
&lt;br /&gt;
===Movement Spawnargs===&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;rotation_speed_vertical&amp;quot; - Vertical turning speed in degrees per second.&lt;br /&gt;
* &amp;quot;rotation_speed_horizontal&amp;quot; - Horizontal turning speed in degrees per second.&lt;br /&gt;
* &amp;quot;max_incline_up&amp;quot; - How many degrees the turret can rotate upwards from its starting orientation.&lt;br /&gt;
* &amp;quot;max_incline_down&amp;quot; - How many degrees the turret can rotate downwards from its starting orientation.&lt;br /&gt;
&lt;br /&gt;
Note: horizontal rotation can&amp;#039;t be restricted at present.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Attack Spawnargs===&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;accuracy&amp;quot; - Add a random number of degrees up to this value whenever the turret fires a shot. 0 is perfect accuracy.&lt;br /&gt;
* &amp;quot;attack_delay&amp;quot; - Time in seconds before the turret can make its first attack after establishing a lock on the enemy.&lt;br /&gt;
* &amp;quot;attack_delay_rand&amp;quot; - Additional random delay up to this amount for attack_delay.&lt;br /&gt;
* &amp;quot;attack_interval&amp;quot; - Time in seconds between each attack of the turret while the turret still has a lock on the enemy.&lt;br /&gt;
* &amp;quot;attack_interval_rand&amp;quot; - Additional random delay up to this amount for attack_interval.&lt;br /&gt;
* &amp;quot;fire_range_max&amp;quot; - Max distance at which the turret can attack targets.&lt;br /&gt;
* &amp;quot;fire_range_min&amp;quot; - Min distance at which the turret can attack targets.&lt;br /&gt;
* &amp;quot;fire_tolerance&amp;quot; - Max difference in degrees between the enemy&amp;#039;s position and the turret&amp;#039;s current orientation. 0 means the turret has to point perfectly at the enemy to attack.&lt;br /&gt;
* &amp;quot;predict_motion&amp;quot; - Whether the turret will predict the enemy&amp;#039;s motion when firing projectiles.&lt;br /&gt;
* &amp;quot;friendly_fire&amp;quot; - The turret will attack its target even if a friendly actor is in the line of fire.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Projectile Spawnargs===&lt;br /&gt;
&lt;br /&gt;
These spawnargs affect the projectile launched by the turret:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;def_projectile&amp;quot; - Projectile to be fired. At time of writing, a guided and (experimental) bouncing version of the projectile are also available: atdm:turret01_projectile_guided and atdm:turret01_projectile_bounce.&lt;br /&gt;
* &amp;quot;projectile_offset&amp;quot; - Offset the projectile launch position from the model origin. This should be roughly where the barrel&amp;#039;s muzzle is.&lt;br /&gt;
* &amp;quot;projectile_speed&amp;quot; - Speed at which projectiles are launched. The corresponding value in the projectile def is not used.&lt;br /&gt;
* &amp;quot;projectile_trace_radius&amp;quot; - Radius of the bounding box that&amp;#039;s used to determine whether the projectile hits something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Barrel Spawnargs===&lt;br /&gt;
&lt;br /&gt;
The basic model comes with a separate barrel which recoils whenever a shot is fired.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;model_barrel&amp;quot; - Model of a separate barrel entity. Set to &amp;#039;-&amp;#039; if you don&amp;#039;t want to spawn a barrel.&lt;br /&gt;
* &amp;quot;broken_barrel&amp;quot; - Switch the barrel to this model when the turret is destroyed.&lt;br /&gt;
* &amp;quot;barrel_offset&amp;quot; - Offset the barrel origin from the turret&amp;#039;s origin.&lt;br /&gt;
* &amp;quot;recoil&amp;quot; - Translation by the barrel when recoiling. Set to &amp;#039;0 0 0&amp;#039; to disable.&lt;br /&gt;
* &amp;quot;recoil_time1&amp;quot; - Time taken for the barrel to travel to the recoil position.&lt;br /&gt;
* &amp;quot;recoil_time2&amp;quot; - Time taken for the barrel to return from the recoil position.&lt;br /&gt;
* &amp;quot;broken_hide_barrel&amp;quot; - Hide the attached barrel entity if the turret is destroyed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Color Spawnargs===&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;color_idle&amp;quot; - Color when all connected security cameras are idle.&lt;br /&gt;
* &amp;quot;color_suspicious&amp;quot; - Color when at least one connected security camera is in a suspicious state.&lt;br /&gt;
* &amp;quot;color_alerted&amp;quot; - Color when at least one connected security camera is in an alerted state.&lt;br /&gt;
* &amp;quot;color_passive&amp;quot; - Color when not connected to any operational security cameras.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Turret Damage Spawnargs===&lt;br /&gt;
&lt;br /&gt;
These spawnargs govern the player&amp;#039;s ability to do damage to the turret:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;health&amp;quot; - Entity&amp;#039;s health. Set to 0 for invulnerability.&lt;br /&gt;
* &amp;quot;damage_threshold&amp;quot; - Hits have to do at least this much damage for the turret be damaged. Avoids taking small amounts of splash damage from relatively distant projectile impacts. Set to 0 to disable.&lt;br /&gt;
* &amp;quot;damage_flinderize&amp;quot; - Attacks dealing at least this amount of damage can turn the turret into fragments upon or after destruction. Set to 0 to disable.&lt;br /&gt;
* &amp;quot;damage_blackjack&amp;quot; - Damage taken from blackjack attacks. Default damage: 0&lt;br /&gt;
* &amp;quot;damage_mult_sword&amp;quot; - Damage multiplier for sword attacks. Default damage: 42&lt;br /&gt;
* &amp;quot;damage_mult_arrow&amp;quot; - Damage multiplier for broadheads and rope arrows. Default damage: 35&lt;br /&gt;
* &amp;quot;damage_mult_firearrow_direct&amp;quot; - Damage multiplier for fire arrow and mine direct hits. Fire arrows and mines deal either direct damage or splash damage. Default damage: 400&lt;br /&gt;
* &amp;quot;damage_mult_firearrow_splash&amp;quot; - Damage multiplier for fire arrow and mine splash damage. Fire arrows and mines deal either direct damage or splash damage. Default maximal damage: 30&lt;br /&gt;
* &amp;quot;damage_mult_moveable&amp;quot; - Damage multiplier for all moveables. Significant mass and velocity are needed to do significant damage. Default maximal damage: mass divided by 5&lt;br /&gt;
* &amp;quot;damage_mult_other&amp;quot; - Damage multiplier for anything else. You can create individual damage_ spawnargs by naming the damage def, i.e. &amp;#039;damage_mult_atdm:damage_rock&amp;#039; &amp;#039;1.0&amp;#039;, or the inflicting entity, i.e. &amp;#039;damage_atdm:attachment_melee_shortsword&amp;#039; &amp;#039;1.0&amp;#039;&lt;br /&gt;
* &amp;quot;fx_damage&amp;quot; - fx played when the turret is damaged while power is on.&lt;br /&gt;
* &amp;quot;fx_damage_nopower&amp;quot; - fx played when the turret is damaged while power is off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Turret Destruction Spawnargs===&lt;br /&gt;
&lt;br /&gt;
These spawnargs govern what happens when the turret is destroyed:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;snd_death&amp;quot; - Sound made when the turret is destroyed while power is on.&lt;br /&gt;
* &amp;quot;snd_death_nopower&amp;quot; - Sound made when the turret is destroyed while power is off.&lt;br /&gt;
* &amp;quot;fx_destroyed&amp;quot; - fx played when the turret is destroyed while power is on.&lt;br /&gt;
* &amp;quot;fx_destroyed_nopower&amp;quot; - fx played when the turret is destroyed while power is off.&lt;br /&gt;
* &amp;quot;broken&amp;quot; - switch to this model when the turret is broken.&lt;br /&gt;
* &amp;quot;broken_flinderized&amp;quot; - switch to this model when the turret is broken and flinderized (fragmented). Set the flinderize threshold with &amp;#039;damage_flinderize&amp;#039;. If no model is set here, will use &amp;#039;broken&amp;#039; instead.&lt;br /&gt;
* &amp;quot;skin_broken&amp;quot; - switch to this skin when the turret is broken.&lt;br /&gt;
* &amp;quot;skin_broken_flinderized&amp;quot; - switch to this skin when the turret is broken and flinderized (fragmented). Set the flinderize threshold with &amp;#039;damage_flinderize&amp;#039;. If no skin is set here, will use &amp;#039;skin_broken&amp;#039; instead.&lt;br /&gt;
* &amp;quot;def_flinderN&amp;quot; - EntityDef of a flinder entity, replace N with 1, 2, 3 etc.&lt;br /&gt;
* &amp;quot;flinder_offsetN&amp;quot;	- Offset of the flinder spawn position relative to the turret&amp;#039;s origin, taking the turret&amp;#039;s rotation into account.&lt;br /&gt;
* &amp;quot;findler_countN&amp;quot; - Number of flinders of this type to spawn.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Sparks Spawnargs===&lt;br /&gt;
&lt;br /&gt;
These spawnargs control the sparks effect that plays periodically after the turret has been destroyed and if it&amp;#039;s still powered.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;sparks&amp;quot; - 1 = When the turret is destroyed, spawn a post-destruction particle func_emitter and play snd_sparks.&lt;br /&gt;
* &amp;quot;snd_sparks&amp;quot; - Sound emitted when the turret emits sparks after it was destroyed.&lt;br /&gt;
* &amp;quot;sparks_offset&amp;quot; - Offset the sparks particle emitter from the model origin.&lt;br /&gt;
* &amp;quot;sparks_particle&amp;quot; - Particle that is spawned upon destruction.&lt;br /&gt;
* &amp;quot;sparks_delay&amp;quot; - Delay the initial appearance of the particle emitter after the turret is destroyed.&lt;br /&gt;
* &amp;quot;sparks_power_dependent&amp;quot; - Only show the particle if power to the turret is switched on.&lt;br /&gt;
* &amp;quot;sparks_interval&amp;quot; - Minimum time between each trigger of the particle emitter + snd_sparks.&lt;br /&gt;
* &amp;quot;sparks_interval_rand&amp;quot; - Additional random factor added to the time between each trigger of the particle + snd_sparks.&lt;br /&gt;
&lt;br /&gt;
===Sound Spawnargs===&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;snd_stationary&amp;quot; - Sound made while idle.&lt;br /&gt;
* &amp;quot;snd_fire&amp;quot; - Sound made when a projectile is fired.&lt;br /&gt;
* &amp;quot;snd_sparks&amp;quot; - Sound emitted when the turret emits sparks after it was destroyed.&lt;br /&gt;
* &amp;quot;snd_death&amp;quot; - Sound made when the turret is destroyed while power is on.&lt;br /&gt;
* &amp;quot;snd_death_nopower&amp;quot; - Sound made when the turret is destroyed while power is off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===AI Spawnargs===&lt;br /&gt;
&lt;br /&gt;
These spawnargs affect how the turret and AIs interact with each other:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;notice_destroyed&amp;quot; - AIs will react if they see this turret has been destroyed.&lt;br /&gt;
* &amp;quot;AIUse&amp;quot; - Allows AIs to react to this turret when they see that it has been destroyed.&lt;br /&gt;
* &amp;quot;rout_enemies&amp;quot; - Enemies attacked by the turret will flee. 1 = always flee, 2 = flee if not fighting an enemy. Note: may not work perfectly.&lt;br /&gt;
* &amp;quot;rout_radius&amp;quot; - Enemies within this distance of the attacked enemy will also flee. See settings in rout_enemies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Misc Spawnargs===&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;start_off&amp;quot; - Whether the turret starts powered on or off.&lt;br /&gt;
* &amp;quot;cameraFovX&amp;quot; - Display screens showing the turret&amp;#039;s view will have this field of view in X.&lt;br /&gt;
* &amp;quot;cameraFovY&amp;quot; - Display screens showing the turret&amp;#039;s view will have this field of view in Y.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Damaging the Turret==&lt;br /&gt;
&lt;br /&gt;
Damage and destruction of the turret are highly customizable and work similarly to the [[Security Camera]]. See the corresponding section there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Scripting==&lt;br /&gt;
&lt;br /&gt;
===Script Events===&lt;br /&gt;
&lt;br /&gt;
The turret supports the following script events:&lt;br /&gt;
* getTurretState - Returns the turret&amp;#039;s state. 0 = passive: no active security cameras connected. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = power off, 5 = destroyed.&lt;br /&gt;
* attack(entity enemy, float ignoreCollisions) - Direct the turret to manually attack the specified entity. Use disableManualAttack() to disable. enemy: enemy to attack. ignoreCollisions: whether to ignore obstacles in the way to the enemy when planning to attack&lt;br /&gt;
* attackPosition(vector targetPos, float ignoreCollisions) - Direct the turret to manually attack a position. targetPos: position to attack. ignoreCollisions: whether to ignore obstacles in the way to the target position when planning to attack. Recommended true for this event.&lt;br /&gt;
* disableManualAttack() - Stop attacking the manually specified enemy or position and return to automatic target acquisition mode.&lt;br /&gt;
* activate() and trigger() - Toggle the turret&amp;#039;s power.&lt;br /&gt;
* getHealth() and setHealth(float newHealth) - As per the name. Setting health to 0 or lower will destroy the turret, which is irreversible. Using setHealth can turn an invincible turret vulnerable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Scriptobjects===&lt;br /&gt;
&lt;br /&gt;
The turret&amp;#039;s scriptobject is only needed for cosmetic elements specific to the default turret (recoiling barrel, attack FX and a rotating platform).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Upon Destruction===&lt;br /&gt;
&lt;br /&gt;
You may call a script when the turret is destroyed via the spawnarg &amp;quot;break_up_script&amp;quot;. This script should be able to receive the name of the destroyed turret as input, i.e.:&lt;br /&gt;
 void turret_destroyed ( entity turret )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
[[Category:Editing]]&lt;/div&gt;</summary>
		<author><name>Dragofer</name></author>
	</entry>
</feed>