FANDOM


There will be times when players will be able to modify the game with their own mods, which could ranging from rebalancing, adding new components and creating new faction to play as... Steam Workshop for Reassembly as we know will be open on someday... Mods will be divided into categories below:

  1. New Components: Adding new types of components to an existing faction.
  2. New Factions: Creating a new faction which could either be playable and unplayable, along with their own blocks, you could working on this with other peoples as a team if you grant them approval.
  3. Modifications: Modify the stats of components from any existing faction in the game, which range from IDs 200-17000. This could also mean modify the default ships or adding new ones to existing faction.
  4. Code Library/Graphics Modding: This is an utility mods created to supports other peoples mods, creator will create a new lines of codes that are not available in the vanilla games to support any kind of components reading that will not properly being readed by the game itself... This could also be something that could alter the graphic of the game if you may wish... In some cases utilities mods may be required to run some other mods.

For a list of user-made modding documentation, please see the Modding References page.

And we will also show quoted post of developer Arthur Danskin's modding instruction on the forums:

Source

—Arthur - April 14 2015,

Reassembly Modding

Introduction

This document describes the process of creating mods for the game Reassembly and documents several of the data file formats loaded by the game.

Mod Creation

1. Create a folder called "mods" alongside the "data" folder in the system save location

Windows: C:/Users/<You>/Saved Games/Reassembly/

Mac: /Users/<You>/Library/Application Support/Reassembly/

Linux: /home/<You>/.local/share/Reassembly/

2. create a folder for your mod inside this directory (e.g. .../Reassembly/mods/mynewmod/)

3. copy and modify files from the "data" directory into this folder as appropriate

4. Your mod will be automatically loaded when the game starts and should be visible in the "mods" menu as a local mod. Test the mod to make sure you are happy with it. Be sure to check the log for any errors in loading your mod.

