这篇条目有关 Source引擎。如需详情,点击这里。

Zh/Env entity maker: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
No edit summary
No edit summary
 
(20 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{lang|Env entity maker}}
{{LanguageBar}}
{{更新}}
{{this is a|point entity|name=env_entity_maker|sprite=1}}
{{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.
{{CD|CEnvEntityMaker|file1=env_entity_maker.cpp}}
它可以在<code>env_entity_maker</code>{{L|Origin|坐标}}上,生成一个指定的{{L|point_template}}实体。 允许自动生成或者通过输入生成。


{{code class|CEnvEntityMaker|env_entity_maker.cpp}}
==标志(Flags)==
*1: Enable AutoSpawn - 当有足够的空间且玩家没看见时,产生模板(Template)。
*2: AutoSpawn: 等待实体被销毁。
*4: AutoSpawn: 哪怕玩家看得见,也会生成。
*8: <code>ForceSpawn</code>: 只有在足够的空间时,才会生成。
*16: <code>ForceSpawn</code>: 只有玩家没看见时,才会生成。


==Flags==
==键值==
*1: Enable AutoSpawn - Spawn template whenever there's enough room to fit it, and the player is not looking.
{{KV Targetname}}
*2: AutoSpawn: Wait for entity to be destroyed.
{{KV|Point_template To Spawn|intn=EntityTemplate|target_destination|在'''此处'''生成<code>point_template</code>的名字}}
*4: AutoSpawn: Spawn even if the player is looking.
{{KV|PostSpawn Movement Speed|intn=PostSpawnSpeed|float|所有实体生成后,每秒会往'''PostSpawn Movement Direction'''的方向上运动多少{{L|hammer units}}。}}
*8: <code>ForceSpawn</code>: Spawn only if there's enough room to fit the object.
{{KV|PostSpawn Movement Direction|intn=PostSpawnDirection|angle|所有从模板中生成的实体都会往这个方向上移动。}}
*16: <code>ForceSpawn</code>: Spawn only if the player isn't looking.
{{KV|PostSpawn Direction Variance|intn=PostSpawnDirectionVariance|float|The '''PostSpawn Movement Direction''' may vary by this many degrees. 这是半径。}}
{{KV:zh-cn|PostSpawn Inherit Angles|intn=PostSpawnInheritAngles|boolean|如果是'''Yes''',,则按'''parent'''(父实体)的角度给予角度的偏移。}}


==Keyvalues==
==输入==
{{KV|Point_template To Spawn (EntityTemplate)|target_destination|Name of the <code>point_template</code> to spawn ''here''.}}
{{I|ForceSpawn|从模板中生成实例,位置是本实体坐标和方向。}}
{{KV|PostSpawn Movement Speed (PostSpawnSpeed)|float|All entities spawned will move this many [[hammer units]] per second in the direction of '''PostSpawn Movement Direction'''.}}
{{I|ForceSpawnAtEntityOrigin|param=实体目标名/target_destination|在指定实体上从模板中生成实例。}}
{{KV|PostSpawn Movement Direction (PostSpawnDirection)|angle|All entities spawned in the template will move in this direction.}}
{{KV|PostSpawn Direction Variance (PostSpawnDirectionVariance)|float|The '''PostSpawn Movement Direction''' may vary by this many degrees. This is a radius.}}
{{KV|PostSpawn Inherit Angles (PostSpawnInheritAngles)|boolean|If '''Yes''', offset the spawn angles by the angles of a '''Parent'''.}}
{{KV BaseEntity|css=1}}


==Inputs==
==输出==
{{IO|ForceSpawn|Spawn an instance of the template at this origin and angle.}}
{{O|OnEntitySpawned|当实例成功生成时触发。}}
{{IO|ForceSpawnAtEntityOrigin|param=target_destination|Spawn an instance of the template at the same origin and angles as a specified entity.}}
{{O|OnEntityFailedSpawn|当<code>ForceSpawn</code>输入失败时触发,取决于是否在flags,例如是否在玩家视线或者空间是否足够。}}
{{I BaseEntity|prel4d=1}}


==Outputs==
== 另见 ==  
{{IO|OnEntitySpawned|Fired when an instance of the entity template has been spawned.}}
* {{L|point_template}}
{{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}}

Latest revision as of 08:32, 25 June 2025

English (en)Русский (ru)中文 (zh)Translate (Translate)
Info content.png
This page has not been fully translated.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.


Env entity maker.png

env_entity_maker是一个点实体(en),可在所有的 起源 起源 游戏中使用。

C++ 类层级
CEnvEntityMaker
CPointEntity
CBaseEntity
C++ env_entity_maker.cpp

它可以在env_entity_maker坐标(en)上,生成一个指定的point_template(en)实体。 允许自动生成或者通过输入生成。

标志(Flags)

  • 1: Enable AutoSpawn - 当有足够的空间且玩家没看见时,产生模板(Template)。
  • 2: AutoSpawn: 等待实体被销毁。
  • 4: AutoSpawn: 哪怕玩家看得见,也会生成。
  • 8: ForceSpawn: 只有在足够的空间时,才会生成。
  • 16: ForceSpawn: 只有玩家没看见时,才会生成。

键值

Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

Point_template To Spawn (EntityTemplate) <target_destination>
此处生成point_template的名字
PostSpawn Movement Speed (PostSpawnSpeed) <浮点型(en)>
所有实体生成后,每秒会往PostSpawn Movement Direction的方向上运动多少hammer units(en)
PostSpawn Movement Direction (PostSpawnDirection) <angle(en)>
所有从模板中生成的实体都会往这个方向上移动。
PostSpawn Direction Variance (PostSpawnDirectionVariance) <浮点型(en)>
The PostSpawn Movement Direction may vary by this many degrees. 这是半径。
PostSpawn Inherit Angles (PostSpawnInheritAngles) <布尔值(en)>
如果是Yes,,则按parent(父实体)的角度给予角度的偏移。

输入

ForceSpawn
从模板中生成实例,位置是本实体坐标和方向。
ForceSpawnAtEntityOrigin <实体目标名/target_destination(en)>
在指定实体上从模板中生成实例。

输出

OnEntitySpawned
当实例成功生成时触发。
OnEntityFailedSpawn
ForceSpawn输入失败时触发,取决于是否在flags,例如是否在玩家视线或者空间是否足够。

另见