Env entity maker: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Undo revision 286095 by THE OWL (talk))
Tag: Undo
mNo edit summary
Line 1: Line 1:
{{lang|Env entity maker}}
{{lang|title=env_entity_maker}}
{{entity|type=e0|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|env_entity_maker|type=e0}} 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.


{{code class|CEnvEntityMaker|env_entity_maker.cpp}}
{{Code class|CEnvEntityMaker|env_entity_maker.cpp}}


==Flags==
== Flags ==
*1: Enable AutoSpawn - Spawn template whenever there's enough room to fit it, and the player is not looking.
*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.
*2: AutoSpawn: Wait for entity to be destroyed.
Line 11: Line 11:
*16: <code>ForceSpawn</code>: Spawn only if the player isn't looking.
*16: <code>ForceSpawn</code>: Spawn only if the player isn't looking.


==Keyvalues==
== Keyvalues ==
{{KV|Point_template To Spawn|intn=EntityTemplate|target_destination|Name of the <code>point_template</code> to spawn ''here''.}}
{{KV|Point_template To Spawn|intn=EntityTemplate|target_destination|Name of the <code>point_template</code> to spawn ''here''.}}
{{KV|PostSpawn Movement Speed|intn=PostSpawnSpeed|float|All entities spawned will move this many [[hammer units]] per second in the direction of '''PostSpawn Movement Direction'''.}}
{{KV|PostSpawn Movement Speed|intn=PostSpawnSpeed|float|All entities spawned will move this many [[hammer units]] per second in the direction of '''PostSpawn Movement Direction'''.}}
Line 19: Line 19:
{{KV BaseEntity|css=1}}
{{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|param=target_destination|Spawn an instance of the template at the same origin and angles as a specified entity.}}
{{IO|ForceSpawnAtEntityOrigin|param=target_destination|Spawn an instance of the template at the same origin and angles as a specified entity.}}
{{I BaseEntity|prel4d=1}}
{{I BaseEntity|prel4d=1}}


==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 BaseEntity|l4d=1}}
{{O BaseEntity|l4d=1}}

Revision as of 14:42, 7 March 2023

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

Template:Entity 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) <targetname>
Name of the point_template to spawn here.
PostSpawn Movement Speed (PostSpawnSpeed) <float>
All entities spawned will move this many hammer units per second in the direction of PostSpawn Movement Direction.
PostSpawn Movement Direction (PostSpawnDirection) <angle>
All entities spawned in the template will move in this direction.
PostSpawn Direction Variance (PostSpawnDirectionVariance) <float>
The PostSpawn Movement Direction may vary by this many degrees. This is a radius.
PostSpawn Inherit Angles (PostSpawnInheritAngles) <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.