Space Engineers

Space Engineers

(9/19/15) LSF CargoShip Mod (v1.45)
RelicSage  [developer] 12 Oct, 2014 @ 5:43pm
How to guide to creating your own CargoShip Mod!
So you want to make your own mod with your ships? Well to get started you just need a Text Editor (Notepad++) and a Purchased copy of Space Engineers.

Now assuming you've already created and designed your ship, let’s stop there for a moment and think about your design. Below are MY recommended specs your ship should follow to encourage other players to use your mod on your server.

- Your ship should not exceed 100 blocks in length.

- Should not include any moving parts (Rotors, Pistons, etc.) Any moving parts may simply tear your ship to shreds as it loads on multiplayer servers.

- Depending on why you want this particular design of yours to spawn randomly for other players, the inventory should be balanced accordingly (Such as PVP servers may need some guns and explosives)

- Trapping your ships is a good idea, now that we have timers and sensors you can set a warhead to explode as soon as a player comes in range, or have a forward thruster aimed at a warhead inside.

- Guns Guns Guns! You don't want to make your Ships invulnerable to attack, but then again you don't want them to be simple landing pads. You’re going to have to do some testing, preferably with some friends and try to capture your ship. Come up with some creative ways too.

Ok now you have your design! GREAT!

1. Before we export your ship to an SBC file we need to make sure the ship name is changed to easily find it. First access a control button or get in the cockpit of your ship and press K. Now go to the Control Panel and press CTRL + A to highlight everything and change ownership to “ME”, Once that is done go to the “Info” tab and change the name of your ship on the right side and press ok. Now save your game and follow the steps below.
2. Load your game in CREATIVE offline mode ONLY with your ship and Copy it (CTRL+C)

3. Now press F11 and select “Export clipboard to file” you’ll see a message stating where the file was saved.

4. The file will be saved as a SBC file and can be opened in a normal Text editor

5. Locate your SBC file here C:\Users\%Username%\AppData\Roaming\SpaceEngineers\Export (NOTE: you may need to enable folder view to see the App Data folder, you can enable this by going to control panel > Folder options > View Tab > and select “Show hidden files, folders and drives”)

6. Once you’ve located your SBC We need to create the Mod Folder in
C:\Users\%Username%\AppData\Roaming\SpaceEngineers\Mods. Example I named my mods folder LSF CargoShip Mod.

7. Now open your Mod Folder you just created and create a new folder called “Data” and open that folder and create a new folder called “Prefabs”

8. Now we have the makings for a mod! So lets copy and paste your ships SBC file to C:\Users\%Username%\AppData\Roaming\SpaceEngineers\Mods\%modsname%\Data\Prefabs folder

9. Ok it’s time to get all the necessary files copied into your mods folder. Open C:\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Content\Data and locate the SpawnGroups.sbc and GlobalEvents.sbc files and copy them to C:\Users\%Username%\AppData\Roaming\SpaceEngineers\Mods\%modsname%\Data folder.

10. The GlobalEvents.sbc file tells the game when to spawn your ships and how often to spawn them. The SpawnGroups.sbc file tells the game what ships to spawn. So lets start with the easier of the two, open GlobalEvents.sbc file into a text editor.

11. You should now see something like this:
<?xml version="1.0"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GlobalEvents>
<GlobalEvent>
<Id>
<TypeId>EventDefinition</TypeId>
<SubtypeId>SpawnCargoShip</SubtypeId>
</Id>
<DisplayName>Cargo ship</DisplayName>
<Description>Spawns a random cargo ship from time to time</Description>
<EventType>SpawnCargoShip</EventType>
<MinActivationTimeMs>900000</MinActivationTimeMs>
<MaxActivationTimeMs>1200000</MaxActivationTimeMs>
<FirstActivationTimeMs>30000</FirstActivationTimeMs>
</GlobalEvent>
<GlobalEvent>
<Id>
<TypeId>EventDefinition</TypeId>
<SubtypeId>April2014</SubtypeId>
</Id>
<DisplayName>April 2014</DisplayName>
<Description>Surprise!</Description>
<EventType>April2014</EventType>
<MinActivationTimeMs>1000</MinActivationTimeMs>
<MaxActivationTimeMs>1000</MaxActivationTimeMs>
</GlobalEvent>
<GlobalEvent>
<Id>
<TypeId>EventDefinition</TypeId>
<SubtypeId>MeteorWave</SubtypeId>
</Id>
<DisplayName>Meteor wave</DisplayName>
<Description>Spawns random meteorites to wreak havoc!</Description>
<EventType>MeteorWave</EventType>
<MinActivationTimeMs>10000</MinActivationTimeMs>
<MaxActivationTimeMs>10000</MaxActivationTimeMs>
<FirstActivationTimeMs>10000</FirstActivationTimeMs>
</GlobalEvent>
</GlobalEvents>
</Definitions>

Now it looks like a lot of info but really there’s only three lines we need to edit.

<MinActivationTimeMs>900000</MinActivationTimeMs>
<MaxActivationTimeMs>1200000</MaxActivationTimeMs>
<FirstActivationTimeMs>30000</FirstActivationTimeMs>

The first and second line tells the game to spawn the ship randomly between these two timeframes and they are calculated in Milliseconds. You can search on Bing or Google for a converted to calculated time in Minutes to milliseconds. The Third line tells the game to start the Cargo Ships spawn once the game starts. In this case 30000 milliseconds is 5 minutes when the game is loaded.