5. Use the "Publish" button in the "mods" menu to upload the mod to the [Steam Workshop](http://steamcommunity.com/app/329130/workshop/). This should open the workshop web page for your mod, allowing the title and description to be edited.

6. The "Publish" button may be used again to upload revisions to your mod. Keep in mind that any changes will be downloaded by your mod's subscribers - try not to break backwards compatibility.

Modable files

Reassembly's data files can be overridden or extended via mods. The format of each file depends on its contents, but they are all parsed using the same system and have the same basic syntax. All data files are utf-8 encoded. Comments - instructional text that is ignored when loading - start with '#' or '--' and extend to the end of the line.

Since it is relatively easy to misplace a comma or brace, be sure to check the game log for syntax errors during mod file parsing.

An important component of the mod system is the ability to support multiple simultaneous mods. Since many things in Reassembly are referenced using numeric identifiers and it would otherwise be easy for multiple mods to accidentally pick the same identifiers, mods undergo a process called (Relocation) when they are loaded from the Steam Workshop. The details of this are described below.

Blocks - blocks.lua

Block mods can create new blocks or modify existing blocks. New blocks can be added to one of the base factions or attached to new factions.

By default blocks are built into the game binary. To generate blocks.lua, set cvar (kWriteBlocks=1) and restart the game. The best way to learn about the block file format is to study the descriptions for familiar weapons in this file.

The block file format syntax, like other Reassembly data files, is inspired by the programming language Lua. This is the description for the basic Plasma Cannon - a relatively small, octagonal, turreted projectile weapon.

{881, name="Plasma Cannon", features=TURRET|CANNON, group=8, blockshape=OCTAGON, blockscale=2, durability=0.500, blurb="Basic turreted damage dealer", density=0.150, fillColor=0x113077, fillColor1=0x205079, lineColor=0x3390eb, cannon={ roundsPerSec=4.000, roundsPerBurst=3, muzzleVel=1400.000, spread=0.020, damage=120.000, color=47081, range=1200.000}}

Block Identifiers

The first and most important element of a block description is the block identifier - in this case 881. Ship and save files containing the block will refer to the block by this number only. In general, changing the shape or size of the block will cause ships containing that block to load incorrectly. Certain block identifiers are "relocated" by the modding system for Steam Workshop mods to avoid conflicts between mods adding new blocks. Relocation essentially adds a per-mod id number to each new block in the mod.

New blocks (including new blocks added to default factions) should be given id numbers between 1 and 199. If you need to add more than 200 blocks, use numbers between 17000 and 60000.

The range 200-17000 is reserved for built-in default blocks and mods defining blocks within this range will overwrite those blocks. Mods modifying default blocks, should be careful not to change the blocksize or blockshape of the block to avoid breaking existing ships.

Block fields

Blockshape and blockscale together specify the shape and scale of a block. A list of all shapes will be written to the log when kWriteBlocks=1. The durability and density fields are multiplied the area of the block to calculate the health (hit points) and mass of the block, respectively. Although health may be specified, it is always overridden by the value computed from durability.

Colors are in hexidecimal RRGGBB format - the same as HTML or CSS colors except with a 0x prefix instead of #. The color of each block slowly phases between fillColor and fillColor1.

The P value of a block is calculated based on a number of other fields. There are also several fields that will be calculated if no value is provided. Auto-calculated fields include cannon and laser power, generator powerCapacity, shield and thruster color, color, block grow rate, resource capacity, durability, and density.

The group field should be set to the faction to which the block belongs. To make a block buyable in the Upgrade / Data Bank screen, it must also be used in a ship in that faction - see the next section.

Factions - factions.lua, ships/, extra_ships/

Ship files loaded from the ships/ directory must have the form <faction_number>_<ship_name>.lua, as in "8_interceptor.lua". Ships are indexed by name in much the same way that blocks are indexed by block identifier number - therefore, mods that add a new ship with the same name and faction as a default ship will overwrite that default ship. To avoid conflicting with other mods, ships added to default factions should avoid generic names and consider including the name of the mod or mod author in the name.

New faction should be assigned numbers between 20 and 100. Faction numbers in this range are subject to relocation in the same manner as block ids - when the mod is installed through Steam Workshop the mod identifier will be added to the faction number to create a new, unique faction number. Therefore, multiple mods may e.g. define faction 20 without fear of conflicting.

The file factions.lua describes faction data not in the ships themselves. The "color0" and "color1" fields are used in combination with block colors when the player changes their faction color. The "aiflags" field describes the default ai behavior of ships in this faction - individual ships are also subject to behavior randomization. Factions with "playable=1" will show up on the faction select screen, and the "start" field specifies the starting player ship for that faction.

Ships loaded from the extra_ships/ directory are added to faction 10 (set by kExtraShipsFaction). The file name need not follow the same format as ships loaded from the ships/ directory.

New faction mods must also add their faction to regions.lua - see the Map section.

Audio - audio.lua, audio/

Shaders - shaders.lua, shaders/

Reassembly loads GLSL version 1.2 shaders from this file which mods can override. Files are merged together by key so mods should only define shaders that they change. Shaders can #include files from the shaders/ directory for convenience.

Text - messages.lua, popups.lua, tips.lua, text.lua

These files define text that shows up in various places in the game. Text files loaded by mods are merged with the default versions and with other mods so mod authors should only place new contents in these files.

The text.lua file is the only one not present in the base game directory. This file allows replacement of hard-coded game text and is intended for localization style mods. For example, to replace the "Start" button on the main menu with a "Play" button:

{ "Start" = "Play" }


Map - regions.lua

The regions.lua file is used to generate the map when a new game is created. It is also referenced as individual sectors are explored and generated. A "region" is a group of map sectors that are generated with the same parameters. There is typically at least one region per faction, but there may be several and region may generate more than one faction of ships or no ships at all. During generation, each region definition is expanded into several regions, each of which covers at least one sector. A description of which region definition corresponds to each sector is then written to map1.lua in the save directory.

A mod can either completely redefine this file or add a new region to the default contents. Mods that completely redefine the file are subject to extension by additive mods but two mods can not simultaneously redefine the file. Mods which primarily add new factions are encouraged to extend rather than replace to avoid conflicting with other faction mods.

The regions.lua file parses a single recursive Region definition structure. If the top level region defines the totalSize parameter, it will replace the whole region definition. Region mods that do not define totalSize will be merged with the existing region.

Region Definition Fields

{ ident = 208, count = 4, radius = { 0.1, 0.15 }, position = { 0.3, 0.8 }, fleets = { { 2, { { 0, 1000}, {1, 600} } } }, ambient = { 0 }, unique = { { "2_farmer", "2_farmer", "2_pship_farmer01", "2_pdepot_01big" } { "2_farmer", "2_farmer", "2_pship_farmer02", "2_pship_farmer02", "2_pdepot_01" } }, fortress = { "2_platform0", "2_platform1", "2_platform3" }, fortressCount = { 1, 3 }, }

The "ident" field uniquely identifies the region and is stored in the save game directory (in map1.lua). As with block and faction ids, mods should avoid changing region identifiers as doing so can break existing save files. Region identifiers are subject to relocation in the same manner as block idents and faction numbers.

"count" determines the number of actual regions generated by this definition. "radius" and "position" are both in the range [0-1] and specify ranges for the radius of each generated region and its distance from the origin of the containing region, respectively.

The "fleets" field defines a P curve for ships generated by each faction - in this case sectors at radius 0 from each region (i.e. the center) will generate 1000P of ships and sectors at the edge will generate 600. See the regions.lua file for documentation and examples of other region fields.

Font - blockfonts/

In-game block fonts are used most prominently to write "Reassembly" on the title screen. Fonts can be created or modified with the "sfont" console command. Use the "write" command to add text to the game.

Misc - cvars.txt

Cvars are a general mechanism for loading game variables from a file. They can also be changed via the console "cvar" command. Many aspects of the game can be changed through cvars, for example the P cap (kPointMax), various C rewards and costs (kConquestC, kWormholeC, kRecruitCostC, ...), graphics settings (kWorleyColorRadius, kProjectileGlow, kProjectileHalo),

and many other settings.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.