Env entity maker: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Updated from deprecated template to Entity template)
m (Test)
Line 12: Line 12:


==Keyvalues==
==Keyvalues==
{{KV|Point_template To Spawn|intn=EntityTemplate|target_destination|Name of the <code>point_template</code> to spawn ''here''.}}
{{KV|start}}
{{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|new=1|EntityTemplate|target_destination|Point_template To Spawn|Name of the <code>point_template</code> to spawn ''here''.}}
{{KV|PostSpawn Movement Direction|intn=PostSpawnDirection|angle|All entities spawned in the template will move in this direction.}}
{{KV|new=1|PostSpawnSpeed|float|PostSpawn Movement Speed|All entities spawned will move this many [[hammer units]] per second in the direction of '''PostSpawn Movement Direction'''.}}
{{KV|PostSpawn Direction Variance|intn=PostSpawnDirectionVariance|float|The '''PostSpawn Movement Direction''' may vary by this many degrees. This is a radius.}}
{{KV|new=1|PostSpawnDirection|angle|PostSpawn Movement Direction|All entities spawned in the template will move in this direction.}}
{{KV|PostSpawn Inherit Angles|intn=PostSpawnInheritAngles|boolean|If '''Yes''', offset the spawn angles by the angles of a '''Parent'''.}}
{{KV|new=1|PostSpawnDirectionVariance|float|PostSpawn Direction Variance|The '''PostSpawn Movement Direction''' may vary by this many degrees. This is a radius.}}
{{KV BaseEntity|css=1}}
{{KV|new=1|PostSpawnInheritAngles|boolean|PostSpawn Inherit Angles|If '''Yes''', offset the spawn angles by the angles of a '''Parent'''.}}
{{KV BaseEntity|new=1|css=1}}
{{KV|end}}


==Inputs==
==Inputs==

Revision as of 14:39, 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

start ([todo internal name (i)])
EntityTemplate ([todo internal name (i)]) <targetname>
Point_template To Spawn
PostSpawnSpeed ([todo internal name (i)]) <float>
PostSpawn Movement Speed
PostSpawnDirection ([todo internal name (i)]) <angle>
PostSpawn Movement Direction
PostSpawnDirectionVariance ([todo internal name (i)]) <float>
PostSpawn Direction Variance
PostSpawnInheritAngles ([todo internal name (i)]) <boolean>
PostSpawn Inherit Angles


end ([todo internal name (i)])

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.