This article's documentation is for anything that uses the Source engine. Click here for more information.

env_sprite

From Valve Developer Community
Jump to: navigation, search
Underlinked - Logo.png
This article needs more links to other articles to help integrate it into the encyclopedia. Please help improve this article by adding links that are relevant to the context within the existing text.
January 2024


English (en)Русский (ru)中文 (zh)
... Icon-Important.png

env_sprite is a point entity available in all Source Source games. Это создаёт sprite в вашем мире. Спрайты всегда смотрят на игрока.

Note.pngNote:This entity may also use env_glow for the classname.
Note.pngNote:This is a preserved entity in .
  • On a new round, its properties including its position will intentionally not reset. You can use logic_auto to emulate resetting it.
  • Killing it removes it forever, as it is not respawned on a new round.
  • It cannot be spawned with a point_template.
  • Parenting this with non preserved entities may have undesirable effects.
Note.pngNote:Единственные render modes, которые рендерят прозрачность спрайта, это Glow , Additive , Additive Fractional Frame , World Space Glow и Alpha Add !FGD.
Icon-Bug.pngBug:При выборе спрайта, его расширения файла после имени не обязательно .spr / .vmt. В то время как предварительный просмотр спрайта может найти спрайт, расширение должно быть введено вручную, чтобы движок мог найти спрайт в игре. (Исправлено в Source 2009.)


In code, it is represented by theCSpriteclass, defined in theSprite.cppfile.

Flags

English (en)Русский (ru)中文 (zh)
... Icon-Important.png

Sprite:

  • 1: Включен
  • 2: Проиграть один раз - используется для анимированных спрайтов; текстура оживится один раз, затем спрайт выключится..

Keyvalues

Sprite:

Sprite Name (model) (???) <string>
Путь к vmt файлу.
Scale (scale) (???) <float>
Масштабный множитель спрайта.
Icon-Bug.pngBug:Спрайтовая шкала Hammer'a по умолчанию 0.25, но двигатель имеет 1.0. Чтобы синхронизировать значения, установите это значение ключа на что-то.
Framerate (framerate) (???) <string>
Скорость, с которой спрайт должен анимироваться, если есть вообще.
Starting Frame (frame) (???) <float> !FGD
Если спрайт анимирован, кадр должен начать анимацию с.
Size of Glow Proxy Geometry (GlowProxySize) (???) <float>
Размер свечения для визуализации. Каждый раз, когда сфера этого радиуса будет видна (пробираясь сквозь любую соседнюю геометрию), свечение будет визуализировано.
HDR color scale (HDRColorScale) (???) <float>
Цветовой множитель для игроков, использующих HDR.

DXLevelChoice:

Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <choices> (removed since Left 4 Dead)
The entity will not exist if the engine is running outside the given range of DirectX Versions.
Choices
Warning.pngWarning:If these are used, the object may break when the user switches their DirectX settings.

