Строка 116: |
Строка 116: |
| (Если вы используете '''xnbcli''' для [[Модификации:Редактирование XNB файлов#Распаковывание и упаковывание ресурсов|для распаковки оригинальных файлов карт]], вам понадобится <tt>.tbin</tt> плагин, даже если вы планируете использовать <tt>.tmx</tt> поскольку xnbcli все еще производит <tt>.tbin</tt> файлы.) | | (Если вы используете '''xnbcli''' для [[Модификации:Редактирование XNB файлов#Распаковывание и упаковывание ресурсов|для распаковки оригинальных файлов карт]], вам понадобится <tt>.tbin</tt> плагин, даже если вы планируете использовать <tt>.tmx</tt> поскольку xnbcli все еще производит <tt>.tbin</tt> файлы.) |
| | | |
− | ==Map edits== | + | ==Редактирование карты== |
− | ===Editing maps=== | + | ===Редактирование карт=== |
− | Important note: when making custom maps, always start with a vanilla map and edit it. Don't try to create a new map in Tiled; the game needs certain tiles, map properties, etc to be present.
| + | Важное примечание: при создании пользовательских карт всегда начинайте с ванильной карты и редактируйте ее. Не пытайтесь создать новую карту в Tiled; в игре должны присутствовать определенные плитки, свойства карты и т.д. |
| | | |
− | If you're using Tiled:
| + | Если вы используете Tiled: |
− | # [[Modding:Editing XNB files|Unpack]] the game's <tt>Content/Maps</tt> folder and create a copy to edit your maps in. Use this copy of the folder to edit any maps in before moving them to your mod release folder. | + | # [[Модификации:Редактирование XNB файлов|Распакуйте]] папку <tt>Content/Maps</tt> и создайте копию для редактирования ваших карт. Используйте эту копию папки для редактирования любых карт, прежде чем перемещать их в папку мода. |
− | # Use the same method to unpack the map you want to edit if it is not a vanilla one, then place the map in your editing folder. | + | # Используйте тот же метод, чтобы распаковать карту, которую вы хотите отредактировать, если она не является ванильной, а затем поместите карту в папку редактирования. |
− | # Open the <tt>.tbin</tt> or <tt>.tmx</tt> file via Tiled. Note: make sure the file is in the same folder as the unpacked tilesheets! | + | # Откройте <tt>.tbin</tt> или <tt>.tmx</tt> файл в Tiled. Примечание: убедитесь, что файл находится в той же папке, что и распакованные таблицы тайлов! |
− | # Make your changes. | + | # Внесите свои изменения. |
− | # Save the file. Don't use <tt>Save as</tt>, as it can corrupt the map. | + | # Сохраните файл. Не используйте <tt>Save as</tt>, так как это может повредить карту. |
− | # Move the <tt>.tbin</tt> or <tt>.tmx</tt> file, and any custom tilesheets it needs, to your mod release folder. Place them in the <tt>assets</tt> folder. | + | # Переместите <tt>.tbin</tt> или <tt>.tmx</tt> файл, и любые пользовательские таблицы тайлов, которые ему нужны, в папку вашего мода. Поместите их в папку <tt>assets</tt>. |
− | # Load your map via SMAPI or Content Patcher (or another framework mod). | + | # Загрузите свою карту через SMAPI или Content Patcher (или другой фреймворк модов). |
| | | |
− | ===Custom map=== | + | ===Пользовательская карта=== |
− | You can add a new map and location to the game.
| + | Вы можете добавить в игру новую карту и местоположение. |
| | | |
− | If you're using SMAPI:
| + | Если вы используете SMAPI: |
| :<syntaxhighlight lang="C#"> | | :<syntaxhighlight lang="C#"> |
| public override void Entry(IModHelper helper) | | public override void Entry(IModHelper helper) |
| { | | { |
− | // the game clears locations when loading the save, so do it after the save loads | + | // игра очищает локации при загрузке сохранения, поэтому сделайте это после загрузки сохранения |
| helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded; | | helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded; |
| } | | } |
Строка 142: |
Строка 142: |
| private void OnSaveLoaded(object sender, SaveLoadedEventArgs args) | | private void OnSaveLoaded(object sender, SaveLoadedEventArgs args) |
| { | | { |
− | // get the internal asset key for the map file | + | // получиь внутренний ключ ресурса для файла карты |
| string mapAssetKey = this.Helper.Content.GetActualAssetKey("assets/map.tmx", ContentSource.ModFolder); | | string mapAssetKey = this.Helper.Content.GetActualAssetKey("assets/map.tmx", ContentSource.ModFolder); |
| | | |
− | // add the location | + | // добавить местоположение |
| GameLocation location = new GameLocation(mapAssetKey, "YourLocationName") { IsOutdoors = false, IsFarm = false }; | | GameLocation location = new GameLocation(mapAssetKey, "YourLocationName") { IsOutdoors = false, IsFarm = false }; |
| Game1.locations.Add(location); | | Game1.locations.Add(location); |
Строка 151: |
Строка 151: |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | : '''Note:''' | + | : '''Примечание:''' |
− | :# Your map has to be built in a certain pattern; look at the maps in the <tt>Content/Maps</tt> directory for an example on how a map has to be built. | + | :# Ваша карта должна быть построена по определенному шаблону; посмотрите на карты в папке <tt>Content/Maps</tt> для примера. |
− | :# After loading your save file, you can use this command to jump to the map: <tt>debug warp YourLocationName X Y</tt> | + | :# После загрузки файла сохранения вы можете использовать эту команду для перехода к карте: <tt>debug warp YourLocationName X Y</tt> |
| | | |
− | If you're using Tiled:
| + | Если вы используете Tiled: |
− | : You can create the map in Tiled, but you need SMAPI to add it to the game. | + | : Вы можете создать карту в Tiled, но вам нужен SMAPI, чтобы добавить ее в игру. |
| | | |
− | ===Custom tilesheet=== | + | ===Настраиваемый лист тайлов=== |
− | You can add custom sprites, tiles, or images to a map. Be sure to [[#Tilesheet order|prefix custom tilesheet IDs with <code>z_</code>]] to avoid shifting the vanilla tilesheet indexes.
| + | Вы можете добавлять на карту пользовательские спрайты, тайлы или изображения. Обязательно [[#Tilesheet order|prefix custom tilesheet IDs with <code>z_</code>]] чтобы избежать смещения индексов ванильных таблиц. |
| | | |
| If you're using SMAPI: | | If you're using SMAPI: |