Space Engineers

Space Engineers

(BROKEN) EMGC Respawn Ship Replacer
cptsavarus  [developer] 23 Aug, 2018 @ 5:49am
Changing spawn locations for custom maps
If you're using a custom map & want these ships to spawn in the proper locations for that map, here's how to do it.
You'll need a couple of pieces of common software. If you don't already have them, links are provided below.

Software required
WINZip or WINRAR for extracting the mod files.

WINZip can be found here...
https://www.winzip.com/win/en/downwz.html

Or WINRAR here...
https://www.win-rar.com/download.html?&L=0

Notepad++ for editing the mod files. Get the latest version here...
https://notepad-plus-plus.org/download/v7.5.8.html

To locate & unpack the mod files
Next you'll need to locate & unpack the files from this mod.
Depending on how many mods you're subbed to, this may take anywhere from a few seconds to an hour or more (you'll see why in a moment).

To find all your downloaded mod files, look here...
C:/Users/User 1/Appdata/Roaming/SpaceEngineers/Mods

(Substitute "C:/" for the designation of the drive on which you installed SE and substitute "User 1" for your windows username)

When you open the folder you'll see a list of files with 9-digit numerical names, all with the .sbm file extension.
(To see file extensions, Open "Folder Options", select the View tab and in the Advanced Settings list, un-check "Hide extensions for known file types")

Each of these strangely named files is a mod you've downloaded, in compressed archive format... they're folders.
To open one, first install WINZip or WINRar, then right-click the file & select "Open" from the context menu.
A popup box will appear saying "Windows can't open this file unless it knows what program was used to create it".
Check the option "Select program from list of installed programs" and click "OK".

In the new popup, first UN-check the box marked "Always use this program to open this kind of file". You don't want to do that!
Next, click "Browse" and locate your WINZip or WINRAR executable (.exe)
Select it & click "OK".

The archive folder should open & you'll see all the files that came with the mod.

Finding the correct mod
Unfortunately there's no quick way to do this.
If you happen to know the exact date on which you installed the mod, you can identify the correct archive file by its creation date. If not you may have to search through many mods to find this one.
(tip - viewing the thumbnail is a quick way to know if you're in the right archive before moving on to the next archive)

The fastest way to identify all your mods is to copy each of the archive (.sbm) files into a new folder of its own - I recommend doing this in a new parent folder on the desktop so they're easy to get to.
You can then extract each of the copied archives into its new folder and you'll have each of your mods not only backed up but easily accessible (so you can look at & play with them to see how they work).

Once you've identified the EMGC Advanced Respawn Ships Replacer mod you can close everything else & focus on it.

Structure of the mod
Inside the unpacked archive you'll see 3 files and a folder
  • Data (folder)
  • EMGC Respawn Ships Replacer README.txt
  • Modinfo.sbmi
  • thumb.png (the thumbnail image)

Open the "Data" folder.
Inside is another folder "Prefabs" and the modded version of the RespawnShips.sbc file (you can ignore this one.)
In the "Prefabs" folder is where you'll find the .sbc files for the ships that are added.
THESE are the files you need to edit in order to have the ships spawn at certain locations on your map.

Opening & editing the ship .sbc files
With Notepad++ installed, right-click on the file for the ship whos spawn-point you want to edit.
In the context menu, click "Open with Notepad++"

The file is large & the first few lines will look something like this...
Don't let it scare you - the edit is really simple!
(This is the start of the file for the EMGC KR-L Alien Lander)

<?xml version="1.0"?>
<Definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Prefabs>
<Prefab xsi:type="MyObjectBuilder_PrefabDefinition">
<Id Type="MyObjectBuilder_PrefabDefinition" Subtype="EMGC KR-L Advanced Alien Lander" />
<CubeGrids>
<CubeGrid>
<SubtypeName />
<EntityId>78463339669173200</EntityId>
<PersistentFlags>CastShadows InScene</PersistentFlags>
<UsePositionForSpawn>true</UsePositionForSpawn>
<PlanetSpawnHeightRatio>0.005</PlanetSpawnHeightRatio>
<PositionAndOrientation>
<Position x="131072" y="131072" z="5731072" />
<Forward x="0" y="0" z="-1" />
<Up x="0" y="1" z="0" />
</PositionAndOrientation>

The only line you need to alter is this one...
<Position x="131072" y="131072" z="5731072" />

To edit it you'll need to know the exact co-ordinates of the spawn-point you want the ship to appear at.

You can find them out by creating a new GPS marker from within the game, then noting down its co-ordinates.

Once you know the co-ordinates you want to use for that ship, just change the numbers in the line above.

For example, if you wanted the Alien Lander to spawn at the exact centre of the map, you'd swap all the numbers for 0...
<Position x="131072" y="131072" z="5731072" />
Would become...
<Position x="0" y="0" z="0" />

When you're done making the changes in Notepad, click the File menu & hit "Save" - just like any text editor.

Make sure to do your alterations only on your COPY of the mod, not on the original. Then if for any reason your changes don't work (or worse, break the game), you can make another copy & keep trying again until you get it right.

Congratulations, you just created a new mod! (Sort of)
To use your new version of the mod in the game, copy its parent folder back to this location...

C:/Users/User 1/Appdata/Roaming/SpaceEngineers/Mods

(Substitute "C:/" for the designation of the drive on which you installed SE and substitute "User 1" for your windows username)

Don't worry that it's a folder & not a compressed .sbm archive - the game will sort that out when you load it.

Next, delete the file named "Modinfo.sbmi". Yes, delete it.
And rename the mod folder to something you recognise.

And finally...
Run the game.
Open the world settings for your save.
Open the "Mods" list for that world.
Select your "new" mod and click to add it to the list.
And load the world.

The ships should appear at the co-ordinates you specified.

You'll have to change the co-ordinates in every ship .sbc file if you want to give them all new spawn-points... just repeat the process until every ship has the right co-ordinates.

Enjoy!

Please read the README file in the mod folder.
You're free to distribute copies of your new version of the mod to your friends.
You may not re-publish any new version of the mod without first asking permission.
You may not re-publish the ships on their own without permission.
You may not re-use my graphics without permission.
You may not disseminate the files individually. They must remain as a package.
This disclaimer MUST accompany any versions you distribute.
Last edited by cptsavarus; 23 Aug, 2018 @ 5:54am