Npc rocket turret: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Replaced "broken in Portal 2" with "needs extra steps in Portal 2")
No edit summary
 
(31 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[File:Rocket_turret.jpg|thumb|right|150px|Aperture Science Rocket Turret]]
[[File:Rocket_turret.jpg|thumb|right|150px|Aperture Science Rocket Turret]]
[[File:1400 RocketSentry.jpg|thumb|right|150px|Turret is firing]]


{{portal series point|npc_rocket_turret}} It spawns an Aperture Science Rocket Turret.
{{note|In portal 2 authoring tools, its model in the editor is the error model.}}
{{note|In Portal 2, this entity will not aim or fire unless sent a SetTarget input while it is turned off. Its target will also need to be reset every time it is turned off.}}


==Keyvalues==
{{this is a|model entity|name=npc_rocket_turret|series=Portal}} It is an Aperture Science Rocket Turret, which will track a single entity and fire rockets at it. In Portal 1 the target defaults to the SP player, but it can be overridden with SetTarget inputs.
{{KV|Rocket Speed|float|Speed the rocket will travel at.|since=P2}}
{{bug|If a rocket turret's target stops existing for any reason, it will seize up and not respond to SetTarget inputs until cycled off and back on. In standard usage (having the turret aim at a single player) this is rarely an issue, but it is something to be aware of when using rockets in multiplayer games or with NPC targets; players still exist while dead, so player deaths will not freeze the turret, but NPC deaths and players disconnecting will.}}
{{KV|Rocket Lifetime|float|The rocket will automatically detonate after this number of seconds.|since=P2}}
{{note|In multiplayer, rocket turrets will not target anyone by default (immediately seizing up when turned on). The target must be set manually with SetTarget inputs.}}
{{KV Parentname}}
{{bug|{{portal2}} In Portal 2, rocket turrets have a number of bugs:
* They will not target the SP player by default, so must be manually sent <code>SetTarget</code> inputs to target the player like in multiplayer.
* Rockets spawn stuck in place.
:{{workaround|A {{ent|trigger_push}}, {{ent|env_physexplosion}}, or other similar entity will need to be used to propel them forward.}}
* Rocket turrets' targeting lasers are bugged, displaying as nothing more than a blue glow on the end of the barrel.
:{{workaround|The laser can be replicated with an {{ent|env_beam}} parented to the barrel, though this will not be completely accurate as the original laser bends to hit targets to the side.}}
}}
{{confirm|[[ai_relationship]] appears to not work?}}
 
== Keyvalues ==
{{KV Targetname}}
{{KV Targetname}}
{{KV Angles}}
{{KV|Rocket Speed|intn=RocketSpeed|float|Speed the rocket will travel at.|since=P2}}
:{{bug|Doesn't work, as stated above.}}
{{KV|Rocket Lifetime|intn=RocketLifetime|float|The rocket will automatically detonate after this number of seconds.|since=P2}}
{{KV|Tripwire Mode|intn=TripwireMode|boolean|Makes this sentry aim in a fixed direction and not follow the target entity. When ''any'' entity crosses the beam (regardless of if they are the target), a rocket is fired instantly with no lock-on time. (Similar to [[prop_rocket_tripwire]], but allows aiming in any direction)|since=P2}}
{{KV|Tripwire Aim Target|intn=TripwireAimTarget|targetname|In tripwire mode, the entity to aim at. If not specified, will aim down world angles.|since=P2}}
 
== Flags ==
{{Fl|1|Disabled}}


==Inputs==
==Inputs==
{{IO|SetTarget|Sets the target for this turret to attack.|param=string}}
{{I|SetTarget|Sets the target for the rocket turret to attack.|param=string}}
{{IO|Destroy|Sets this turret to it's destroyed state.}}
{{I|Destroy|Sets the rocket turret to its destroyed state, freezing it in place and emitting sparks.}}
{{I Parentname}}
{{I Targetname}}
{{I Toggle}}
{{I Toggle}}
{{I EnableDisable}}
{{I EnableDisable}}


==Outputs==
== Outputs ==
{{IO|OnFoundTarget|Fired when the rocket turret finds an unobstructed target.}}
{{O|OnFoundTarget|Fired when the rocket turret finds an unobstructed target.}}
{{IO|OnLostTarget|Fired when turret's target is blocked.}}
{{O|OnLostTarget|Fired when turret's target is blocked.}}
{{IO|OnDeath|Fired after this turret finishes its destroy think and begins its death think}}
{{O|OnDeath|Fired after this turret finishes its destroy think and begins its death think}}
{{O Targetname}}
 
== See also ==
* [[npc_portal_turret_floor]]
* [[prop_rocket_tripwire]]
* [[rocket_turret_projectile]]


[[Category:Portal_Entities]]
[[Category:Portal_NPCs]]
[[Category:Portal_NPCs]]
[[Category:Portal_2_NPCs]]
[[Category:Portal_2_NPCs]]

Latest revision as of 14:00, 19 May 2025

Aperture Science Rocket Turret
Turret is firing
Note.pngNote:In portal 2 authoring tools, its model in the editor is the error model.

npc_rocket_turret is a model entity available in Portal series Portal series. It is an Aperture Science Rocket Turret, which will track a single entity and fire rockets at it. In Portal 1 the target defaults to the SP player, but it can be overridden with SetTarget inputs.

Icon-Bug.pngBug:If a rocket turret's target stops existing for any reason, it will seize up and not respond to SetTarget inputs until cycled off and back on. In standard usage (having the turret aim at a single player) this is rarely an issue, but it is something to be aware of when using rockets in multiplayer games or with NPC targets; players still exist while dead, so player deaths will not freeze the turret, but NPC deaths and players disconnecting will.  [todo tested in ?]
Note.pngNote:In multiplayer, rocket turrets will not target anyone by default (immediately seizing up when turned on). The target must be set manually with SetTarget inputs.
Icon-Bug.pngBug:Portal 2 In Portal 2, rocket turrets have a number of bugs:
  • They will not target the SP player by default, so must be manually sent SetTarget inputs to target the player like in multiplayer.
  • Rockets spawn stuck in place.
PlacementTip.pngWorkaround:A trigger_push, env_physexplosion, or other similar entity will need to be used to propel them forward.
  • Rocket turrets' targeting lasers are bugged, displaying as nothing more than a blue glow on the end of the barrel.
PlacementTip.pngWorkaround:The laser can be replicated with an env_beam parented to the barrel, though this will not be completely accurate as the original laser bends to hit targets to the side.
  [todo tested in ?]
Confirm:ai_relationship appears to not work?

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Rocket Speed (RocketSpeed) <float> (in all games since Portal 2)
Speed the rocket will travel at.
Icon-Bug.pngBug:Doesn't work, as stated above.  [todo tested in ?]
Rocket Lifetime (RocketLifetime) <float> (in all games since Portal 2)
The rocket will automatically detonate after this number of seconds.
Tripwire Mode (TripwireMode) <boolean> (in all games since Portal 2)
Makes this sentry aim in a fixed direction and not follow the target entity. When any entity crosses the beam (regardless of if they are the target), a rocket is fired instantly with no lock-on time. (Similar to prop_rocket_tripwire, but allows aiming in any direction)
Tripwire Aim Target (TripwireAimTarget) <targetname> (in all games since Portal 2)
In tripwire mode, the entity to aim at. If not specified, will aim down world angles.

Flags

Disabled : [1]

Inputs

SetTarget <stringRedirectInput/string>
Sets the target for the rocket turret to attack.
Destroy
Sets the rocket turret to its destroyed state, freezing it in place and emitting sparks.
Toggle:
Toggle
Toggle the enabled/disabled status of this entity.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnFoundTarget
Fired when the rocket turret finds an unobstructed target.
OnLostTarget
Fired when turret's target is blocked.
OnDeath
Fired after this turret finishes its destroy think and begins its death think

See also