Template:I BaseNPC:ru: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "{{ScrollBox|title=BaseNPC| ; <code>SetRelationship <string|targetname or classname> <string|disposition> <int|rank></code> : Changes whether this N...")
 
mNo edit summary
Line 9: Line 9:
; <code>SetHealth <[[int]]></code>
; <code>SetHealth <[[int]]></code>
: Set the NPC's health.
: Set the NPC's health.
; {{EP2 add|<code>AddHealth <[[int]]></code>}}
; {{EP2 add:ru|<code>AddHealth <[[int]]></code>}}
; {{EP2 add|<code>RemoveHealth <[[int]]></code>}}
; {{EP2 add:ru|<code>RemoveHealth <[[int]]></code>}}
: Add to or remove from the NPC's health.
: Add to or remove from the NPC's health.
; <code>SetBodyGroup <[[int]]></code>
; <code>SetBodyGroup <[[int]]></code>
Line 26: Line 26:
; <code>Break</code>
; <code>Break</code>
: Smash into pieces. If this is not possible, disappear.
: Smash into pieces. If this is not possible, disappear.
; {{EP2 add|<code>BecomeRagdoll</code>}}
; {{EP2 add:ru|<code>BecomeRagdoll</code>}}
: Become a [[ragdoll]] without removing yourself?
: Become a [[ragdoll]] without removing yourself?
; <code>StartScripting</code>
; <code>StartScripting</code>
Line 44: Line 44:
; <code>IgnoreDangerSounds <[[float]]></code>
; <code>IgnoreDangerSounds <[[float]]></code>
: Ignore danger sounds for the specified number of seconds.
: Ignore danger sounds for the specified number of seconds.
; {{EP1 add|<code>HolsterWeapon</code>}}
; {{EP1 add:ru|<code>HolsterWeapon</code>}}
; {{EP1 add|<code>UnholsterWeapon</code>}}
; {{EP1 add:ru|<code>UnholsterWeapon</code>}}
: Force the NPC to holster or unholster their weapon. Ignored if the NPC is scripting or if the NPC doesn't use weapons.
: Force the NPC to holster or unholster their weapon. Ignored if the NPC is scripting or if the NPC doesn't use weapons.
; {{EP1 add|<code>HolsterAndDestroyWeapon</code>}}
; {{EP1 add:ru|<code>HolsterAndDestroyWeapon</code>}}
: As <code>HolsterWeapon</code>, except the weapon is destroyed once it has been concealed.
: As <code>HolsterWeapon</code>, except the weapon is destroyed once it has been concealed.
; {{EP1 add|<code>ForceInteractionWithNPC <[[string]]></code>}}
; {{EP1 add:ru|<code>ForceInteractionWithNPC <[[string]]></code>}}
: Force the NPC to use a dynamic interaction with another NPC. Syntax is <code><[[targetname]]> <dynamic interaction></code>.
: Force the NPC to use a dynamic interaction with another NPC. Syntax is <code><[[targetname]]> <dynamic interaction></code>.
; {{EP1 add|<code>UpdateEnemyMemory <[[targetname]]></code>}}
; {{EP1 add:ru|<code>UpdateEnemyMemory <[[targetname]]></code>}}
: Update (or create) this NPC's memory of of the given entity.
: Update (or create) this NPC's memory of of the given entity.
{{I RenderFields:ru}}
{{I RenderFields:ru}}

Revision as of 22:41, 1 May 2012

BaseNPC:
SetRelationship <string|targetname or classname> <string|disposition> <int|rank>
Changes whether this NPC likes or dislikes certain others. Used like the ai_relationship entity, with this NPC as the subject.
Values for disposition are:
  • D_HT: Hate
  • D_FR: Fear
  • D_LI: Like
  • D_NU: Neutral
SetHealth <int>
Set the NPC's health.

AddHealth <int> (in all games since Source 2007)

RemoveHealth <int> (in all games since Source 2007)

