# Инструкция include

Содержимое SDL-файла можно для удобства разбивать на тематические файлы. \
Также можно выносить общие фрагменты описания компонент и настроек в отдельные файлы.\
Для таких файлов используются расширения **.inc или .ext**

Содержимое таких файлов можно вызывать в нужном месте с помощью инструкции **include** с указанием имени файла в двойных кавычках. \
Если файл находится не в той же папке, что и собираемый SDL, то указывается путь к файлу от корневой папки пакета[^1].

> **Формат вызова инструкции include**
>
> ```
> (include "[path]\filename" [args])
> ```
>
> *\[path] - путь к файлу, опционально*
>
> *filename - имя файла*
>
> *\[args] - аргументы, опционально*

<details>

<summary>Пример вызова инструкции include в файле human.set</summary>

```
;SDL
(include "human_grenade_throw_type.inc")
(include "human_lie.inc")
(include "human_swim.inc")
(include "human_snipe.inc")
(include "human_squat.inc")
(include "human_bazooka.inc")
(include "human_inventory.inc")
(include "human_look.inc")
(include "human_stand.inc")
(include "human_idle.inc")
(include "human_idle_temp.inc")
(include "human_hands.inc")
(include "human_death.inc")
```

*Содержимое файла human.set собирается из нескольких SDL-файлов, которые располагаются в той же папке, что и файл human.set*

</details>

При вызове инструкции **include** можно передавать значения аргументов[^2]&#x20;

<details>

<summary>Пример вызова инструкции include с аргументами</summary>

```
(include "shadow/stone.inc" sx(1) sy(3))
```

</details>

Другие примеры использования инструкции **include** приведены в таблице.

<table><thead><tr><th width="237">Название файла</th><th>Описание</th></tr></thead><tbody><tr><td>human_death.inc</td><td>В целях удобства в указанный файл вынесено описание выбора анимаций смерти для юнита типа <strong>human.</strong> Содержимое файла human_death.inc включается с помощью инструкции include в файл human.set</td></tr><tr><td>vehicle.ext</td><td><p>В файл вынесены общие свойства для юнитов типа <strong>vehicle.</strong> Содержимое данного файла вызывают с помощью инструкции <strong>include</strong> в файлах с описанием свойств юнитов, являющихся подвидом vehicle: </p><ul><li>car;</li><li>moto;</li><li>airborne;</li><li>marine;</li><li>...</li></ul></td></tr><tr><td>presets_vehicles.inc</td><td>В файл вынесены настройки пресетов юнитов типа <strong>vehicle</strong>. Содержимое этого файла вызывается с помощью Инструкции <strong>include</strong> во всех файлах, содержащих описание режимов игры, в которых используются описанные в resets_vehicles.inc пресеты юнитов</td></tr></tbody></table>

{% hint style="info" %}
Если у вас возникли сложности с пониманием терминологии и сути описания инструкции, то ознакомьтесь с информацией из статьи [Общая информация о конфигурационных файлах](https://bestway-1.gitbook.io/dokumentaciya/nastroiki-igrovykh-parametrov/obshaya-informaciya-o-konfiguracionnykh-failakh)
{% endhint %}

**Дополнительно можно ознакомиться с другими видами Инструкций**

<table data-card-size="large" data-view="cards"><thead><tr><th data-card-target data-type="content-ref"></th><th data-hidden></th><th data-hidden></th><th data-hidden></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><a href="/pages/6gUIIaHfhttNoIIRNNZb">/pages/6gUIIaHfhttNoIIRNNZb</a></td><td>Текст</td><td></td><td></td><td><a href="/files/7PiLyqlIStMHdiy0XHd4">/files/7PiLyqlIStMHdiy0XHd4</a></td></tr><tr><td><a href="/pages/GEyp9m34dTRFb0LAhI51">/pages/GEyp9m34dTRFb0LAhI51</a></td><td>Текст</td><td></td><td></td><td><a href="/files/7PiLyqlIStMHdiy0XHd4">/files/7PiLyqlIStMHdiy0XHd4</a></td></tr></tbody></table>

[^1]: [Пакеты](/documentation/gem-rts-v1-ru/bazovaya-informaciya-o-gem-rts/arkhitektura-resursov-igry/pakety.md#obshie-svedeniya) - папки с ресурсами тематических компонент игры или модов. \
    Находятся в папке packages/

[^2]: [Аргументы](/documentation/gem-rts-v1-ru/bazovaya-informaciya-o-gem-rts/obshaya-informaciya-o-konfiguracionnykh-failakh.md#argumenty) используются для вызова одной и той же инструкции, но с разными значениями параметров. При описании инструкции признаком аргумента является символ процент **%.**

    \ <br>


---

# 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/bazovaya-informaciya-o-gem-rts/obshaya-informaciya-o-konfiguracionnykh-failakh/instrukciya-include.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.
