# Звуки и события в анимации

## Настройка enitity

Для запуска звуков через анимации нужно прописать в соответствующий **.def** или в **.ext** класса **extender "animation\_sound"**\
Без этого события будут приходить от анимации, но звук проигрываться не будет

**Пример:**

```
{extender "animation_sound"
	{event "swim"
		{play "human/move/swim"}
	}
	{event "step"
		{play "human/step/ground"
			{if terrain_fx "road" play "human/step/road"}
			{if terrain_fx "country_road" play "human/step/road"}
			{if terrain_fx "ice" play "human/step/snow"}
			{if terrain_fx "snow" play "human/step/snow"}
			{if terrain_fx "sand" play "human/step/sand"}
			{if terrain_fx "grass" play "human/step/grass"}
		}
	}
}
```

## Настройка анимаций

В файле human\_anm.ext в строках, содержащих имена анимаций, в которых должны проигрываться звуки, необходимо прописать строчки

{event <номер кадра> <имя события>}

{% hint style="info" %}
Номера кадров могут быть только целые.
{% endhint %}

**Пример:**

```
{sequence "run_fast_down" {speed 0.5} {smooth 0.1}{resume}
    {event 18 "step"}
    {event 38 "step"}
}
```

## События для human

* step - шаг по земле
* swim - гребок во время плавания
* dig - втыкание лопаты в землю
* dig\_end - сброс земли с лопаты
* heal - обмотка бинтом
* smoke - выдыхает дым при курении


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bestway-1.gitbook.io/documentation/gem-rts-v1-ru/animacii/zvuki-i-sobytiya-v-animacii.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
