Основные входы
Jump to navigation
Jump to search
AddOutput <строка>
Присваивает этому объекту новый выход или ключ-параметр. Для некоторых ключ-параметров необходимо выполнение дополнительного кода, и они не будут работать, если их просто изменить через этот вход.
Формат:
Формат:
Kill
Удаляет из игрового процесса этот объект и всех связанных потомков этого объекта.
Входы
<dl id="AddOutput" style="margin-block:.4em 1em">
Формат:
<имя> <целевой объект>:[имя входа]:[параметр]:[задержка]:[количество срабатываний, -1 - бесконечно]Формат:
<ключ> <значение><dl id="Kill" style="margin-block:.4em 1em">
- FireUser1 to FireUser4 <строка>
- Срабатывает соответствующие выходы
OnUser. Смотрите раздел Пользовательские входы и выходы.
Предупреждение: 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 <имя объекта>
- Устанавливает фильтр, определяющий урон, получаемый данным объектом.
Наследование
- SetParent <имя объекта>
- поддерживает !activator, но не !caller
- Определяет родительский объект для совместного перемещения объекта вместе с ним. Смотрите Иерархия объектов мира (наследование).
- SetParentAttachment <строка>
- Преопределяет точку крепления родительского объекта для присоединения этого объекта. Объект будет перемещён таким образом, чтобы положение его коренной кости совпадало с положением точки крепления. Перед использованием этого входа необходимо указать родительский объект.
- SetParentAttachmentMaintainOffset <строка>
- Аналогичен предыдущему, но без перемещения. Объект сохраняет свое смещение относительно точки крепления в момент срабатывания входа.
- ClearParent
- Удаляет этот объект из иерархии движений, позволяя перемещаться самостоятельно.
- KillHierarchy
- Работает аналогично входу
Kill, за исключением того, что объект и все его дочерние объекты уничтожаются за один шаг расчёта, что немного быстрее, чем входKill.
Сценарии VScript
- RunScriptFile <сценарий> (Во всех играх начиная с
) (также в
)
- Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
- RunScriptCode <строка> (Во всех играх начиная с
) (также в
)
- Execute a string of VScript source code in the scope of the entity receiving the input. Variables
activator,caller,selfare available when the script is run (same applies to RunScriptFile).
Предупреждение: 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.
Совет: In
backticks `are converted to"when the input is processed. If a string is needed in other games thenforeachcan be used likeforeach(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 instead. Mind that using quotes itself within IO events is not an issue, so usingEntFireor 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 + \" !\")").
Баг:Trying to use activatororcallerby 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.
- CallScriptFunction <строка> (Во всех играх начиная с
) (также в
) Отсутствует в FGD!
- Calls a VScript function defined in the scope of the receiving entity.
Примечание: activatorandcallerare unavailable.
Примечание: If the function requires arguments/parameters, then RunScriptCode or RunScriptFile will need to be used instead.
- TerminateScriptScope (только в
) Отсутствует в FGD!
- Destroys the script scope of the receiving entity.
Текстовые блоки
- AddContext <строка>
- Добавляет к объекту список текстовых ответов. Смотрите Контекст.
- ClearContext
- Очищает список текстовых ответов этого объекта.
Предупреждение: 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 <строка>
- Удаляет текстовый ответ из списка этого объекта. Имя должно соответствовать ключу существующего блока текста.
Отображение
RenderFields:
- Alpha <целое число 0–255>
- Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its
rendermodeset to a number other than0.
- Color <цвет КЗС>
- 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 (Во всех играх начиная с
)
- This object will not receive light or shadows from projected textures.
- EnableReceivingFlashlight (Во всех играх начиная с
)
- This object may receive light or shadows from projected textures.
Прочие
|