Npc rocket turret: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:


{{portal series point|npc_rocket_turret}} It spawns an Aperture Science Rocket Turret.
{{portal series point|npc_rocket_turret}} It spawns an Aperture Science Rocket Turret.
{{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.}}
{{note|In Portal 2, rocket turrets need to be sent a SetTarget input every time before they are turned on.}}
{{bug|In Portal 2, this entity can not fire rockets correctly, the rockets will spawn stuck inside the npc. You will have to include a [[trigger_push]] entity in your map to dislodge them. {{todo|Does this ''actually'' work?|todo}}|bug}}
{{bug|In Portal 2, rockets are spawned with a speed of 0. You will need to use a VScript to set the rocket to the correct speed.}}




Line 10: Line 10:
{{KV|Rocket Speed|float|Speed the rocket will travel at.|since=P2}}
{{KV|Rocket Speed|float|Speed the rocket will travel at.|since=P2}}
{{KV|Rocket Lifetime|float|The rocket will automatically detonate after this number of seconds.|since=P2}}
{{KV|Rocket Lifetime|float|The rocket will automatically detonate after this number of seconds.|since=P2}}
{{KV|Tripwire Mode|boolean|Makes this sentry aim in a fixed direction and not follow the player. Still fires rockets when beam is crossed. (Seemingly similar to [[prop_rocket_tripwire]])|since=P2}}
{{KV|Tripwire Mode|boolean|Makes this sentry aim in a fixed direction and not follow the target entity. It will still fire rockets when said entity crosses the beam. (Similar to [[prop_rocket_tripwire]], but allows aiming in any direction)|since=P2}}
{{KV|Tripwire Aim Target|targetname|(tripwire mode only) An info target this sentry will aim it's beam at. If not specified, will aim down world angles.|since=P2}}
{{KV|Tripwire Aim Target|targetname|In tripwire mode, the entity to aim at. If not specified, will aim down world angles.|since=P2}}
{{KV Parentname}}
{{KV Parentname}}
{{KV Targetname}}
{{KV Targetname}}
Line 17: Line 17:


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

Revision as of 19:34, 13 June 2020

Aperture Science Rocket Turret
Turret is firing

Template:Portal series point It spawns an Aperture Science Rocket Turret.

Note.pngNote:In Portal 2, rocket turrets need to be sent a SetTarget input every time before they are turned on.
Icon-Bug.pngBug:In Portal 2, rockets are spawned with a speed of 0. You will need to use a VScript to set the rocket to the correct speed.  [todo tested in ?]


Keyvalues

Rocket Speed ([todo internal name (i)]) <float> (in all games since Portal 2)
Speed the rocket will travel at.
Rocket Lifetime ([todo internal name (i)]) <float> (in all games since Portal 2)
The rocket will automatically detonate after this number of seconds.
Tripwire Mode ([todo internal name (i)]) <boolean> (in all games since Portal 2)
Makes this sentry aim in a fixed direction and not follow the target entity. It will still fire rockets when said entity crosses the beam. (Similar to prop_rocket_tripwire, but allows aiming in any direction)
Tripwire Aim Target ([todo internal name (i)]) <targetname> (in all games since Portal 2)
In tripwire mode, the entity to aim at. If not specified, will aim down world angles.
Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
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

Pitch Yaw Roll (Y Z X) (angles) <QAngle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

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.
Parentname:
SetParent <stringRedirectInput/string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <stringRedirectInput/string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <stringRedirectInput/string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.
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