Mindustry гайд по модам

Обновлено: 05.07.2024

1. (только PC-версия) Скопируйте и вставьте папку/файл мода в папку mods Mindustry В Steam это находится в установочном каталоге Mindustry:

Если у вас нет Steam-версии, то путь должен быть следующим:

2. Заархивируйте папку с модификацией (не в отдельную папку, а лишь содержимое)(можете пропустить этот пункт, если мод уже находится в архиве).
2.1. Импортируйте через встроенный файловый менеджер игры: Главное меню→Модификации→Импортировать модификацию. Это не рекомендуется для мододелов, т.к. вам нужно постоянно архивировать в мод.
3.Узнайте адрес к модификации на github и скопируйте имя пользователя+название репозитория.
3.1.Импортируйте через игру:
Главное меню→Модификации→Импортировать GitHub модификацию.

Создание модификации

  1. Создаём папку с любым названием. Желательно латиницей. Пусть название модификации будет Modik .
  2. Создаём папки и файлы так же, как и в древе снизу. Если лень создавать, то можете скачать отсюда.
  • В большинстве случаев используется английский для создания модификаций. Если вы не знаете какой-то блок, то можно нажать сюда
  • Прочитайте руководство по синтаксису JSON.
  • Лучше используйте английский.
  • Всему нужно тип. Всегда.
  • Все блоки, предметы, мехи и т.д. имеют два одинаковых типа. Это name(имя) и description(описание).
  • Регистр важен!

Блоки

Специальная категория:
blocks Было перемещено сюда для уменьшения высоты страницы.

Предметы

Специальная категория:
item

Жидкости

Специальная категория:
Директория:

Единицы (юниты)

Переменные Значения Описание Примечание
type flyingUnit, groundUnit Тип юнита -
name Произвольная строка Название юнита -
description Произвольная строка Описание юнита -
maxVelocity От 0 до ∞ Оганичение скорости для юнита -
speed От 0 до ∞ Скорость передвижения юнита -
flying true \ false Сможет ли не летающий юнит летать -
health От 0 до ∞ Здоровье юнита 1 = 1
drag От 0 до ∞ Величина отклонения юнита -
engineOffset От 0 до ∞ Направление отклонения юнита -
weaponOffsetY От 0 до ∞ место появления снарядов при выстреле -
engineSize От 0 до ∞ - -
rotatespeed От 0 до ∞ Скорость поворота юнита -
baseRotateSpeed От 0 до ∞ Скорость поворота ног юнита (есле наземный) -
range или attackLength От 0 до ∞ Дальность обнаружения юнитом врагов -
hitsize От 0 до ∞ - -
hitsizeTile От 0 до ∞ - -
shootCone От 0 до ∞ Разброс оружия юнита -
mass От 0 до ∞ Влияет на силу отталкивания юнита или от юнита 1 = 1
targetAir true \ false Сможет ли юнит стрелять по воздушным целям -
rotateWeapon true \ false Будет ли у юнита поварачиватся оружие -
retreatPercent От 0 до ∞ - -
itemCapacity От 0 до ∞ Размер внутреннего хранилища юнита -
toMine "1-ore, 2-ore" Фильтр предметов для добычи Есле 1 руда то указывается сразу за переменной, От 2 до ∞ в массиве
buildPower От 0 до ∞ Скорость постройки блоков юнитом -
Weapon weapon Оружие юнита -
immunities - Имунитеты -
deathSound "1.ogg" Звук смерти -

пример кода со всеми переменными(не советую так делать)

Патроны

Используется в Туррелях

Свойство Описание Примечания
type Добавляет пули определенные свойства - speed Скорость снаряда Вещественное число
damage Урон Вещественное число
bulletWidth Ширина снаряда Вещественное число
bulletHeight Длина снаряда Вещественное число
shootEffect Эффект выстрела Название эффекта
smokeEffect Эффект после выстрела Название эффекта
ammoMultiplier Кол-во снарядов Вещественное число
splashDamageRadius Радиус Взрыва Вещественное число
splashDamage Урон От взрыва Вещественное число
bulletSprite Текстура Пули ModName-SpriteName

Турели

Специальная категория: turret .

Свойство Описание Примечание
name Имя турели.
description Описание турели.
targetAir Турель стреляет по воздушным юнитам. True или False.
targetGround Турель стреляет по наземным юнитам. True или False.
size Размер турели. В блоках.
outlineIcon обводка true или false (по умолчанию true)
inaccuracy Разброс.
reload Перезарядка.
shootCone Используется для взрывателя,конусность выстрела.
rotateSpeed Скорость поворота турели.
shoots Выстрелов за раз.
range Дальность полёта пули.

