Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Official Modding Guide

Discussion in 'Modding Guides and Tools' started by Ondrej.Petrzilka, Aug 7, 2014.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Ondrej.Petrzilka Developer

    Local vs. Workshop mods:
    When you start developing new mod, you have a local mod
    When you're satisfied with mod, you will publish it to Steam Workshop (please test it first)
    Now you have two mods, one local and one on Steam Workshop
    You can update contents of local mod and then publish it to Steam Workshop again (mod on Steam will be updated)

    Offline games can use local mods and workshop mods with any visibilityMulti-player can use only workshop mods with public visibility (default)
    If the client who is joining the game fails to download a mod (e.g. because it's private or local), bad things will happen
    What can be modded:
    - skybox
    - cube blocks, components, ingots, ore, asteroid materials
    - character models, animations
    - custom character animations (waving, facepalm...)
    - transparent materials (useful for thruster glow)
    - prefabs and cargo ship (only partially)
    - debris models
    - missile launcher projectiles

    What can't be modded yet:
    - scenarios
    - audio
    - ammo magazines
    - GUI

    Directory structure:
    Mods directory: C:\Users\{username}\AppData\Roaming\SpaceEngineers\Mods\

    Here you see mods directory, there is one local mod (SkyboxMilkyWay) and two mods downloaded from workshop.
    Downloaded mods are zip files, you can rename it to .zip and open to see what's inside.


    Inside SkyboxMilkyWay:
    "Data" - similar to Content/Data in game directory
    "Textures" - similar to Content/Textures in game directory
    "modinfo.sbmi" - automatically create after publishing mod to Steam Workshop
    "thumb.jpg" - mod preview image, created by mod author

    Download SkyboxMilkyWay here: http://mirror.keenswh.com/Temp/SkyboxMilkyWay.zip
    There can be other directories, like "Models"


    Creating new mod:
    Create new directory in C:\Users\{username}\AppData\Roaming\SpaceEngineers\Mods\
    Put modified content into this directory (see section Content Modification)
    Create thumb.jpg (preview image)
    Run the game
    Go to Edit world settings (select new game or load game in main menu)
    Click mods button
    Click your mod and press Publish
    (it's good to test your mod first before publishing)

    Another Example - sphere block:
    We'll create new mod, which will define new block: Sphere
    I have prepared mwm model of Sphere, see here how to make mwm model: http://www.spaceengineersgame.com/modding.html

    1) Create directory C:\Users\{username}\AppData\Roaming\SpaceEngineers\Mods\SphereBlock
    2) Create directory C:\Users\{username}\AppData\Roaming\SpaceEngineers\Mods\SphereBlock\Data
    3) Create directory C:\Users\{username}\AppData\Roaming\SpaceEngineers\Mods\SphereBlock\Models
    4) Copy "Sphere.mwm" into "SphereBlock\Models"
    5) Create "SphereBlock\thumb.jpg"
    6) Create empty file "SphereBlock\Data\CubeBlocks_Sphere.sbc"
    7) Paste block definition into file:

    <div>&lt;?xml version="1.0"?>
    &lt;Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    &lt;SubtypeId>LargeSphereBlock&lt;/SubtypeId> &lt;!-- Unique block subtypeId -->
    &lt;DisplayName>Large Sphere&lt;/DisplayName> &lt;!-- Name visible in game -->
    &lt;Icon>Textures\GUI\Icons\Cubes\window&lt;/Icon> &lt;!-- Lets use window icon for our sphere -->
    &lt;CubeSize>Large&lt;/CubeSize> &lt;!-- We're making large block -->
    &lt;BlockTopology>TriangleMesh&lt;/BlockTopology> &lt;!-- Use TriangleMesh (unless you want to make new deformable armor) -->
    &lt;Size x="1" y="1" z="1" /> &lt;!-- Size in blocks is 1x1x1 (just one block) -->
    &lt;ModelOffset x="0" y="0" z="0" />
    &lt;Model>Models\Sphere&lt;/Model> &lt;!-- Model path -->
    &lt;Component Subtype="InteriorPlate" Count="12" />
    &lt;Component Subtype="Construction" Count="8" />
    &lt;Component Subtype="SmallTube" Count="4" />
    &lt;CriticalComponent Subtype="Construction" Index="0" />

    Models must be in directory "Models" otherwise game would not load it
    Definitions must be in directory "Data", otherwise game would not load it
    I've uploaded mod to workshop: http://steamcommunity.com/sharedfiles/filedetails/?id=294468758

    Content modification:
    See directory "Content/Data" inside game dir, there's all game data definitions.
    Including cube blocks, character models, blueprints, environmental settings (skybox and sun settings) and many other things.
    Many of these definitions require additional files, like textures and models.
    These paths must be specified relative to mod directory or content directory.

    E.g. file "Textures\BackgroundCube\Final\MilkyWay" from SkyboxMilkyWay mod
    will be search there:

    note: ".dds" extension is automatically added for textures

    In mod, you can reference only files from current mod and original content, one mod cannot use files of different mod!
    Game won't load textures and models from mod, unless there's some definition file in mod referencing it

    E.g. when mod contains only this file "Textures\BackgroundCube\Final\BackgroundCube.dds" (same file name as original skybox)
    Game won't load it. You have to add Environment.sbc and put the path here.

    Content handling in game:
    Game first loads original content
    Then first mod is loaded which can add new stuff or overwrite original content (or even disable)
    Then second mod is loaded which can add new stuff or overwrite original content or content from first mod

    In original content, there's cube block definition with TypeId "Drill" and SubtypeId "LargeBlockDrill".
    When mod defines cube block with TypeId "Drill" and SubtypeId "LargeBlockDrill", it will overwrite original block</div>When mod defines cube block with TypeId "Drill" and SubtypeId "LargeCrazyDrill", it will add new type of drill
    When mod wants to disable this drill, it should add this definition:

    <div> &lt;Definition xsi:type="MyObjectBuilder_ShipDrillDefinition">

    Note: I add more info and mod guides into this post

    Edit: 2014/08/21
    Update what's officially supported for modding and what not</div>
  2. Zaragoss Member

    For all modders of the future

  3. Shaostoul Senior Engineer

    For all people wanting to learn modding, I started a tutorial series on my modding thread.

    Here's the specific post where I'll link the videos so you don't have to look at latest posts:
    • Like Like x 1
  4. soat7ch Junior Engineer

    Good stuff, thanks.
    If i have time to soon, i really want to try working on RedPhoenix' old Cannons he doesn't want anymore.
  5. Shaostoul Senior Engineer

    It's not that he doesn't want them, it's that he doesn't possess the time or possibly knowledge of how to get them in game.
  6. RedPhoenix Moderator

    I'm missing the the time reworking them :p
  7. Shaostoul Senior Engineer

    And there's your answer.
  8. soat7ch Junior Engineer

    I might have misformulated that. It should have been a 'which he doesn't work on anymore and gave permission to reuse in his thread.
    Never meant to negate anybodys work.
  9. eobando Trainee Engineer

    Great thread on Modding, thanks!!
  10. jampakdd Trainee Engineer

    Hello every one! if you want to see a 1080p video tutorial check it out on my channel! I have 3 videos so far teaching you how to set up, make a block, and upload it to the steam workshop! Hope you enjoy, got a suggestion for a mod? Awesome msg me on youtube or leave a comment! Ill be sure to get to it as soon as possible.

    Video 1: https://www.youtube.com/watch?v=I2tQXvlLNCY&amp;list=UU1NxJQQRg_HiwNOMGjGuDIw
  11. Javin007 Trainee Engineer

    Good tutorial, but I need the final step.

    HOW do you "publish" your mod to the workshop? Can't seem to find anything anywhere on how to even get started.

    Edit: I found it! For those that find this in the future, it's not particularly intuitive:

    You need to first open Space Engineers, and go to "Load World"
    Select any world, it doesn't matter, but DON'T load it.
    Then go to "Edit Settings"
    Then go to "Mods"
    From there, select the mod you want to upload to the Steam Workshop, and click "Publish."
    Last edited by a moderator: Jan 15, 2015
  12. CyberVic Apprentice Engineer

    Thank you for this. I had to learn this the hardway about a week ago when I first started getting into modding. This thread would have saved me some odd conversations via the skype group.
  13. Dr. Novikov Apprentice Engineer

    How do I change logic of a vanilla block? For example, I want to change the behavior (glow, default broadcasting radius) of a vanilla beacon, which is written in MyBeacon.cs
  14. Sergii Andreiev Trainee Engineer

    is there any way to get havoc tools? They are stopped official support(
  15. Fus Apprentice Engineer

    Delete this entire thread, it is so outdated.
  16. Braxbro_ Trainee Engineer

    Fus, it's not so outdated for simple mod errors (like excluding Data folders and the like)
Thread Status:
This last post in this thread was made more than 31 days old.