Reassembly

Reassembly

30 ratings
Custom Factions: A Barely Sufficient How-To
By Cirr
So you've made your own block palette of ungodly supernukes and lasers that can kill stars. Now what?
   
Award
Favorite
Favorited
Unfavorite
Foreword
Why does this exist now and not three weeks ago when people wanted it you jerk

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
Look I just don't think the red faction is hard enough to play as

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
Fire drones that fire nukes that also fire drones with lasers
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.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=407670942
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=416847388

Hopefully, the developer's modding documentation will fill in the gaps our guides haven't filled.
Ships And Stations
P limits are more like guidelines, really

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!

Needs more nukes

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
And now my faction lives in a world of explosion

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 asteroidsSQUARE - square asteroidscolor [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.
      Cvar editing for fun and destruction
      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.
      No this ship sucks I want to start with the capital ship
      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!
11 Comments
Metaladon 20 Apr, 2017 @ 2:27pm 
If you've asigned to them to a faction number, plop the file that RWDK gives you from the block section into a folder of your own name in the "Mods" folder of reassembly's database. Also use RWDK to create a brief "faction.lua" that allows your faction's blocks to be connected, and also place it in that folder. Then, start up Reassembly and go to the Sandbox. If all goes well, you should be able to do "palette (faction ID), and it will spawn all of the blocks you have created with that file.
Enderminion 23 Jun, 2016 @ 5:12am 
Question, I used RWDK to make a set of blocks but where to I but the file I got from there to use in the sandbox?
Poi 21 Feb, 2016 @ 1:38pm 
@worldshaper1
Load a new regions.lua by modifying a copied one from a different mod faction and changing the faction number to your local faction number, Or make one from the Reassembly RWDK. Make sure the faction # for the regions file matches the faction # for the faction file.
Worldshaper 12 Jan, 2016 @ 6:21am 
Well I did everything here and was wondering if you knew why when i loaded up that I was put in the bottom left corner and if I left the area the base would despawn?
Conga Lyne 1 Sep, 2015 @ 1:57am 
As for fleets, "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."

My theory is the 0 and the 1 are depth fields, so if this is true I could set another value to 2 and assuming a controlled area is extremely deep, the p value would change instead of carrying over from what 1 says.
Conga Lyne 6 Aug, 2015 @ 9:36pm 
Could use pics
Nomander 28 Apr, 2015 @ 5:45am 
Cirrial great guide! And multi-faction ships work and are pretty awesome actually. Multi-core ships though... thats confusing. Not really actually. The other cores don't do anything. I have a ship with F15's armor block F2's scattergun and the scatter is modified to have extra range and damage and fire rate. Also the command module is the bee faction.
Cirr  [author] 25 Apr, 2015 @ 7:44pm 
This guide covers that area far better than I could: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=407670942
Deltonus 25 Apr, 2015 @ 6:47pm 
Cirral : I agree, that one problem, Also, how do you make different factions playable, a more in depth version, like what programs to instal, and step by step what to do with said programs, As i want to play as those throny plant thingies that swarm you with death :P I also want to see how faction 7 plays... They have barely any parts, :P
Cirr  [author] 25 Apr, 2015 @ 5:08pm 
I have to admit I never tried it and the inbuilt multi-faction ships faction is its own special case in every way, it looks like, but I don't see any clear reason why it wouldn't work other than maybe the regular editor not working so well at knowing which blocks the faction should get to build with.