Вот пример энергетической турели:

Оружие

Используется в юнитах и мехах. Указывается как переменная weapon . Возможные свойства:

Свойства Значения Описание примечание
name произвольная строка Название оружия
length От 0 до ∞ -
width От 0 до ∞ -
reload От 0 до ∞ Скорость перезарядки
range От 0 до ∞ Дальность выстрела
alternate True \ False Присутствие или отсутствие альтернативного огня
bullet См. Пули Пуля, которой стреляет оружие может иметь дополнительные параметры
shots От 1 до ∞ Определяет сколько будет выпущено пулей за выстрел может быть указан второй раз после след. параметра
shotDelay От 0 до ∞ Время перерыва между выстрелами
shotCone От 0 до ∞ Разброс
recoil От 0 до ∞ Отдача от выстрела
ejectEffect См. Эффекты Эффект от выстрела
spacing От 0 до ∞ -
inaccuracy От 0 до ∞ Неаккуратность выстрела
velocityRnd От 0 до ∞ -
shootSound "1.ogg" Звук выстрела
ignoreRotation True \ False -
shake От 0 до ∞ -

используется в оружии для юнитов\мехов

Виды пуль (что то может не работать)

Эффекты

Эффект Описание
none отсутствует
placeblock Эффект блока
breakblock Эффект уничтожения блока
smoke Эффект дыма
spawn Эффект спавна
tapblock эффект нажатия на блок
vtolhover Эффект вертикального взлёта
unitdrop Эффект падения юнита
unitpickup Эффект взлёта юнита
unitland Эффект посадки юнита
pickup Эффект поднятия
healwave Эффект регенириющий волны
heal Эффект регенерации
landshock -
reactorsmoke Эффект дыма реактора
nuclearsmoke Эффект ядерного дыма
redgeneratespark Эффект красной сгенериваной искры
fuelburn Эффект горения топлива
plasticburn Эффект горения пластика
pulverize Эффект измельчения
pulverizeRed Разновидность эффекта измельчения
pulverizeRedder Разновидность эффекта измельчения
pulverizeSmall Разновидность эффекта измельчения
pulverizeMedium Разновидность эффекта измельчения
purify Эффект очищения
purifyoil Эффект очищения нефти
purifystone Эффект очищения камня
generate -
mine Эффект бурения
mineBig Эффект бурения среднего бура
mineHuge Эффект бурения большого бура
smelt Эффект плавки
teleportActivate Эффект активного телепорта
teleport Эффект телепортации
teleportOut Эффект телепортирования
ripple Эффект ряби, пульсации
bubble Эффект пузыря
launch Эффект запуска
healBlock Эффект лечебного блока
healBlockFull -
healWaveMend Эффект лечебной волны c починкой (?)
overdriveWave Эффект ускоряющей волны
overdriveBlockFull -
shieldBreak Эффект уничтожения щита
hitBulletSmall Эффект попадания маленький
hitFuse Эффект загорания выстрелом
hitBulletBig Эффект попадение большой пулей
hitFlameSmall Эффект попадения маленьким огнём
hitLiquid Эффект выстрела жидкостью
hitLaser Эффект выстрела лазером
hitLancer Эффект выстрела лансером
hitMeltdown Эффект выстрела испепелителем
despawn -
flakExplosion Эффект взрыва зенитного огня
blastExplosion -
plasticExplosion Эффект взрыва пластика
artilleryTrail Эффект артилерийского хвоста (?)
incendTrail Эффект хвоста зажигательного снаряда
missileTrail Хвост ракеты
absorb Эффект впитывания
flakExplosionBig Взрыв большого зенитного огня
plasticExplosionFlak -
burning Эффект горения
fire Эффект огня
fireSmoke Эффект дыма от огня
steam Эффект тумана или пара
fireballsmoke Эффект дыма огненого шара
ballfire Эффект шара огня
freezing Эффект заморозки
melting Эффект плавления
wet Эффект намокания
oily Эффект нефти
overdriven -
dropItem Эффект выбрасывания предмета
shockwave Эффект ударной волны
bigShockwave Эффект большой ударной волны
nuclearShockwave Эффект взрывной волны от ядерного взрыва
explosion Эффект взрыва
blockExplosion Эффект взрыва блока
blockExplosionSmoke Эффект дыма после взрыва блока
shootSmall Эффект маленького выстрела
shootHeal Эффект регенерирующего взрыва
shootSmallSmoke -
shootBig -
shootBig2 -
shootBigSmoke -
shootBigSmoke2 -
shootSmallFlame -
shootPyraFlame -
shootLiquid -
shellEjectSmall -
shellEjectMedium -
shellEjectBig -
lancerLaserShoot -
lancerLaserShootSmoke -
lancerLaserCharge -
lancerLaserChargeBegin -
lightningCharge -
lightningShoot Эффект выстрела молнией
unitSpawn Эффект спавна юнита
spawnShockwave -
magmasmoke -
impactShockwave -
impactcloud -
impactcloud -
impactsmoke -
dynamicExplosion -
padlaunch -
commandSend -
coreLand Эффект падения ядра

