Ru/Panels: Difference between revisions

From Valve Developer Community
< Ru
Jump to navigation Jump to search
(Создание заготовки для перевода)
Line 130: Line 130:
----
----


== Частота воспроизведения анимации ==
== Скорость воспроизведения анимации ==
Sometimes it might be required for an arm (or any other [[prop_dynamic]]) to play its animation faster or slower. The playback rate of a [[prop_dynamic]] entity is expressed in numbers as representation of percentage, where 1 is equivalent to 100%, 2 is 200%, 0.5 is 50%, 0 is 0% of the animation playback rate (note that 0 will stop the animation completely). There are two ways to change default playback rate.
Иной раз бывает необходимо воспроизвести анимацию робо-руки (или любой другой [[prop_dynamic]]) быстрее или медленнее. The playback rate of a [[prop_dynamic]] entity is expressed in numbers as representation of percentage, where 1 is equivalent to 100%, 2 is 200%, 0.5 is 50%, 0 is 0% of the animation playback rate (note that 0 will stop the animation completely). There are two ways to change default playback rate.


The first method is easier and applied to all of animation of a particular [[prop_dynamic]]. The playback rate can be assigned to the arm  and this will have a constant effect on the arm's animations playback rate (it will always be playing any animations at that set rate). In order to do so an new output need to be added in the arm's properties:
The first method is easier and applied to all of animation of a particular [[prop_dynamic]]. The playback rate can be assigned to the arm  and this will have a constant effect on the arm's animations playback rate (it will always be playing any animations at that set rate). In order to do so an new output need to be added in the arm's properties:

Revision as of 07:09, 7 January 2014

Template:Otherlang2

"Доски будущего!"
- Кейв Джонсон

Portal 2 Панели - архитектурный элемент Portal 2. Каждая панель расположена так, что вместе они образуют тестовую камеру. Поскольку панели находятся на роботизированных руках, камера может реагировать на действия игрока. Панели могут образовывать лестницы, выступы, открываться наподобие дверей, и, как правило, дают ощущение, что комната живая.

Создание панелей

1. Создайте prop_dynamic со следующими настройками:

Название свойства Параметр
World Model models/anim_wp/room_transform/arm64x64_interior.mdl
Name panel1
HoldAnimation true
Collision Not Solid

2. Создайте браш размером 256Lx256Wx32H. Преобразуйте его в энтити func_brush со следующими настройками:

Название свойства Параметр
Name panel1_brush
Parent panel1

3. Создайте энтити logic_auto и установите следующие выходы:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn panel1_brush SetParentAttachmentMaintainOffset panel_attach 0.00 Yes(?)

Теперь func_brush будет двигаться вместе с анимацией prop_dynamic.

4. Создайте logic_relay со следующими настройками:

Название Свойства Параметр
Name relay_panel1_animation

и следующими выходами:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger panel1 SetAnimation (ANIMATION NAME) 0.00 Yes(?)

Прикрепляемые к панелям материалы

Примечание: Модели idle или static модели не двигаются. Они служат только для красоты.


Модель Анимированная? Название прикрепления к панели
anim_wp\arm_interior_192\arm_interior_128.mdl Да GLASS - N/A
anim_wp\arm_interior_192\arm_interior_192.mdl Да GLASS - N/A
anim_wp\arm_interior_192\video_arm.mdl Да monitor_attach
anim_wp\arm_interior_192\video_arm_big.mdl Да monitor_attach
anim_wp\circle_shield\circle_shield.mdl Да panel_top
anim_wp\framework\circle_shield_static.mdl Нет N/A
anim_wp\room_transform\arm64x64_interior.mdl Да panel_attach
anim_wp\room_transform\arm64x64_interior_rusty.mdl Да panel_attach
anim_wp\telescope_arm\telescope_arm.mdl Да panel_top
anim_wp\telescope_arm_128\telescope_arm_128.mdl Да panel_top
anim_wp\telescope_arm_128\telescope_arm_128_glass.mdl Да GLASS - panel_top
anim_wp\telescope_arm_128\telescope_arm_128_idle.mdl Нет N/A
anim_wp\telescope_arm_128\telescope_arm_128_upidle.mdl Нет N/A
anim_wp\telescope_arm_128\telescope_arm_128x256.mdl Да GLASS - panel_top
anim_wp\telescope_arm_trans\telescope_arm_trans.mdl Да GLASS - panel_attach
props_livingwall\armliving64x64.mdl Да panel_attach

Скорость воспроизведения анимации

Иной раз бывает необходимо воспроизвести анимацию робо-руки (или любой другой prop_dynamic) быстрее или медленнее. The playback rate of a prop_dynamic entity is expressed in numbers as representation of percentage, where 1 is equivalent to 100%, 2 is 200%, 0.5 is 50%, 0 is 0% of the animation playback rate (note that 0 will stop the animation completely). There are two ways to change default playback rate.

The first method is easier and applied to all of animation of a particular prop_dynamic. The playback rate can be assigned to the arm and this will have a constant effect on the arm's animations playback rate (it will always be playing any animations at that set rate). In order to do so an new output need to be added in the arm's properties:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnAnimationBegun !self SetPlaybackRate 5 0.00 No

Above output will make an arm to play all of its animations 5 times faster. The !self is a special wildcard that selects the entity that is firing that output (arm selects itself).


The second way of setting up the playback rate is more complex but also more flexible. The triggering entity (trigger_once etc.) has to set the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch arm_0 SetAnimation pitflings_angled_01 0.00 No
Io11.png OnStartTouch arm_0 SetPlaybackRate 2 0.01 No

Above set-up, when triggered will cause arm_0 to start animation, one hundredth second later the animation playback will be increased to 200% (note that if both outputs were fired at the same time the playback rate will remain at default - 1).

"Просыпающиеся" панели

For some themes in Portal 2, panels can be seen doing powerup animations - starting limp and lifeless, then 'waking up' and moving back into their proper position. Done correctly, this can make your map feel far more dynamic and will look more realistic for the theme.

Creating these panels, however, is a little different from ordinary panels. This is how Valve does it:

1. Create a prop_dynamic entity with the following settings:

Название свойства Значение
World Model models/anim_wp/room_transform/arm64x64_interior.mdl
Name panel1
HoldAnimation true
Collision Not Solid
Default Animation powerup(X_0Y)idleend
Note.pngПримечание:There is a huge amount of powerup animations to choose from, starting from powerupA_01. Choose whatever fits best.

2. Create a brush above the model, making sure it fits, and is aligned to, the panel face. Tie it to a func_brush entity with the following settings:

Название свойства Значение
Name panel1_brush
Parent panel1

3. Создайте энтити logic_auto и добавьте следующие выходы:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn panel1_brush SetParentAttachmentMaintainOffset panel_attach 0.10 Yes(?)
Io11.png OnMapSpawn panel1 SetAnimation powerup(X_0Y)idle 0.50 Yes(?)

Template:Note:ru


4. Создайте logic_relay со следующими настройками:

Название свойства Значение
Name relay_panel1_animation

и следующими выходами:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger panel1 SetAnimation powerup(X_0Y) 0.00 Yes(?)

Now just add a trigger somewhere and activate the relay - a trigger_look works great for this.


The idle powerup animations are horribly off-grid in Hammer, and are therefore impossible to correctly parent the brush to. By using this method, we can align the brush to the panel face in Hammer on-grid, but when the map spawns, it will move into an idle powerup animation, with the brush perfectly parented.

См. также