This is a beta version, so don't rely on it working as intended. You use this software at your own risk!
The zip-file contains the "Shred.exe" for Windows and the "shredder" executable for Linux.
Windows version:
If you've built your ship in the wrong direction, you have to rotate the entire ship, since you can't rotate the core. To do this, copy and save the ship (the template must include the core), remove all blocks except the core (or place a new core) and use this tool with active core mode. Then load the resulting template, point the cursor on the top side of your core, rotate the template with the mouse wheel and place it.
Shrink/Core only mode
If you want to remove excess space or use core mode without shredding, just set the target size to a value of at least the size of your source template or to 0 or less. One file will still be created as the source file will never be overwritten.
Command line mode
You can also use the Template Shredder via command line. You only have to pass the parameters, that aren't already saved in the config file. Type
for a list of parameters. First you should save the path to your template folder, if the executable is in a different place. Type for example:
If you want to shred a template named "MyTemplate.smtpl" with a target size of 15, write:
Adding
like a parameter will save the text messages in the file "blah.txt".
Tips
The zip-file contains the "Shred.exe" for Windows and the "shredder" executable for Linux.
Windows version:
- Put the "Shred.exe" in the StarMade/templates folder. You can also put it elsewhere, but then you have to have two windows open.
- Double click it, a config text file (shred.txt) with the following default values will be created:
- Path to your templates folder, leave unchanged.
- Target size, change this to the build size limit of the server you're playing on.
- Either 0 or 1, set to 1 for shrink mode, to 0 otherwise.
- Either 0 or 1, set to 1 for core mode, to 0 otherwise.
- Save changes, close file.
- Drag and drop a template file onto the Shred.exe, one or more new template files should be created.
- Load these templates in advanced build mode and paste them in one after another. The first file will have "_0_0_0" attached to its name, paste this one last! Attach all templates to the same spot (where you would also paste a single big template) and all blocks will be in the right place.
- Check if everything is as it should be, please report if not, upload the respective template. Note that both items in storages and docked entities generally aren't saved in templates. Also, if two originally connected blocks end up in different template files, that connection will be severed.
- Put the "shredder" file in your "bin" folder, you might have to set the executable flag.
- Run "shredder" once to create the "shred.txt" config file with the following default values:
- Path to your templates folder, set this accordingly.
- Target size, change this to the build size limit of the server you're playing on.
- Either 0 or 1, set to 1 for shrink mode, to 0 otherwise.
- Either 0 or 1, set to 1 for core mode, to 0 otherwise.
- Path to your templates folder, set this accordingly.
- Save changes, close file.
- Open the console, type
Code:
shredder -h
- Load the newly generated templates in advanced build mode and paste them in one after another. The first file will have "_0_0_0" attached to its name, paste this one last! Attach all templates to the same spot (where you would also paste a single big template) and all blocks will be in the right place.
- Check if everything is as it should be, please report if not, upload the respective template. Note that both items in storages and docked entities generally aren't saved in templates. Also, if two originally connected blocks end up in different template files, that connection will be severed.
If you've built your ship in the wrong direction, you have to rotate the entire ship, since you can't rotate the core. To do this, copy and save the ship (the template must include the core), remove all blocks except the core (or place a new core) and use this tool with active core mode. Then load the resulting template, point the cursor on the top side of your core, rotate the template with the mouse wheel and place it.
Shrink/Core only mode
If you want to remove excess space or use core mode without shredding, just set the target size to a value of at least the size of your source template or to 0 or less. One file will still be created as the source file will never be overwritten.
Command line mode
You can also use the Template Shredder via command line. You only have to pass the parameters, that aren't already saved in the config file. Type
Code:
shred -h
Code:
shred -ds C:/StarMade/templates
Code:
shred -f MyTemplate -s 15
Code:
>blah.txt
Tips
- If you shred, for example, a 100x100x100 template with a target size of 10 you'll end up with up to 1000 files! If a template file would be empty it won't be created, though.
- If you want to rotate the copied object, rotate the original object before saving it. Then it will be saved in the rotated position.
- Core mode is also useful in combination with "Create Docking". You can quickly create docked cores and paste a turret onto them. This mimics the planned "Create Docking from File"-feature.