Статус эффекты

Статус эффекты накладываются на некоторый объект на определенное время

Свойство Описание Примечание
none Нет эффекта. -
burning Эффект горения. Наносит урон в течение времени
freezing Эффект заморозки. Замедляет объект и уменьшает его броню
wet Эффект промокания. Делает объект уязвимым к электрическому урону
melting Эффект плавления. Наносит урон в течение времени и замедляет объект
tarred Эффект дегтя. Замедляет объект и делает его уязвимым к огненному урону
overdrived Эффект ускорения. Увеличивает скорость объекта и наносимый им урон
shielded Эффект защиты. Увеличивает броню объекта в 3 раза
boss Эффект босса. Увеличивает броню объекта и его урон в 3 раза
shocked Эффект шока. -
corroded Эффект коррозии. Наносит небольшой урон

Спрайты

При добавлении название согласовывается с .json файлом.

Игра поддерживает только спрайты с разрешением .jpg .

Таблица размеров спрайта относительно размера блока.

Спрайт Блок
32 х 32 1 х 1
64 х 64 2 х 2
96 х 96 3 х 3
128 х 128 4 х 4

При рисовке юнитов и мехов допускается свободный размер изображения, который будет определять его размер

Расположение спрайтов в моде

Мультиязычность

Наверное, самое простое для добавления.

  1. Узнаём специальную категорию созданной вами вещью. Специальная категорию можно узнать в разделе Код. Ниже приведено обрезанное древо.
  1. Создаём в папке Modik/bundles файл(если вы не создали ранее).
  • Если хотите добавить строки для английского, то выберите файл bundle.properties
  • Если хотите добавить строки для русского, то выберите файл bundle_ru.properties
  1. Добавляем строку:

СпециальнаяКатегория.НазваниеВещи.name(имя)/description(описание)= <Вставить текст>
Пример. Например, я хочу добавить для жидкости lava название и описание другое на русском.

Mindustry mods are simply directories of assets. There are many ways to use the modding API, depending on exactly what you want to do, and how far you're willing to go to do it.

You could just resprite existing game content, you can create new game content with the simpler Json API (which is the main focus of this documentation), you can add custom sounds (or reuse existing ones). It's possible to add maps to campaign mode, and add scripts to program special behavior into your mod, like custom effects.

Sharing your mod is as simple as giving someone your project directory; mods are also cross platfrom to any platform that supports them. You'll want to use GitHub (or a similar service) for hosting your source code. To make mods all you really need is any computer with a text editor.

Directory Structure

