Основные входы

From Valve Developer Community
Jump to navigation Jump to search
English (en)Русский (ru)中文 (zh)Translate (Translate)

Входы

<dl id="AddOutput(en)" style="margin-block:.4em 1em">

AddOutput(en) <строка(en)>
Присваивает этому объекту новый выход или ключ-параметр. Для некоторых ключ-параметров необходимо выполнение дополнительного кода, и они не будут работать, если их просто изменить через этот вход.
Формат: <имя> <целевой объект>:[имя входа]:[параметр]:[задержка]:[количество срабатываний, -1 - бесконечно]
Формат: <ключ> <значение>

<dl id="Kill(en)" style="margin-block:.4em 1em">

Kill(en)
Удаляет из игрового процесса этот объект и всех связанных потомков этого объекта.
FireUser1 to FireUser4  <строка(en)>
Срабатывает соответствующие выходы OnUser. Смотрите раздел Пользовательские входы и выходы(en).
Warning.pngПредупреждение: Can take string parameter and doesn't do anything with it. This can cause an issue if this input is fired from outputs that can send a value. Make sure to specify dummy string in such cases other-wise the output will use its value as parameter causing the input to fail with "bad input/output link" error in console.
SetDamageFilter <имя объекта(en)>
Устанавливает фильтр(en), определяющий урон, получаемый данным объектом.

Наследование

SetParent <имя объекта(en)>
поддерживает !activator, но не !caller
Определяет родительский объект для совместного перемещения объекта вместе с ним. Смотрите Иерархия объектов мира (наследование)(en).
SetParentAttachment <строка(en)>
Преопределяет точку крепления(en) родительского объекта для присоединения этого объекта. Объект будет перемещён таким образом, чтобы положение его коренной кости(en) совпадало с положением точки крепления. Перед использованием этого входа необходимо указать родительский объект.
SetParentAttachmentMaintainOffset <строка(en)>
Аналогичен предыдущему, но без перемещения. Объект сохраняет свое смещение относительно точки крепления в момент срабатывания входа.
ClearParent
Удаляет этот объект из иерархии движений, позволяя перемещаться самостоятельно.
KillHierarchy
Работает аналогично входу Kill, за исключением того, что объект и все его дочерние объекты уничтожаются за один шаг расчёта, что немного быстрее, чем вход Kill.

Сценарии VScript

RunScriptFile <сценарий(en)> (Во всех играх начиная с Left 4 Dead 2) (также в Ветвь Team Fortress 2)
Execute a VScript(en) file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <строка(en)> (Во всех играх начиная с Left 4 Dead 2) (также в Ветвь Team Fortress 2)
Execute a string of VScript source code in the scope of the entity receiving the input. Variables activator, caller, self are available when the script is run (same applies to RunScriptFile).
Warning.pngПредупреждение: Using the quote symbol " in any text field of a Hammer Object Properties Dialog will lead to VMF corruption, fixable only by editing the VMF directly with a text editor and removing the added quote symbol.
Tip.pngСовет: In Ветвь Team Fortress 2 backticks ` are converted to " when the input is processed. If a string is needed in other games then foreach can be used like foreach(k,v in {the_string_I_need=0}) printl(k), but that looks confusing and only strings that are also valid identifiers can be created this way so it's preferable to use RunScriptFile or Entity Scripts(en) instead. Mind that using quotes itself within IO events is not an issue, so using EntFire or adding outputs via script can be done by escaping the quotes \". Hammer does not provide a way to escape them. Example: EntFire("target", "RunScriptCode", "printl(\"I am: \" + self + \" !\")").
Icon-Bug.pngБаг:Trying to use activator or caller by running this input on an entity that doesn't yet have a script scope will cause error as those variables are only populated when script scope exists. Calling the input second time will have them because the first call did create the script scope. This is fixed in Ветвь Team Fortress 2 Ветвь Team Fortress 2.
CallScriptFunction <строка(en)> (Во всех играх начиная с Left 4 Dead 2) (также в Ветвь Team Fortress 2) Отсутствует в FGD!
Calls a VScript function defined in the scope of the receiving entity.
Note.pngПримечание: activator and caller are unavailable.
Note.pngПримечание: If the function requires arguments/parameters, then RunScriptCode or RunScriptFile will need to be used instead.
TerminateScriptScope  (только в Ветвь Team Fortress 2) Отсутствует в FGD!
Destroys the script scope of the receiving entity.

Текстовые блоки

AddContext <строка(en)>
Добавляет к объекту список текстовых ответов(en). Смотрите Контекст(en).
ClearContext
Очищает список текстовых ответов этого объекта.
Warning.pngПредупреждение: Should not be used outside of debugging purposes if vscript modding is available as one never knows what they might be deleting especially on player entities. There are often vscript mods that store information as contexts for various purposes.
RemoveContext <строка(en)>
Удаляет текстовый ответ из списка этого объекта. Имя должно соответствовать ключу существующего блока текста.

Отображение

RenderFields:

Alpha <целое число(en) 0–255>
Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its rendermode set to a number other than 0.
Color <цвет КЗС(en)>
Sets an RGB color for the entity.

Shadow:

DisableShadow
Turn dynamic shadows off for this entity. Identical to applying  EF_NOSHADOW.
EnableShadow
Turn dynamic shadows on for this entity.
DisableReceivingFlashlight  (Во всех играх начиная с Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (Во всех играх начиная с Portal 2)
This object may receive light or shadows from projected textures.

Прочие

Use  Отсутствует в FGD!
Same as a player invoking +use(en); no effect in most cases.
SetTeam <целое число(en)> Отсутствует в FGD!
Changes this entity's team.
TeamNum <целое число(en)> Отсутствует в FGD!
This input changes value for TeamNum property.
DispatchResponse <строка(en)> Отсутствует в FGD!
Dispatches a response to the entity. See Response(en) and Concept(en).
DispatchEffect <строка(en)> (удалено начиная с Left 4 Dead) Отсутствует в FGD!
Dispatches a special effect from the entity's origin; See also List of Client Effects(en). Replaced by the particle(en) system since Left 4 Dead.
SetLocalOrigin <координаты(en)> (Во всех играх начиная с Portal 2) Отсутствует в FGD!
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles <углы(en)> (Во всех играх начиная с Portal 2) Отсутствует в FGD!
Set this entity's angles.