12. Once your happy with the Timeframes you’ve set for the spawns its time to add your ship as a random cargo ship in the game. Go ahead and save GlobalEvents.sbc and close it. Now open SpawnGroup.sbc

13. You should see something similar to this.

<?xml version="1.0"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SpawnGroups>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Military1</SubtypeId>
</Id>
<DisplayName>Military1</DisplayName>
<Description>Military escort spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>4.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Military1">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Military Escort</BeaconText>
<Speed>25.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Military2</SubtypeId>
</Id>
<DisplayName>Military2</DisplayName>
<Description>Military minelayer spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>2.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Military2">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Military Minelayer</BeaconText>
<Speed>17.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Military3</SubtypeId>
</Id>
<DisplayName>Military3</DisplayName>
<Description>Military transporter spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>1.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Military3">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Military Transporter</BeaconText>
<Speed>10.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Mining1</SubtypeId>
</Id>
<DisplayName>Mining1</DisplayName>
<Description>Mining carriage spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>4.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Mining1">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Mining Carriage</BeaconText>
<Speed>25.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Mining2</SubtypeId>
</Id>
<DisplayName>Mining2</DisplayName>
<Description>Mining transport spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>2.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Mining2">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Mining Transport</BeaconText>
<Speed>17.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Mining3</SubtypeId>
</Id>
<DisplayName>Mining3</DisplayName>
<Description>Mining hauler spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>1.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Mining3">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Mining Hauler</BeaconText>
<Speed>10.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Trade1</SubtypeId>
</Id>
<DisplayName>Trade1</DisplayName>
<Description>Private sail spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>4.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Trade1">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Private Sail</BeaconText>
<Speed>25.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Trade2</SubtypeId>
</Id>
<DisplayName>Trade2</DisplayName>
<Description>Business shipment spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>2.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Trade2">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Business Shipment</BeaconText>
<Speed>17.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Trade3</SubtypeId>
</Id>
<DisplayName>Trade3</DisplayName>
<Description>Commercial freighter spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>1.0</Frequency>
<Prefabs>
<Prefab SubtypeId="Trade3">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText>Commercial Freighter</BeaconText>
<Speed>10.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>
</SpawnGroups>
</Definitions>

Within this file you’ll see a lot of info however we just need to worry about this script below

<SpawnGroup>
<Id>
<TypeId>SpawnGroupDefinition</TypeId>
<SubtypeId>Your Ships SBC Name</SubtypeId>
</Id>
<DisplayName> Your Ships SBC Name </DisplayName>
<Description> Your Ships SBC Name spawn group</Description>
<Icon>Textures\GUI\Icons\Fake.dds</Icon>
<Frequency>4.0</Frequency>
<Prefabs>
<Prefab SubtypeId=" Your Ships SBC Name ">
<Position>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Position>
<BeaconText> Your Ships SBC Name </BeaconText>
<Speed>25.0</Speed>
</Prefab>
</Prefabs>
</SpawnGroup>

The <SubTypeID> Should be the name of your ships SBC file without the SBC extension

The <DisplayName> Should be the name of your ships SBC file without the SBC extension

The <Description> Should be the name of your ships SBC file without the SBC extension

The <Prefab SubtypeId="Ships SBC File"> Should be the name of your ships SBC file without the SBC extension

The <BeaconText> is Going to be the name of your ship that you want other people to see on their HUD

The Speed is determined in M/S in game the speed cannot exceed 104 M/S or it will crash the game and also note should be set under 30 M/S for multiplayer due to lag issues.

The Frequency is the spawn rate for the ship so if you have a ship that you want to spawn all the time then you’ll want to set this to a higher number like 50.0 or higher or if you want the ship to spawn very rarely then set it closer to 1.0

14. Once you have your script filled in just add it to the bottom of the SBC file and paste it just above this script below:

</SpawnGroups>
</Definitions>

15. Now save SpawnGroups.sbc and load Space Engineers

16. On the main menu select Load Game and select one of your games and click Edit Settings. Click on Mods and on the left side you should see your mod with a White Box for an icon. Select your Mod and click Publish down below and follow the onscreen prompts. This will upload your mod to the Steam Workshop for others to download and use.

NOTE: Before releasing your mod to the public you should subscribe to your mod and Test it out in Offline Mode and press F11 to see if there are any Errors with your mod.

Well there you have it. I hope this helps!


< >
Showing 1-8 of 8 comments
Antharann Fireblade 14 Oct, 2014 @ 10:07am 
i have a problem whre the ships i created won`t load. do they need a cockpit or so?
RelicSage  [developer] 14 Oct, 2014 @ 10:34am 
yes for orientation. SE uses the cockpit to define which way is forward
Antharann Fireblade 14 Oct, 2014 @ 10:55am 
does a RC block also works?
RelicSage  [developer] 14 Oct, 2014 @ 3:17pm 
Yes RC Blocks work, in my test mod I have an RC mine drill that spawns just fine
thx
RelicSage  [developer] 30 Oct, 2014 @ 3:56am 
With the recent updates, the RC block does not work. This will cause SE to crash.
thx
Hey, I thought I'd chime in on the RC Block situation. It appears that it works again for cargo ship mods (tested and working fine on my side)

On another note, is there a method to getting the cargo ships to spawn elsewhere on the map? They all seem to appear within 15k of center. The last time I had used your mod, it appeared they would spawn near any ship/station/etc.

This could just be a symptom of the recent update as well..

Cheers!
< >
Showing 1-8 of 8 comments
Per page: 1530 50