Soulmask Building Transfer

This page explains commands that can be used to back up and restore buildings as well as copy and move buildings between locations and between servers.

Using commands, it is possible to save buildings out to an INI file and then load them in. This allows cloning a building to another location, or cloning a building to a different save/server.

Note: Buildings will be saved to and loaded from the directory WS/Saved on the server where the commands are executed. If you want to load saved building on a different server, you will need to first copy the building save file to that server.

Note: I did not find any way to delete the exported building save files using a command. If you want to delete them, you will need to delete the files from the filesystem manually.

Commands

These are the commands related to saving and loading buildings.

SetJianZhuToFileMode ToFileRadius[int]

Target: controlled character (self)

Sets the radius around the player in which buildings will be captured by the SaveJianZhuToFile command.

  • ToFileRadius: The radius. Units are centimeters.

Example command usage. The following will set the capture radius to 100 meters.

gm SetJianZhuToFileMode 10000

SaveJianZhuToFile FileName[string]

Target: controlled character (self)

Saves all buildings within the configured radius to the specified ini file. The radius should first be configured using the SetJianZhuToFileMode command. It is recommended to stand on the ground when performing this action.

  • FileName: The name of the file where the building will be saved

Example command usage. The following will save nearby building pieces to a file named MyBuilding1.ini.

gm SaveJianZhuToFile MyBuilding1.ini

LoadJianZhuFromFile bFenPiSpawnJianZhu[bool] bUseSavedOriginTF[bool] LoadFileName[string]

Target: controlled character (self)

Loads buildings from the specified file into the world, either at their original location or at the player’s current location depending on the value of bUseSavedOrigin.

  • bFenPiSpawnJianZhu: Whether to “batch spawn buildings”. This has not been tested enough to understand it. Passing 0 or 1 both seem to work.
  • bUseSavedOrigin: Specifies the location the building will be spawned as one of the following.
    • 0: Spawn the loaded building at the player’s current location. See important details below for more information.
    • 1: Spawn the loaded building in exactly the same place on the map where it was saved. This is useful to transfer a building to another server.
  • LoadFileName: The name of the file containing the building to load

Example command usage. The following will load buildings from a file named MyBuilding1.ini and spawn them at their original location in the world.

gm LoadJianZhuFromFile 0 1 MyBuilding1.ini

The following will load buildings from a file named MyBuilding1.ini and spawn them at the controlled character's location..

gm LoadJianZhuFromFile 0 0 MyBuilding1.ini

CuiHuiViewGongHuiJianZhuByRadius InRadius[int]

Destroys all buildings around the player’s target within the specified radius. This is useful if you make a mistake loading a building and want to remove it, or if you just want to clean up your server.

  • InRadius: The radius around the targeted building in which to destroy buildings. Units are centimeters, but see important details below for important information.

Example command usage. The following will destroy all player-made buildings within a 10-meter radius around the targeted building.

gm CuiHuiViewGongHuiJianZhuByRadius 1000

Important Details

Some information which may help you better understand the above commands.

Destroying Buildings

The CuiHuiViewGongHuiJianZhuByRadius command has a somewhat confusing behavior in regard to how it works and its radius. The command will destroy entire buildings at once, not individual building pieces. Any pieces that are placed on the same building grid (snapped together) are considered the same building. The destruction radius starts from the origin of the targeted building and will include other buildings within range.

Here is a breakdown of how you can more safely use the command.

  1. Make a backup of your server's world save so you can roll back to it if you make a mistake.
  2. Get a rough idea for the radius of buildings you want to destroy.
  3. Aim directly at a piece of a building you want to destroy near the center of the overall area you want to destroy.
  4. If there are any building nearby that you do not want to destroy, then choose a small radius to start with. Remember that the command removes full buildings at once.
  5. Run the command and observer what gets removed. You may need to expand the radius and/or issue the command on other nearby targets to fully clean up the area.

Loading Buildings

When loading buildings using the LoadJianZhuFromFile command, there are two distinct ways in which the building can be positioned as defined by the bUseSavedOriginTF parameter.

bUseSavedOriginTF 0

This mode can be tricky to make good use of. The building will load at the location of the currently controlled character. It will be positioned and rotated relative to how your character was standing when the building was saved.

For best results when using this mode, save and load while standing on the ground and try to find terrain that somewhat matches the original building location. Rotate yourself in the way you want the building to be rotated, and consider standing up on a temporary foundation or on a rock to get a little extra height so the building will not be partially underground if the terrain is not a good match.

You may need to try a few times to find something that works. If you make a mistake, you can use the CuiHuiViewGongHuiJianZhuByRadius command to destroy the building before trying again.

bUseSavedOriginTF 1

The mode is fairly straightforward. The building will be loaded at exactly the same place where it was originally saved. This is useful if the original building is not present, such as after a wipe or on a different server.

Do not use this mode if the original building - or any building - is located where the building would load in. It will stack pieces inside each other which can lead to weird collisions and pathfinding issues in addition to adding to the server's performance load.