Env entity maker: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Undo revision 175358 by Sauerfiend (talk))
(updates)
Line 1: Line 1:
{{base point|env_entity_maker}}  
{{lang|Env entity maker}}
{{base point|env_entity_maker}} It spawns a specified {{ent|point_template}} entity at the <code>env_entity_maker</code>'s [[origin]]. It can be set to spawn automatically or through inputs.


==Entity description==
{{code class|CEnvEntityMaker|env_entity_maker.cpp}}
It spawns the specified [[entity]] [[point_template|template]] at the env_entity_maker's [[origin]]. If set to auto-spawn, it will spawn the template whenever there's room and the player is looking elsewhere.


== Keyvalues ==
==Flags==
{{KV|Point_template To Spawn|target_destination|Name of the [[point_template]] to spawn '''here'''.}}
*1: Enable AutoSpawn - Spawn template whenever there's enough room to fit it, and the player is not looking.
{{KV|PostSpawn Movement Speed|float|If specified, all the entities created in the template will move this fast in the specified PostSpawn Movement Direction.}}
*2: AutoSpawn: Wait for entity to be destroyed.
{{KV|PostSpawn Movement Direction|angle|If a PostSpawn Movement Speed is specified, all the entities created in the template will move in this direction.}}
*4: AutoSpawn: Spawn even if the player is looking.
{{KV|PostSpawn Direction Variance|float|This variance is applied to the PostSpawn Movement Direction for each spawned entity in the template. Use it to apply some randomness to the directions.}}
*8: <code>ForceSpawn</code>: Spawn only if there's enough room to fit the object.
{{KV|PostSpawn Inherit Angles|boolean|If in hierarchy, is spawn direction in world space, or object local space of parent}}
*16: <code>ForceSpawn</code>: Spawn only if the player isn't looking.
{{KV Targetname}}
{{KV Parentname}}
{{KV Angles}}


== Flags ==
==Keyvalues==
:* 1 : Enable AutoSpawn (will spawn whenever there's room)
{{KV|Point_template To Spawn (EntityTemplate)|target_destination|Name of the <code>point_template</code> to spawn ''here''.}}
:* 2 : AutoSpawn: Wait for entity destruction
{{KV|PostSpawn Movement Speed (PostSpawnSpeed)|float|All entities spawned will move this many [[hammer units]] per second in the direction of '''PostSpawn Movement Direction'''.}}
:* 4 : AutoSpawn: Even if the player is looking
{{KV|PostSpawn Movement Direction (PostSpawnDirection)|angle|All entities spawned in the template will move in this direction.}}
:* 8 : ForceSpawn: Only if there's room
{{KV|PostSpawn Direction Variance (PostSpawnDirectionVariance)|float|The '''PostSpawn Movement Direction''' may vary by this many degrees. This is a radius.}}
:* 16 : ForceSpawn: Only if the player isn't looking
{{KV|PostSpawn Inherit Angles (PostSpawnInheritAngles)|boolean|If '''Yes''', offset the spawn angles by the angles of a '''Parent'''.}}
{{KV BaseEntity|css=1}}


== Inputs ==
==Inputs==
{{IO|ForceSpawn|Spawn an instance of the template at this origin and angle.}}
{{IO|ForceSpawn|Spawn an instance of the template at this origin and angle.}}
{{IO|ForceSpawnAtEntityOrigin|Spawn an instance of the template that the same origin and angle as the specified entity (specify by targetname in parameters)|param=target_destination}}
{{IO|ForceSpawnAtEntityOrigin|param=target_destination|Spawn an instance of the template at the same origin and angles as a specified entity.}}
{{I Targetname}}
{{I BaseEntity|prel4d=1}}
{{I Parentname}}


== Outputs ==
==Outputs==
{{IO|OnEntitySpawned|Fired when an instance of the entity template has been spawned.}}
{{IO|OnEntitySpawned|Fired when an instance of the entity template has been spawned.}}
{{IO|OnEntityFailedSpawn|Fired when a <code>ForceSpawn</code> input failed to spawn the template, either due to lack of space or being in player's view, depending on the spawnflags.}}
{{IO|OnEntityFailedSpawn|Fired when a <code>ForceSpawn</code> input failed to spawn the template, either due to lack of space or being in player's view, depending on the spawnflags.}}
{{O Targetname}}
{{O BaseEntity|l4d=1}}

Revision as of 05:54, 24 September 2018

English (en)Русский (ru)中文 (zh)Translate (Translate)

Template:Base point It spawns a specified point_template entity at the env_entity_maker's origin. It can be set to spawn automatically or through inputs.

C++ In code, it is represented by theCEnvEntityMakerclass, defined in theenv_entity_maker.cppfile.

Flags

  • 1: Enable AutoSpawn - Spawn template whenever there's enough room to fit it, and the player is not looking.
  • 2: AutoSpawn: Wait for entity to be destroyed.
  • 4: AutoSpawn: Spawn even if the player is looking.
  • 8: ForceSpawn: Spawn only if there's enough room to fit the object.
  • 16: ForceSpawn: Spawn only if the player isn't looking.

Keyvalues

Point_template To Spawn (EntityTemplate) ([todo internal name (i)]) <targetname>
Name of the point_template to spawn here.
PostSpawn Movement Speed (PostSpawnSpeed) ([todo internal name (i)]) <float>
All entities spawned will move this many hammer units per second in the direction of PostSpawn Movement Direction.
PostSpawn Movement Direction (PostSpawnDirection) ([todo internal name (i)]) <angle>
All entities spawned in the template will move in this direction.
PostSpawn Direction Variance (PostSpawnDirectionVariance) ([todo internal name (i)]) <float>
The PostSpawn Movement Direction may vary by this many degrees. This is a radius.
PostSpawn Inherit Angles (PostSpawnInheritAngles) ([todo internal name (i)]) <boolean>
If Yes, offset the spawn angles by the angles of a Parent.


Inputs

ForceSpawn
Spawn an instance of the template at this origin and angle.
ForceSpawnAtEntityOrigin <targetnameRedirectInput/string>
Spawn an instance of the template at the same origin and angles as a specified entity.


Outputs

OnEntitySpawned
Fired when an instance of the entity template has been spawned.
OnEntityFailedSpawn
Fired when a ForceSpawn input failed to spawn the template, either due to lack of space or being in player's view, depending on the spawnflags.