RenderFields:
Render Mode <choices>
Установить нестандартный режим рендера энтити. Смотрите Режимы рендера для более подробной информации.
FX Amount <int> <0-255>
Интенсивность выбранного режима рендера
FX Color (R G B) <color255>
Цвет для выбранного режима рендера
Disable Receiving Shadows <bool>
Предотвращает энтити от отбрасывания тени.
Render FX (renderfx) <варианты выбора>
Несколько GoldSrc GoldSrc режимов отображения, которые могут изменить процесс рендера энтити.

  • 0: None
  • 1: Slow Pulse (varies alpha by ±16 over a period of 1.5 s)
  • 2: Fast Pulse (varies alpha by ±16 over a period of 0.4 s)
  • 3: Slow Wide Pulse (varies alpha by ±64 over a period of 1.5 s)
  • 4: Fast Wide Pulse (varies alpha by ±64 over a period of 0.4 s)
  • 5: Slow Fade Away (decreases alpha by -1 per frame/(in all games since Left 4 Dead) Fades out over 4 s)
  • 6: Fast Fade Away (decreases alpha by -4 per frame/(in all games since Left 4 Dead) Fades out over 1 s)
  • 7: Slow Become Solid (increases alpha by +1 per frame/(in all games since Left 4 Dead) Fades in over 4 s)
  • 8: Fast Become Solid (increases alpha by +4 per frame/(in all games since Left 4 Dead) Fades in over 1 s)
  • 9: Slow Strobe (transparent 0.8 s, visible 0.8 s, repeat)
  • 10: Fast Strobe (transparent 0.2 s, visible 0.2 s, repeat)
  • 11: Faster Strobe (transparent 0.09 s, visible 0.09 s, repeat)
  • 12: Slow Flicker (transparent 0.18 s, visible 1.5 s, repeat)
  • 13: Fast Flicker (transparent 0.14 s, visible 0.2 s, repeat)
  • 14: Constant Glow ("NoDissipation;" purpose uncertain—for sprites?)
  • 15: Distort (causes unnatural flickering and position shifting)/(in all games since Left 4 Dead) Fade Out (instant; not very useful outside of code)
  • 16: Hologram (Distort + "distance fade")/(in all games since Left 4 Dead) Fade In (instant; not very useful outside of code)
  • 17: Scale Up ("Explode"/"scale up really big!" causes wild stretching of model parts) (in Source 2013)/Fade Wider Pulse (varies alpha by ±255 over a period over a period of 0.26 s) (in all games since Left 4 Dead)
    Подтверждаю:which branches/games is it available in, and where does it do what?
  • 18: Glow Shell (purpose unclear) (in all games since Source 2013)
    Подтверждаю:what does this do? and which games is it in?
  • 19: Clamp Minimum Scale ("keep this sprite from getting very small (SPRITES only!)")
  • 20: Environmental Rain ("for environmental rendermode English, make rain") (in Source 2013)
    Подтверждаю:which games? may be nonfunctional.
  • 21: Environmental Snow ("for environmental rendermode English, make snow") (in Source 2013)
    Подтверждаю:which games? may be nonfunctional.
  • 22: Spotlight FX ("TEST CODE for experimental spotlight") (in Source 2013)
  • 23: Ragdoll ("HACKHACK: TEST CODE for signalling death of a ragdoll character;" ragdolls an entity but doesn't kill it) (in Source 2013)
    Подтверждаю:which games? may be nonfunctional?
  • 24: Fade Wider Pulse (varies alpha by ±255 over a period over a period of 0.26 s) (in Source 2013)
  • 25: kRenderFXMax/Fade Near (removed since Left 4 Dead)
Blank image.pngTodo: what does this do? may be nonfunctional


Base:

Classname English (classname) <строка>
Имя класса определяет тип объекта. Имена классов могут быть изменены с помощью AddOutput, который будет влиять на то, как движок взаимодействует с сущностью в определенных обстоятельствах..
Name English (targetname) <строка>
Имя (название объекта), к которому другие объекты относятся.
Global Entity Name (globalname) <строка>
Имя, под которым этот объект связан с другим объектом на другой карте. Когда игрок переходит на новую карту, объектам на новой карте с глобальными именами, совпадающим с объектами на предыдущей карте, будет скопировано состояние предыдущей карты по их состоянию..
Parent (parentname) <конечное имя>
Определяет источник движения. Предприятие сохранит свое первоначальное смещение от своего источника. Точка присоединения может быть добавлена в конце имени через запятую. «Каждая» сущность может присоединиться, даже к точечным объектам. Объекты, которые являются источниками, будут вынуждены перейти к следующей карте, например, из trigger_transition English. Некоторые объекты, которые не предназначены для источников, могут работать неправильно. phys_constraint English можно использовать в качестве обходного пути для определения источника.
Origin English (X Y Z) (origin) <coordinates English>
Положение центра этого объекта в мире. Вращающиеся объекты обычно вращаются вокруг своего происхождения.
Pitch Yaw Roll English (X Y Z) (angles) <угловое значение>
Ориентация объекта в мире. Pitch - это вращение вокруг оси Y, yaw - это вращение вокруг оси Z, roll - это вращение вокруг оси X.
Note.pngNote:Это работает для брашей, хотя Hammer не показывает новые углы.
Flags English (spawnflags) <целое значение>
Переключает функции объекта, его конкретный номер определяется комбинацией добавленных флагов..
Response Contexts English (ResponseContext) <строка>
Предопределенные обстановок системы ответа для этого объекта. Формат: <код> ключ: значение, ключ: значение, ... </ code>. Обстановки могут быть filtered.
Effects English (effects) <целое значение> Отсутствует в FGD! English
Комбинация флагов эффектов для использования.


Inputs

English (en)Русский (ru)中文 (zh)
... Icon-Important.png

Sprite:ru:

SetScale <float>
Устанавливает масштаб.
HideSprite
Делает спрайт невидимым.
ShowSprite
Делает спрайт видимым.
ToggleSprite
Сделать спрайт невидимым или видимым в зависимости от текущего состояния.
ColorRedValue <float>
Изменить интенсивность красного канала (0-255).
ColorGreenValue <float>
Изменить интенсивность зелёного канала (0-255).
ColorBlueValue <float>
Изменить интенсивность синего канала (0-255).

RenderFields:
Alpha  <целое значение>
Прозрачность спрайта (0 - 255).
Color  <color255>
Цвет спрайта (R G B).

Base:
AddContext <string>
Adds to the entity's list of response contexts. See Context.
AddOutput <string>
Assigns a new keyvalue/output on this entity. For keyvalues, some rely on extra necessary code to be ran and won't work if its simply just changed through this input. There is a strict format that must be followed:
// Format of changing KeyValues: "AddOutput [key] [value]"
//// Raw text:
"OnUser1" "!self,AddOutput,targetname new_name"

// Format of adding an Output: "AddOutput {targetname}:{inputname}:{parameter}:{delay}:{max times to fire, -1 means infinite}"
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:SetParent:!activator:0.0:-1"
// Arguments can be left blank, but the empty blank should still be contained.
//// Raw text:
"OnUser1" "!self,AddOutput,OnUser1:ClearParent::0.0:-1"
ClearContext
Removes all contexts from this entity's list.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.
FireUser1 to FireUser4
Fires the respectiveOnUseroutputs; see User Inputs and Outputs.
Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster thanKillinput.
RemoveContext <string>
Remove a context from this entity's list. The name should match the key of an existing context.
SetParent <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
Use  !FGD
Same as a player invoking +use; no effect in most cases.
DispatchResponse <string> !FGD
Dispatches a response to the entity. See Response and Concept.
DispatchEffect <string> (removed since Left 4 Dead) !FGD
Dispatches a special effect from the entity's origin; See also List of Client Effects. Replaced by the particle system since Left 4 Dead.
RunScriptFile <script> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Icon-Bug.pngBug:In Hammer, using string arguments will corrupt the VMF file's structure, making the file unviewable for the next Hammer session.
Note.pngFix:Remove the string argument manually with a text editor.
Note.pngNote:Team Fortress 2 Backtick characters ` are replaced with quotation marks at runtime, allowing quotation marks to be used when normally not possible.
CallScriptFunction <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2) !FGD
Calls a VScript function defined in the scope of the receiving entity.
TerminateScriptScope  (only in Team Fortress 2) !FGD
Destroys the script scope of the receving entity.
SetLocalOrigin <coordinates> (in all games since Alien Swarm) !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 <angles> (in all games since Alien Swarm) !FGD
Set this entity's angles.

Outputs

Base:

OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (only in Left 4 Dead)
This output fires when the entity is killed and removed from the game.

See also