Ru/Prop data: Difference between revisions

From Valve Developer Community
< Ru
Jump to navigation Jump to search
(Created page with "{{otherlang2 |title=prop_data |en=Prop data |jp = Prop data:jp }} {{toc-right}} '''<code>prop_data</code>''' can be used to make a model: * [[#Options|Физические]...")
 
No edit summary
Line 7: Line 7:
{{toc-right}}
{{toc-right}}


'''<code>prop_data</code>''' can be used to make a model:
'''<code>prop_data</code>''' могут быть использованы, чтобы создавать модели:


* [[#Options|Физические]] (by default models with <code>prop_data</code> cannot be [[prop_static|static]])
* [[#Options|Физические]] (по умолчанию, модели с <code>prop_data</code> не могут быть [[prop_static|статикой]])
* [[#Damage modifiers|Разбиваемые]] (with [[#Gibs|gibs]])
* [[#Damage modifiers|Разбиваемые]] (с [[#Gibs|гибсами]])
* [[#Flammable props|Поджигаемые]]
* [[#Flammable props|Поджигаемые]]
* [[#Exploding props|Взрывающиеся]]
* [[#Exploding props|Взрывающиеся]]


It is a [[KeyValues]] block embedded with the QC command <code>[[$keyvalues]]</code>.
Их блок [[KeyValues]] встроен с помощью QC-команды <code>[[$keyvalues]]</code>.


{{note|The properties of a model's ''surface'' are defined by <code>[[$surfaceprop]]</code>.}}
{{note|Свойства ''поверхности'' модели определяются <code>[[$surfaceprop]]</code>.}}
{{note|Models for use with [[prop_physics]] will also need <code>[[$staticprop]]</code>.}}
{{note|Моделям, используемым как [[prop_physics|физика]], будет необходим <code>[[$staticprop]]</code>.}}


== Example ==
== Пример ==


  [[$keyvalues]]
  [[$keyvalues]]
Line 32: Line 32:
  }
  }


Here we derive prop_data from the generic base_type "Wooden.Small". Then we use additional keyvalues to give the model three special characteristics: it will be bulletproof, but when it breaks it will explode and cause up to 100 damage to entities within a 50 unit radius.
Здесь мы получаем prop_data из стандартного base_type "Wooden.Small". Затем берём дополнительные ключевые значения, чтобы дать модели три специальные характеристики: она будет пуленепробиваемой, но когда взорвётся, нанесет ущерб до 100 сущностям в радиусе 50 единиц.


==Tips==
==Советы==


;You don't need to override anything at all if you don't want to
;Вам не нужно что-либо переопределять
:Just set a <code>base</code> and you've got a working physics prop.
:Просто установите <code>base</code>, и она будет работать как физический объект.
;Don't override health levels in all your props
;Не переопределяет уровни здоровья у ваших пропов
:Instead, let the base types set the health. This way you won't have one chair that takes twice as much damage as every other chair.
:Вместо этого, пусть здоровье будет настроено по-умолчанию. Таким образом, один стул не получит вдвое больший урон, чем другой стул.
;Whenever possible, avoid mixing material types inside the same prop
;Всегда, когда это возможно, избегайте смешивания типов материалов внутри одного пропа
:Don't make half-metal, half-wood props.
:Не создавайте полуметаллические, полудеревянные пропы.
;Avoid collecting multiple objects into the same prop
;Избегайте скопления нескольких объектов в одном пропе
:Especially if you or Valve individually simulate identical-looking objects elsewhere.
:Особенно, если вы или Valve по отдельности смоделировали идентичные объекты в разных местах.
;Avoid moving parts and materials Source doesn't simulate
;Избегайте движущихся частей или материалов, которые Source не моделирует
:Don't put water in a physical fish tank.
:Не помещайте воду в физический аквариум.


=== Should my model be physical? ===
=== Должна ли моя модель быть физической? ===


In Half-Life 2, Valve tried to follow these general rules:
В Half-Life 2, Valve старается следовать этим общим правилам:


;If it's going to attach to or act as a support for a non-moving thing...
;Если модель прикреплена к не-физической вещи или поддерживает её...
:It should be static.
:То должна быть статикой.
;If it generates static light...
;Если генерирует статичный свет...
:It should be static.
:То должна быть статикой.
;If it's really big and the player couldn't possibly move it...
;Если она настолько велика, что игрок не может двигать её...
:It should be static.
:То должна быть статикой.
;Otherwise...
;В остальном...
:It should be physical.
:Она должна быть физикой.


Additionally, Valve consider metal and plastic invulnerable but everything else breakable.
Кроме того Valve рассматривает металл и пластик как неуязвимые, но всё же разбиваемые материалы.


== Options ==
== Свойства ==


=== Base type ===
=== Тип основы ===


; <code>base <[[string]]></code>
; <code>base <[[string]]></code>
: Gives the model a [[prop_data base types|predefined prop_data type]], providing in one motion all the data the engine needs to make the model both physical and breakable. Most other commands in a prop_data block are overrides of values inherited from here.
: Даёт модели [[prop_data base types|предопределенный тип prop_data]], обеспечивая одним движением все данные, необходимые движку, чтобы создать модель одновременно и физической и разбиваемой. Большинство других команд в блоке prop_data переопределяют значения, унаследованные отсюда.


===General===
===Общие===


; <code>health <[[int]]></code>
; <code>health <[[int]]></code>
: The amount of damage this prop should take before breaking. 0 means don't break.
: Количество повреждений, которые объект должен принять до момента разбивания. 0 означает, что не ломается.
; <code>allowstatic <[[bool]]></code>
; <code>allowstatic <[[bool]]></code>
: Allows the model to be used with [[prop_static]]. To enforce consistency, avoid if possible.
: Позволяет использовать модель как [[prop_static|статику]]. Для обеспечения согласованности, избегайте по возможности.
; <code>physicsmode <choices></code>
; <code>physicsmode <choices></code>
: Sets the physics mode used by [[prop_physics_multiplayer]]. Can be overridden by the entity in the Orange Box.
: Задает режим физики, используемый в [[prop_physics_multiplayer]]. Может быть переопределен сущностью в Orange Box.
{{physicsmode choices}}
{{physicsmode choices}}
; <code>blockLOS <bool></code>
; <code>blockLOS <bool></code>
: Overrides whether the prop should block NPC [[line of sight]]. If unspecified, the game engine will decide based on the model's dimensions.  
: Определяет, блокирует ли он [[line of sight|линию взгляда]] NPC. Если не указано, движок игры будет принимать решение на основе размеров модели.  
; <code>AIWalkable <bool></code>
; <code>AIWalkable <bool></code>
: Should NPCs try walking over this prop? {{todo|Does prop type matter?}}
: Должны ли боты ходить по этому объекту? {{todo:ru|Имеет ли значение тип объекта?}}


=== Damage modifiers ===
=== Модификаторы урона ===


''Use damage modifiers to reflect differences between the amount of damage that an object takes from different attacks. '''Don't''' use them to reflect overall damage strength. (e.g. Stone is resilient to everything. To reflect this, increase the health of all stone objects, don't set the damage modifiers lower.)''
''Use damage modifiers to reflect differences between the amount of damage that an object takes from different attacks. '''Don't''' use them to reflect overall damage strength. (e.g. Stone is resilient to everything. To reflect this, increase the health of all stone objects, don't set the damage modifiers lower.)''

Revision as of 10:40, 7 September 2015

Template:Otherlang2

prop_data могут быть использованы, чтобы создавать модели:

Их блок KeyValues встроен с помощью QC-команды $keyvalues.

Note.pngПримечание:Свойства поверхности модели определяются $surfaceprop.
Note.pngПримечание:Моделям, используемым как физика, будет необходим $staticprop.

Пример

$keyvalues
{
	prop_data
	{
		base			Wooden.Small 
		dmg.bullets		0 
		explosive_damage	100
		explosive_radius	50 
	}
}

Здесь мы получаем prop_data из стандартного base_type "Wooden.Small". Затем берём дополнительные ключевые значения, чтобы дать модели три специальные характеристики: она будет пуленепробиваемой, но когда взорвётся, нанесет ущерб до 100 сущностям в радиусе 50 единиц.

Советы

Вам не нужно что-либо переопределять
Просто установите base, и она будет работать как физический объект.
Не переопределяет уровни здоровья у ваших пропов
Вместо этого, пусть здоровье будет настроено по-умолчанию. Таким образом, один стул не получит вдвое больший урон, чем другой стул.
Всегда, когда это возможно, избегайте смешивания типов материалов внутри одного пропа
Не создавайте полуметаллические, полудеревянные пропы.
Избегайте скопления нескольких объектов в одном пропе
Особенно, если вы или Valve по отдельности смоделировали идентичные объекты в разных местах.
Избегайте движущихся частей или материалов, которые Source не моделирует
Не помещайте воду в физический аквариум.

Должна ли моя модель быть физической?

В Half-Life 2, Valve старается следовать этим общим правилам:

Если модель прикреплена к не-физической вещи или поддерживает её...
То должна быть статикой.
Если генерирует статичный свет...
То должна быть статикой.
Если она настолько велика, что игрок не может двигать её...
То должна быть статикой.
В остальном...
Она должна быть физикой.

Кроме того Valve рассматривает металл и пластик как неуязвимые, но всё же разбиваемые материалы.

Свойства

Тип основы

base <string>
Даёт модели предопределенный тип prop_data, обеспечивая одним движением все данные, необходимые движку, чтобы создать модель одновременно и физической и разбиваемой. Большинство других команд в блоке prop_data переопределяют значения, унаследованные отсюда.

Общие

health <int>
Количество повреждений, которые объект должен принять до момента разбивания. 0 означает, что не ломается.
allowstatic <bool>
Позволяет использовать модель как статику. Для обеспечения согласованности, избегайте по возможности.
physicsmode <choices>
Задает режим физики, используемый в prop_physics_multiplayer. Может быть переопределен сущностью в Orange Box.
Number Name Description
1 Solid, Server-side Solid, pushes the player away.
2 Non-Solid, Server-side Non-solid, but gets pushed away by the player.
3 Non-Solid, Client-side Non-solid, clientside simulated only.
blockLOS <bool>
Определяет, блокирует ли он линию взгляда NPC. Если не указано, движок игры будет принимать решение на основе размеров модели.
AIWalkable <bool>
Должны ли боты ходить по этому объекту? Template:Todo:ru

Модификаторы урона

Use damage modifiers to reflect differences between the amount of damage that an object takes from different attacks. Don't use them to reflect overall damage strength. (e.g. Stone is resilient to everything. To reflect this, increase the health of all stone objects, don't set the damage modifiers lower.)

dmg.bullets <float>
Modifies damage done by bullets.
  • Paper, Cloth and Glass = 0.5
  • Wood = 0.75
  • Flesh = 1.25.
dmg.club <float>
Modifies damage done by blunt impacts.
  • Cloth = 0.75
  • Paper and Pottery = 1.25
  • Wood = 2.0
dmg.explosive <float>
Modifies damage done by explosions.
  • Paper, Cloth, Pottery, Flesh and Wood = 1.5
damage_table <choices>
Impact Damage Tables are defined in C++ code (in physics_impact_damage.cpp), and contain very detailed information about what damage a prop should take from different directions and forces. Only Glass and Pottery base_types inherit one.
Tip.pngСовет:Use damage_table "" to ignore an inherited table.
glass
Extremely fragile, will break just by being dropped.
player
[Нужно сделать]
player_vehicle
[Нужно сделать]
npc
[Нужно сделать]

Flammable props

fire_interactions is a subkey of prop_data that defines flammability. There are only three known parameters, each with only one known value:

$keyvalues
{
   prop_data
   {
      fire_interactions
      {
         ignite      halfhealth 	// Will ignite spontaneously on reaching 50% health.
         explosive_resist   yes 	// Clamp blast damage so that the prop ignites instead of breaking.
         flammable          yes 	// Can be ignited by fire and explosions.
      }
    }
}
  • Note.pngПримечание:fire_interactions may not function while within the prop_data section. Move it just below the prop_data section if you encounter problems
  • Нужно сделать: confirm that fire_interactions are not used for flammable NPC models.
  • Нужно сделать: confirm whether unbreakable (health 0) models can be flammable.

Exploding props

If these two fields are specified for a prop, and it is given health so that it can be damaged, then it will explode when it breaks.

explosive_damage <float>
The amount of explosive damage.
explosive_radius <float>
The radius of the explosion. Damage falls off as distance from the origin increases.

Gibs

The prop_data system handles generic gibs. Generic gibs are used for any breakable object that doesn't have custom gibs.

breakable_model <choices>
Defines the set of generic gibs (as defined in scripts\propdata.txt) this prop should break into. Props with a wooden base type gib in this manner already. See also creating custom gibs.
  • WoodChunks
  • GlassChunks
  • ConcreteChunks
  • MetalChunks
breakable_count <int>
The number of generic breakable gibs to break into. If this is not specified, the engine will generate a sensible number based on the gibs' and model's sizes.
breakable_skin <int>
Allows you to specify a skin to use on the gib models, which is useful for matching the original prop's skin.
Only props with Wooden base_types inherit a gib skin (skin 0).
multiplayer_break <choices>
Подтвердить:Determines where the gibs from a prop_physics_multiplayer are simulated.
  • both
  • server
  • client (default)
  • Нужно сделать: Confirm whether breakable_count, breakable_skin and multiplayer_break do not affect custom gibs.
  • Нужно сделать: Confirm whether multiplayer_break is set for the breakable model rather than each individual gib itself.

Creating new base types

All base types are defined in scripts\propdata.txt. If you edit a base type in this file, you will affect the behaviour of all models using it (that do not have their own overrides).

The format of the file is:

PropData.txt
{
	<base type name>
	{
		<any number of the prop_data KVs listed above>
	}
}

Valve generally only use their base types to set health and damage modifiers.

Creating generic gibs

Generic gibsets are also defined in propdata.txt. Valve have only four, and only one (WoodChunks) is assigned to a base type - most models instead specify theirs directly, with breakable_model.

Defining a new gibset is easy as most of the work is done by the engine:

PropData.txt
{
	BreakableModels
	{
		WoodChunks
		{
			// Smallest to largest:
			models\Gibs\wood_gib01e.mdl	1
			models\Gibs\wood_gib01d.mdl	1
			models\Gibs\wood_gib01c.mdl	1
			models\Gibs\wood_gib01b.mdl	1
			models\Gibs\wood_gib01a.mdl	1
		}
	}
}

Prototyping models

When working on prototypes, or when you don't have modellers handy, it's useful to be able to work around the prop data system's enforcement. To do this, use the prop_physics_override and prop_dynamic_override entities instead of prop_physics and prop_dynamic. A prop_physics_override entity will not remove itself if it is assigned a model that wants to be static (i.e. has no "prop_data" entry in its $keyvalues .QC section). It will also allow the level designer to set its "health".

The override entities allow you to temporarily use models incorrectly while prototyping, or waiting for a modeller to finish up a new model that has the properties you desire. It is highly recommended that you use Hammer's Entity Report feature to check each of your maps to ensure you have no override entities left when you ship them. Otherwise you may be shipping physics inconsistencies, and players are extremely quick to notice them (the orange bucket won't move when I shoot it on this level, but it did on the previous one).

See also func_physbox for brush-based physics objects.

See also