Your project directory should look something like this:

  • mod.hjson (required) metadata file for your mod,
  • content/* directories for game Content,
  • maps/ directory for in-game maps,
  • bundles/ directory for Bundles,
  • sounds/ directory for Sound files,
  • schematics/ directory for Schematic files,
  • scripts/ directory for Scripts,
  • sprites-override/ Sprites directory for overriding ingame content,
  • sprites/ Sprites directory for your content,

Every platform has a different user application data directory, and this is where your mods should be placed:

Note that your filenames should be lowercased and hyphen separated:

  • correct: my-custom-block.json
  • incorrect: My Custom Block.json

Hjson

mod.hjson

At the root of your project directory, you must have a mod.json which defines the basic metadata for your project. This file can also be (optionally) named mod.hjson to potentially help your text editor pick better syntax highlighting.

  • name will be used to reference to your mod, so name it carefully;
  • displayName this will be used as a display name for the UI, which you can use to add formatting to said name;
  • description of the mod will be rendered in the ingame mod manager, so keep it short and to the point;
  • dependencies is optional, if you want to know more about that, go to the dependencies section;
  • minGameVersion is the minimum build version of the game. This is required to be a number greater than 105.
  • hidden is whether or not this mod is essential for multiplayer, false by default. Texture packs, JS plugins, etc. should use this as to not cause conflicts with servers and clients respectively. As a rule of thumb, if your mod creates content it shouldn't be hidden.

Content

At the root of your project directory you can have a content/ directory, this is where all the Json/Hjson data goes. Inside of content/ you have subdirectories for the various kinds of content, these are the current common ones:

  • content/items/ for items, like copper and surge-alloy ;
  • content/blocks/ for blocks, like turrets and floors;
  • content/liquids/ for liquids, like water and slag ;
  • content/units/ for flying or ground units, like eclipse and dagger ;

Note that each one of these subdirectories needs a specific content type. The filenames of these files is important, because the stem name of your path (filename without the extension) is used to reference it.

Furthermore the files within these content/<content-type>/* directories may be arbitrarly nested into other sub-directories of any name, to help you organize them further, for example:

  • content/items/metals/iron.hjson , which would respectively create an item named iron .

The content of these files will tend to look something like this:

field type notes
type String Content type of this object.
name String Displayed name of content.
description String Displayed description of content.

Other fields included will be the fields of the type itself.

Types

Types have numerous fields, but the important one is type ; this is a special field used by the content parser, that changes which type your object is. A Router type can't be a Turret type, as they're just completely different.

Types extend each other, so if MissileBulletType extends BasicBulletType , you'll have access to all the fields of BasicBulletType inside of MissileBulletType like damage , lifetime and speed . Fields are case sensitive: hitSize =/= hitsize .

What you can expect a field to do is up to the specific type, some types do absolutely nothing with their fields, and work mostly as a base types will extend from. One such type is Block .

In this unit example, the type of the unit is flying . The type of the bullet is BulletType , so you can use MissileBulletType , because MissileBulletType extends BulletType .

One could also use mech , legs , naval or payload as the unit type here.

As of build 125.1 , types can also be the fully-qualified class name of a Java class.

For example, to specify a block as a MendProjector , you may write type: mindustry.world.blocks.defense.MendProjector instead of type: MendProjector .

While not particularly useful for vanilla types, this can be used to load block types from other Java mods as dependencies.

Tech Tree

Much like type there exist another magical field known as research which can go at the root of any block object to put it in the techtree.

This would put your block after duo in the techtree, and to put it after your own mods block you would write your <block-name> , a mod name prefix is only required if you're using the content from another mod.

type cost notes
blocks requirements ^ 1.1 * 20 * researchCostMultiplier researchCostMultiplier is a stat that can be set on blocks
units requirements ^ 1.1 * 50 ---

The cost is then rounded down to the nearest 10, 100, 1k, 10k, or 100k depending on how expensive the cost is.

requirements is the cost of the block or unit. Units use their build cost/upgrade cost for the calculations.

If you want to set custom research requirements use this object in place of just a name:

This can be used to override block or unit costs, or make resources need to be researched instead of just having to produce it.

Sprites

All you need to make sprites, is an image editor that supports transparency (aka: not paint). Block sprites should be 32 * size , so a 2x2 block would require a 64x64 image. Images must be PNG files with a 32-bit RGBA pixel format. Any other pixel format, such as 16-bit RGBA, may cause Mindustry to crash with a "Pixmap decode error". You can use the command-line tool file to print information about your sprites:

If any of them are not 32-bit RGBA formatted, fix them.

Sprites can simply be dropped in the sprites/ subdirectory. The content parser will look through it recursively. Images are packed into an "atlas" for efficient for rendering. The first directory in sprites/ , e.g. sprites/blocks , determines the page in this atlas that sprites are put in. Putting a block's sprite in the units page is likely to cause lots of lag; thus, you should try to organize things similarly to how the vanilla game does.

Content is going to look for sprites relative to it's own name. content/blocks/my-hail.json has the name my-hail and similarly sprites/my-hail.jpg has the name my-hail , so it'll be used by this content.

Content may look for multiple sprites. my-hail could be a turret, and it could look for the suffix <name>-heat and what this means is it'll look for my-hail-heat .

Another thing to know about sprites is that some of them are modified by the game. Turrets specifically have a black border added to them, so you must account for that while making your sprites, leaving transparent space around turrets for example: Ripple

To override ingame content sprites, you can simply put them in sprites-override/ . This removes the <modname>- prefix to their id, which allows them to override sprites from vanilla and even other mods. You can also use this to create sprites with nice short names like cat for easy use with scripts, just beware of name collisions with other mods.

Sound

Custom sounds can be added through the modding system by dropping them in the sounds/ subdirectory. It doesn't matter where you put them after that. Two formats are supported: ogg and mp3 . Note that mp3 files cannot loop seamlessly, so try to use ogg whenever possible.

Just like any other assets, you reference them by the stem of your filenames, so pewpew.ogg and pewpew.mp3 can be referenced with pewpew from a field of type Sound .

Here's a list of built-in sounds:

artillery back bang beam bigshot boom breaks build buttonClick click combustion conveyor corexplode cutter door drill explosion explosionbig fire flame flame2 grinding hum laser laserbig laserblast lasercharge lasercharge2 lasershoot machine message mineDeploy minebeam missile mud noammo pew place plantBreak plasmaboom plasmadrop press pulse railgun rain release respawn respawning rockBreak sap shield shoot shootBig shootSnap shotgun smelter spark splash spray steam swish techloop thruster tractorbeam unlock wave wind wind2 wind3 windhowl windowHide none

Dependencies

You can add dependencies to your mod by simple adding other mods name in your mod.json :

The name of dependencies are lower-cased and spaces are replaced with - hyphens, for example Other MOD NamE becomes other-mod-name .

To reference the other mods assets, you must prefix the asset with the other mods name:

  • other-mod-name-not-copper would reference not-copper in other-mod-name
  • other-mod-name-angry-dagger would reference angry-dagger in other-mod-name
  • not-a-mod-angry-dagger would reference angry-dagger in not-a-mod

Bundles

An optional addition to your mod is called bundles. The main use of bundles are give translations of your content, but there's no reason you couldn't use them in English. These are plaintext files which go in the bundles/ subdirectory, and they should be named something like bundle_ru.properties (for Russian).

The contents of this file is very simple:

If you've read the first few sections of this guide, you'll spot it right away:

  • <content type>.<mod name>-<content name>.name
  • <content type>.<mod name>-<content name>.description

With your own custom bundle lines for use in scripts you can use whatever key you like:

  • message.egg = Eat your eggs
  • randomline = Random Line
  • mod/content names are lowercased and hyphen separated.

List of content types:

item block bullet liquid status unit weather sector error planet

List of bundle suffixes relative to languages:

en da fi vi fr lt sr tr it zh_TW nl_BE de uk_UA es fil pt_PT ru ro bg sv th ko zh_CN pl eu be nl pt_BR tk et in_ID cs ja hu

GitHub

Once you have a mod of some kind, you'll want to actually share it, and you may even want to work with other people on it, and to do that you can use GitHub. If you don't know what Git (or GitHub) is at all, then you should look into GitHub Desktop, otherwise simply use your favorite command line tool or text editor plugin.

All you need understand is how to open repositories on GitHub, stage and commit changes in your local repository, and push changes to the GitHub repository. Once your project is on GitHub, there are three ways to share it:

Mindustry mods are simply directories of assests. There are many ways to use the modding API, depending on exactly what you want to do, and how far you're willing to go to do it.

You could just resprite existing game content, you can create new game content with the simpler Json API (which is the main focus of this documentation), you can add custom sounds (or reuse existing ones). It's possible to add maps to campaign mode, and add scripts to program special behavior into your mod, like custom effects.

To make mods all you really need is any computer with a text editor.

1.1 Directory Structure

Your project directory should look something like this:

    (required) metadata file for your mod,
  • content/* directories for game Content,
  • maps/ directory for Zone maps,
  • bundles/ directory for Bundles,
  • sounds/ directory for Sound files,
  • schematics/ directory for Schematic files,
  • scripts/ directory for Scripts,
  • sprites-override/ Sprites directory for overriding ingame content,
  • sprites/ Sprites directory for your content,

Every platform has a different user application data directory, and this is where your mods should be placed:

Note that your filenames should be lowercased and hyphen separated:

  • correct: my-custom-block.json
  • incorrect: My Custom Block.json

1.2 Hjson

1.3 mod.json

At the root of your project directory, you must have a mod.json which defines the basic metadata for your project. This file can also be (optionally) named mod.hjson to potentially help your text editor pick better syntax highlighting.

  • name will be used to reference to your mod, so name it carefully;
  • displayName this will be used as a display name for the UI, which you can use to add formatting to said name;
  • description of the mod will be rendered in the ingame mod manager, so keep it short and to the point;
  • dependencies is optional, if you want to know more about that, go to the dependencies section;
  • minGameVersion is the minimum build version of the game.

1.4 Content

At the root of your project directory you can have a content/ directory, and this is where all the Json/Hjson data goes. Inside of content/ you have subdirectories for the various kinds of content, these are the current common ones:

  • content/items/ for items, like copper and surge-alloy ;
  • content/blocks/ for blocks, like turrets and floors;
  • content/mechs/ for mechs, like tau and glaive ;
  • content/liquids/ for liquids, like water and slag ;
  • content/units/ for flying or ground units, like reaper and dagger ;
  • content/zones/ for zones, configuration of campaign maps.

Note that each one of these subdirectories needs a specific content type. The filenames of these files is important, because the stem name of your path (filename without the extension) is used to reference it.

Furthermore the files within theseb content/<content-type>/* directories may be arbitrarly nested into other sub-directories of any name, to help you organize them further, for example:

  • content/items/metals/iron.hjson , which would respectively create an item named iron .

The content of these files will tend to look something like this:

field type notes
type String Content type of this object.
name String Displayed name of content.
description String Displayed description of content.

Other fields included will be the fields of the type itself.

1.5 Types

Types have numerous fields, but the important one is type ; this is a special field used by the content parser, that changes which type your object is. A Router type can't be a Turret type, as they're just completely different.

Types extend each other, so if MissileBulletType extends BasicBulletType , you'll have access to all the fields of BasicBulletType inside of MissileBulletType like damage , lifetime and speed . Fields are case sensitive: hitSize =/= hitsize .

What you can expect a field to do is up to the specific type, some types do absolutely nothing with their fields, and work mostly as a base types will extend from. One such type is Block .

type can be refer to the actual type field of the object. A type may also refer to other things like float is a type so it means you can type 0.3 in a field.

Here you can see, the type of the top level object is Revenant , but the type of the bullet is BulletType so you can use MissileBulletType , because MissileBulletType extends BulletType .

1.6 Tech Tree

Much like type there exist another magical field known as research which can go at the root of any block object to put it in the techtree.

This would put your block after duo in the techtree, and to put it after your own mods block you would write your <block-name> , a mod name prefix is only required if you're using the content from another mod.

Research cost will be 40 + round(requirements ^ 1.25) * 6 rounded down to the nearest 10 , where requirements is the build cost of your block. (in otherwords you can't set requirements and research cost individually)

1.7 Sprites

All you need to make sprites, is an image editor that supports transparency (aka: not paint). Block sprites should be 32 * size , so a 2x2 block would require a 64x64 image. Images must be .jpg files with 32 bit depth.

Sprites can simply be dropped in the sprites/ subdirectory. The content parser will look through it recursively, so you can organize them how ever you feel.

Content is going to look for sprites relative to it's own name. content/blocks/my-hail.json has the name my-hail and similarly sprites/my-hail.jpg has the name my-hail , so it'll be used by this content.

Content may look for multiple sprites. my-hail could be a turret, and it could look for the suffix <name>-heat and what this means is it'll look for my-hail-heat .

Another thing to know about sprites is that some of them are modified by the game. Turrets specifically have a black border added to them, so you must account for that while making your sprites, leaving transparent space around turrets for example: Ripple

To override ingame content sprites, you can simply put them in sprites-override/ .

1.8 Sound

Custom sounds can be added through the modding system by dropping them in the sounds/ subdirectory. It doesn't matter where you put them. Two formats are needed:

  • .ogg required for Desktop/Android
  • .mp3 required for iOS

Just like any other assets, you reference them by the stem of your filenames, so pewpew.ogg and pewpew.mp3 can be referenced with pewpew from a field of type Sound .

Here's a list of built-in sounds:

  • artillery
  • back
  • bang
  • beam
  • bigshot
  • boom
  • break
  • build
  • buttonClick
  • click
  • conveyor
  • corexplode
  • door
  • drill
  • empty
  • explosionbig
  • explosion
  • fire
  • flame2
  • flame
  • laserbig
  • laser
  • machine
  • message
  • missile
  • pew
  • place
  • press
  • release
  • respawning
  • respawn
  • shootBig
  • shoot
  • shootSnap
  • shotgun
  • spark
  • splash
  • spray
  • thruster
  • unlock
  • wave
  • windowHide

1.9 Dependencies

You can add dependencies to your mod by simple adding other mods name in your mod.json :

The name of dependencies are lower-cased and spaces are replaced with - hyphens, for example Other MOD NamE becomes other-mod-name .

To reference the other mods assets, you must prefix the asset with the other mods name:

  • other-mod-name-not-copper would reference not-copper in other-mod-name
  • other-mod-name-angry-dagger would reference angry-dagger in other-mod-name
  • not-a-mod-angry-dagger would reference angry-dagger in not-a-mod

1.10 Bundles

An optional addition to your mod is called bundles. The main use of bundles are give translations of your content, but there's no reason you couldn't use them in English. These are plaintext files which go in the bundles/ subdirectory, and they should be named something like bundle_ru.properties (for Russian).

The contents of this file is very simple:

If you've read the first few sections of this guide, you'll spot it right away:

  • <content type>.<mod name>-<content name>.name
  • <content type>.<mod name>-<content name>.description
  • mod/content names are lowercased and hyphen separated.

List of content type:

List of filenames relative to languages:

  • English bundle.properties
  • Czech bundle_cs.properties
  • German bundle_de.properties
  • Spanish bundle_es.properties
  • Estonian bundle_et.properties
  • Basque bundle_eu.properties
  • French BE bundle_fr_BE.properties
  • French bundle_fr.properties
  • Bergabung bundle_in_ID.properties
  • Italian bundle_it.properties
  • Japanese bundle_ja.properties
  • Korean bundle_ko.properties
  • Dutch BE bundle_nl_BE.properties
  • Dutch bundle_nl.properties
  • Polish bundle_pl.properties
  • Portuguese BR bundle_pt_BR.properties
  • Portuguese bundle_pt.properties
  • Russian bundle_ru.properties
  • Danish bundle_sv.properties
  • Turkman bundle_tk.properties
  • Turkish bundle_tr.properties
  • Ukrainian bundle_uk_UA.properties
  • Chinese CN bundle_zh_CN.properties
  • Chinese TW bundle_zh_TW.properties

1.11 Markup

The text renderer uses a simple makeup language for coloring text.

  • erros/unknown colors will be silently ignored.

Built-in Colors

1.12 Schematic

Fields that require the type Schematic can either take a built-in loadout (see the Zone section) a base64 string, or the stem name of a .msch file in the schematics/ subdirectory.

As of now, the only purpose of schematics is to give a zone a loadout.

1.13 Scripts

Scripting in Mindustry is done with the Rhino JavaScript runtime. Scripts may be added to your mod by putting them in scripts/ . Using the built-in extendContent function, you can extend existing Java types from JS, using allowed classes which are injected into your namespace.

1.14 GitHub

Once you have a mod of some kind, you'll want to actually share it, and you may even want to work with other people on it, and to do that you can use GitHub. If you don't know what Git (or GitHub) is at all, then you should look into GitHub Desktop, otherwise simply use your favorite command line tool or text editor plugin.

All you need understand is how to open repositories on GitHub, stage and commit changes in your local repository, and push changes to the GitHub repository. Once your project is on GitHub, there are three ways to share it:

1.15 FAQ

  • time in game is calculated through ticks ;
  • ticks sometimes called frames , are assumed to be 60/1 second;
  • tilesize is 8 units internally;
  • to calculate range out of lifetime and speed you can do lifetime * speed = range ;
  • Abstract what is abstract ? all you need to know about abstract types, is this is a Java specific term, which means you cannot instantiate/initialize this specific type by itself. If you do so you'll probably get an "initialization exception" of some kind;
  • what is a NullPointerException ? This is an error message that indicates a field is null and shouldn't be null, meaning one of the required fields may be missing;
  • bleeding-edge what is bleeding-edge ? This is the developer version of Mindustry, specifically it's refering to the Github master branch. Changes on bleeding-edge usually make it into Mindustry in the next release.

1.16 Change Log

This is a log of changes done on the Mindustry Master branch that affected the modding API. The sections are ordered by date commited, and provide a description of what was changed, with a link to the diff on Github.

Mar 5

[ commit Tech tree balance ]

  • updated research cost formula
Feb 11

[ commit improved battery brightness display ]

  • added <name>-top region for battery;
Jan 24
  • added instantDisappear to BulletType ;
Jan 23
  • added attribute to ThermalGenerator ;
Jan 22

[ commit added default ore flags for modded ores ]

  • added oreDefault , oreThreshold and oreScale to Floor ;
Jan 19

[ commit cleanup of scripts ]

  • added killShooter attribute for BulletType ;
Jan 14
  • added -spinner region to Separator ;
  • removed spinnerRadius , spinnerLength , spinnerThickness , color from Separator ;
Jan 08
  • added rebuildable to Block ;
Jan 07
  • added drawCell , drawItems and drawLight to Mech ;
Jan 04

[ commit merge remote-tracking branch 'origin/master' ]

  • added targetDistance to Weapon ;
Jan 03

[ commit use findAll to iterate through mod content ]

  • content/ support for organizing .hjson files into directories;
Dec 12

[ commit add liquid void block ]

  • added LiquidVoid block;
Dec 09

[ commit Removed unnecessary unit types ]

  • changed unit types names:
    • Draug → MinerDrone ;
    • Spirit → RepairDrone ;
    • Phantom → BuilderDrone ;
    • [ Dagger Crawler Titan Fortress Eruptor ] → GroundUnit ;
    • [ Wraith Ghoul ] → FlyingUnit ;
    • Revenant → HoverUnit ;
    Dec 08

    [ commit Merge branches master and rhino-js-suffering ]

    • scripts/ sub-directory and Rhino JS runtime was added;
    • displayName can now be used as field name in mod.json
    Dec 04

    [ commit Added experimental server block syncing ]

    • sync field for Block type was added;
    Nov 26

    [ commit Texture overrides / Potential mod texture binding optimizations ]

    • sprites-override/ subdirectory can now be used to override existing ingame sprites;
    Nov 22

    [ commit Switched to hjson extension ]

    • .hjson can now be used as a file extension;
    Nov 22

    [ commit Added optional mod minimum game version ]

    • minGameVersion can now be used within mod.json ;
    Nov 20

    [ commit Better mod parsing ]

    • liquid/amount can now be used as a string for LiquidStack ;
    • item/amount can now be used as a string for ItemStack ;
    • mod.json now supports hjson;

    2 World

    2.1 Block

    Block is the base type of all blocks in the game. All blocks have at least one sprite, which is picked relative to the blocks name.

    Fields for all objects that are blocks.

    • <name> the main sprite for the block.

    2.2 Consumers

    This type is commonly used in block type with it's field consumes , it's a type that allows your block to consume something, and how this field works is up to the specific type extension you're using.

    field type notes
    item String shorthand for items
    items ConsumeItems consume a number of different items
    liquid ConsumeLiquid consume a single liquid
    power float or ConsumePower consume or buffer power
    powerBuffered float amount of power buffered

    • you shouldn't have power and powerBuffered .

    2.3 Consume

    Abstract type which defines a type of resource that a block can consume.

    ConsumeItems

    Type to consume ItemStacks.

    field type
    items [ ItemStack ]

    ConsumeLiquid

    Type to consume a LiquidStack.

    ConsumePower

    Type to consume or buffer power.

    field type notes
    usage float The maximum amount of power which can be processed per tick. This might influence efficiency or load a buffer
    capacity float The maximum power capacity in power units.
    buffered boolean True if the module can store power.

    2.4 BlockStorage

    Type for blocks which may store a buffer of items or liquid.

    2.5 Environment

    Environmental blocks are blocks that must be placed from the editor, and they're the ones that will generally dictate how the game can or will be played. These blocks wont appear on a map unless you've built a map to support them.

    Floor

    Type used for floors themselves or extended to make ores and other things.

    Начните кампанию, перейдите на отправную точку и начните игру.

    Сейчас будет объяснение интерфейса:

    • Выход в меню (три точки)
    • Сворачивание интерфейса (стрелка вверх или, если вы уже нажали вниз)
    • Список проектов
    • Пауза (желательно нажать) .
    • Удаление (молоток)
    • Продвинутые конвейеры
    • Копирование
    • Подтверждение строительства
    • Броня игрока и юнит (Если вы включили боеприпасы для юнитов, правая шкала будет для боеприпасов и станет цвета меди)

    На интерфейсе закончили, приступаем к строительству!

    У вас обычно будет ядро 'Осколок' (на некоторых картах будет готовое проставление меди)

    Сначала, найдите рядом с собой медь, и постройте там бур (Выберете значок дрели, выберете первый бур и постройте на источнике меди.

    Проведите конвейер к ядру. Поздравляем! Вы создали свою первую фабрику! Единственное что она даёт, это медь (Вам не кажется, что слишком много слов медь в странице?)

    Постройте защиту, нажмите на дерево технологий и изучите медную стену выберите знак щита, и поставьте стены во всех проёмах рядом с ядром. Поставьте турели, нажмите первый значок в строительстве и выберите двойную турель, Найдите ЕЩЁ меди и теперь подсоедините его к турелям к внутренней стороне ядра рядом с стенами. Поставьте маршрутизатор от одного блока на стене, Ставьте за турелями маршрутизаторы, проведите линию от главного маршрутизатора к остальным. Повторите процедуру меди для свинца. Пока, улучшайте оборону и ставьте рассеиватели (на других локациях) заряжая их свинцом. Ждите и после достижения нужных ресурсов и изучения некоторых технологий отправляйтесь в ледяной лес.

    Читайте также: