Overview
So you’ve made your own block palette of ungodly supernukes and lasers that can kill stars. Now what?
Foreword
This guide is incredibly badly timed.
Everyone who would have wanted this to be written earlier has probably already figured it out, and I expect the developer to release mod support and documentation very soon (this week), so this guide is going to be obsolete in days.
HOWEVER, in the offchance you haven’t figured out how to make a custom faction yet, and the official documentation doesn’t exist, maybe this guide can be useful to all two of the people it’s relevant to!
Making a Faction
So what exactly constitutes a faction?
A faction is:
– A block palette
– A bunch of ship and station designs
– An entry in ships.lua registering these designs to a faction number
– (optional, but vital for ever seeing them in game) Some instructions for how their regions generate
– (optional, but vital for actually playing) A couple of tweaks to cvars to make them playable
Simple, right? Well, yes, but it requires some sandbox fiddling and some lua file editing. Let’s go over the requirements, step by step.
Block Palettes
Honestly, it feels kind of dumb to plug my own guides, but the general concepts and such of block creation are better explained in a different guide I wrote. See also Camo5’s Reassembly Guide to Fruition for the gaps my guide didn’t cover.
Hopefully, the developer’s modding documentation will fill in the gaps our guides haven’t filled.
Ships And Stations
Now that you have your block palette, it’s off to the sandbox!
To test that your palette has in fact loaded into game, use either palette <your faction id> or minpalette <your faction number> in the sandbox.
palette will create all of the blocks you’ve defined.
minpalette will create only the smallest scale of each block you define. Remember! If you want a block to be resizable, you must declare it multiple times and vary only the blockscale parameter. You can control how much a block can be scaled by how many or how few duplicates of the block you specify in blocks.lua.
Now that you have your palette, it is time for what you will probably consider to be either the most fun part or the most tedious part, depending on what you get out of the game, and that’s to design a whole bunch of different ships and stations for your faction to use.
In the sandbox, hit the number key 3 to enter Construct mode. This turns the entire world into something you can drag blocks around and edit. All the editor commands you’re used to work the same, more or less. Assemble ships as you see fit (make sure to vary the P value for ships) and don’t forget to make a few stations! Stations are made exactly the same way as ships, but must have zero thrusters. None. Absolutely immobile. Torquers are fine, though.
Late advice for block editing: give your station command modules (if you decide to make a separate block for station command) a lot of mass to stop them being easily budged. Do the exact opposite to have stations that fly off into the distance and get pulped!
Now, here is the important part. Well, one of several important parts. When you’re happy with a ship/station design, double click it (or click and drag) to select the entire cluster. This next part is very important. Save your ship/station using ssave <name of ship/station>, where the name of your ship/station must follow this convention:
<faction number>_<lowercase name>
For example, for faction 25, with a ship you want to name the Shipname (creative!), you would use the following command: ssave 25_shipname
If you want to back up your ships (probably a smart idea), your ships are saved to data/ships in the Saved Games/Reassembly folder. The same data folder where blocks.lua and cvars.txt live, with the same filename as the ship name.
If you want to load a ship from this directory to edit, use sload <name>. If you ssave a ship with the same name as a previously existing one, you overwrite the old definition with your changes.
If you want to see how the AI uses your ship, select an entire ship and use the command activate! Make sure you saved a copy of the ship or otherwise kept an inert duplicate around before you do so, just in case it manages to get itself blown up somehow. fleet <regular faction number> and agent are good to spawn in some things to test your designs against.
If you are planning ahead, keep in mind that the player’s starting ship is whatever ship comes closest to 300 P without going over, but there’s a way to circumvent that discussed later.
So you have a bunch of ships and stations! You are most of the way to a faction! However, at the moment, you need to do a few more things.
Find and open ships.lua in the same data directory as blocks.lua and cvars.txt. You need to manually register your created ships under a faction number (but this step may change in a future version, as it’s rather redundant). To register ships, you need to add a lua table/object/whatever to the end of the list of existing ones. It should be in this structure:
{<faction number>, {“*_yourshipname”, “*_anothership”, “*_astation”}}
Add each filename of your ship or station to the list enclosed within the table. (Please don’t actually preface them with asterisks. The asterisk is a stand in for your faction number.) This registers them to the faction. Congratulations! The faction exists! In a sense! They exist enough to show up on the title screen at random, which is neat.
Playing as Your Faction
Before you can even entertain the concept of playing as your faction, they need to exist in the wide, bleak, plant-filled void of the Reassembly world. To do this, your next target is regions.lua. Do not change anything that already exists here. It could break your existing saves. However, adding a new subregion definition is totally fine! Of course, if you add a new subregion and then change or delete it later, you’ll probably need to regenerate the world for that save for any changes to take effect.
So, you will notice perhaps subregions. This is what we need to add a new subregion to. This subregion will define what your faction’s environment is like. There’s a variety of properties to modify here! And, as before, I’m not 100% sure on what all of them do.
count [number]
– How many subregions of this type should exist in the map at large. Subregions are circular and have an increase in ship density and ship P value as you get closer to their centre.
radius {[number], [number]}
– How big the subregion should be, from min to max, using values between 0 to 1 representing the entire size of the map. Small regions might have a radius setup of {0.05, 0.1}, ie. 5% of total map size to 10%, while larger regions might go a little crazier. Try not to go too crazy.
If you abhor variation, you can also just use one number, ie. radius = 0.15.
position {[number], [number]}
– Where the subregions should be placed. Like radius, this is a min and max setup, where 0 is the direct centre of the map and 1 is the very edge. Like radius, you can use just one number if you want them to always be placed on the same ring from the centre.
ambient {[number]}
– What sort of plants grow in the subregion. -1 for no plants, 0 for green, 1 for blue, 2 for pink.
fleets { { [faction number], { { 0, [number]}, {1, [number] } } }
– This actually registers a subregion as being related to a specific faction. Put your faction’s number in as the first number parameter. The next two numbers determine the p value of ships at the centre of the subregion (typically higher than the edge) and the p value at the edge of the subregion (typically lower than the centre). You could theoretically change the 0 and 1, probably, but no example of this exists in regions.lua and I’m not sure what the effects would be.
fleetCount { ??? }
– Not entirely sure how this varies. With just one content, {[number], [number]}, it species a minimum and maximum number of fleets to spawn in the subregion. However, there is an existing subregion with { { 3, 5 }, { 5, 10 } } for faction 15, and I have to confess not having a clue how this gets interpreted, unless it’s a simple case of one of the ranges being chosen at random.
unique { {
}, { [another list of ship name strings] }, etc. }- This lists a bunch of things to place down as a feature of the subregion, presumably. Not sure how placement is dictated. Every ship name in a list is placed, so you can define multiple lists for each subregion to get its own set of unique station and ship placements? Not 100% sure.
fortress {
}- Specify a bunch of stations that count as defenses. Useless without fortressCount, presumably.
fortressCount {[number], [number]}
- Specify a min and max amount of specified fortresses to place around the subregion.
fortressRadius {[number], [number]}
- Presumably a min and max of how far fortresses are placed from the subregion centre, but appears to be given in terms of units of distance instead of relative values.
fleetFraction [number]
- A number between 0 and 1 that, uh. No idea. Populates the subregion?
type [number]
- The most mysterious of all region properties. Take your life into your own hands if you try defining this.
asteroidSize {[number, number]}
- Another min-max pair that determines asteroid size inside the subregion.
asteroidDensity {[number, number]}
- Min-max pair of numbers between 0 to 1 that determines how dense and asteroid packed the region is.
asteroidFlags [chained flags]
- A few flags you can chain together with | for fun stuff. There's probably a lot more flags I don't know. Examples:
EXPLOSIVE - asteroids explode!
TRIANGLE - triangular asteroids
SQUARE - square asteroids
color [0xRRGGBB]
- Not entirely sure if this is an ambient background colour or just the colour it shows up as on the map.
So you've defined your region generation for your faction! Now they can feasibly be encountered in a game you play (but you will need to start a new game or regenerate the world for an existing save). However, you probably want to play as your faction, not just crush/be crushed by them. So, how do you play a faction you can't normally play as?
The answer, as always, lies in cvars.txt.
So, first off, to make a faction playable, you will need to add your faction number to kPlayableFactions. But this isn't sufficient to play as them. No. Now you will need to find your faction in gameplay and blow up a ship worth 1000 P, same as other factions.
Or you can edit unlock.lua. I have no idea how to direct you to this file. I suggest a good computer search program. It's the right one if it contains a block that says {factions={a bunch of numbers}}. Add your number to the list, save the file, close and relaunch Reassembly, and your faction is unlocked and ready to play as!
Read the next part first though, before you do.
Reassembly is amazingly procedural. It reacts to what is thrown at it with incredible grace. This includes selecting appropriate starting ships and unlocked technologies, and locking a bunch of other blocks behind C costs.
Here are some key things to consider. These might require some hasty redesigns for your factions, but you read this guide all the way through first before you jumped into following the instructions, right? Right?
The initial unlocked technology is everything that the starter ship has, and everything with a 0 P cost, and the technology that remains locked is anything with a >0 P cost that the starter ship doesn't have.
If you hate the ship Reassembly has chosen to be your faction's starting ship, please consider that Reassembly will pick a ship with the closest P value to 300 that doesn't exceed 300 (or whatever kStartingP is set to). You can override this choice with kFactionStartShips in cvars.txt. Just specify your faction number and set it equal to the filename of your desired starting ship.
The rest from here is up to you! You can use your custom faction ships in tournaments on your end, but you won't be able to use the wormhole (in either way), so your friends won't ever see your faction unless you're prepared to spend a while telling them what files to edit and sending them lua files and directions.
It's key to note that without the ability to go through wormholes, the only way to regenerate your world is to do it manually.
Have fun with your faction!