Add to or remove from the NPC's health.
SetBodyGroup <int>
Sets this NPC's body group (from 0 - n).
physdamagescale <float>
Scales the damage taken when this character is hit by a physics object. 0 means this feature is disabled for backwards compatibility.
Ignite
Burst into flames.
IgniteLifetime <float>
Ignite for the given number of seconds.
IgniteNumHitboxFires <int>
Ignite with the given number of hitbox fires.
IgniteHitboxFireScale <float>
Ignite with the given hitbox fire scale.
Break
Smash into pieces. If this is not possible, disappear.

BecomeRagdoll (in all games since Source 2007)

Become a ragdoll without removing yourself?
StartScripting
StopScripting
Enter/exit scripting state, where NPCs ignore a variety of stimulus that would make them break out of their scripts. They ignore danger sounds, ignore +USE, don't idle speak or respond to other NPC's idle speech, and so on.
Assault <targetname>
Start an assault at the given rally point.
SetSquad <string>
Change the name of this NPC's squad. Leaving the parameter blank will remove the NPC from any existing squad.
Wake
Wakes up the NPC if it is sleeping.
ForgetEntity <targetname>
Clears out the NPC's knowledge of a named entity.
GagEnable
GagDisable
Gagged NPCs won't speak (or moan, caw, etc.) unless made to be a choreographed scene.
IgnoreDangerSounds <float>
Ignore danger sounds for the specified number of seconds.

HolsterWeapon (in all games since Half-Life 2: Episode One)

UnholsterWeapon (in all games since Half-Life 2: Episode One)

Force the NPC to holster or unholster their weapon. Ignored if the NPC is scripting or if the NPC doesn't use weapons.

HolsterAndDestroyWeapon (in all games since Half-Life 2: Episode One)

As HolsterWeapon, except the weapon is destroyed once it has been concealed.

ForceInteractionWithNPC <string> (in all games since Half-Life 2: Episode One)

Force the NPC to use a dynamic interaction with another NPC. Syntax is <targetname> <dynamic interaction>.

UpdateEnemyMemory <targetname> (in all games since Half-Life 2: Episode One)

Update (or create) this NPC's memory of of the given entity.
RenderFields:
Alpha <integer>
Прозрачность спрайта (0 - 255).
Color <color255>
Цвет спрайта (R G B).
DamageFilter:
SetDamageFilter <string>
Sets the entity to use as damage filter. Pass in an empty string ("") to clear the damage filter.
ResponseContext:
AddContext <string>
Добавляет к энтити список связных ответов (в контексте). Формат: <key>:<value>.
RemoveContext <string>
Удаляет контекст из списка энтити. Имя должно совпадать с ключевым названием существующего контекста.
ClearContext
Удаляет весь контекст из списка энтити.
Shadow:
DisableShadow
Turn shadow off.
EnableShadow
Turn shadow on.
DisableReceivingFlashlight  (in all games since Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (in all games since Portal 2)
This object may receive light or shadows from projected textures.
Targetname:
Kill
Удаляет этот объект из мира.
KillHierarchy
Удаляет объект и его потомков из мира.
AddOutput <string>
Определяет ключ-параметр/выход этого объекта. Потенциально представляет большую опасность, используйте с осторожностью.
Формат: <ключ-параметр> <значение>
Формат: <имя выхода> <целевой объект>:<имя входа>:<параметр>:<пауза>:<макс. количество срабатываний, -1 - бесконечно>
FireUser1 to FireUser4
Срабатывание выходов OnUser; см. Пользовательские вводы и выводы.
Use  !FGD
То же, что и при вызове +use игроком; может не всё. Можно вызвать, создав вывод, которому не указан ввод.
Этот ввод не указан в FGD-файле Valve.
RunScriptFile <script> (in all games since Left 4 Dead 2)
Выполнить файл игрового скрипта с диска.
RunScriptCode <string> (in all games since Left 4 Dead 2)
Выполнить строку исходного кода скрипта.
Warning.pngWarning:Никогда не передавайте строковые параметры функции скрипта с помощью этого входа. Это повредит структуру VMF из-за вложения кавычек, которые потребуется удалять вручную в текстовом редакторе.