1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Example: Adding new model

Discussion in 'Modding Guides and Tools' started by Ondrej.Petrzilka, Nov 1, 2013.

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

    Ondrej.Petrzilka Developer

    Messages:
    297
    Screenshots:
    https://steamcommunity.com/sharedfiles/filedetails/?id=191110060
    https://steamcommunity.com/sharedfiles/filedetails/?id=191110153
    https://steamcommunity.com/sharedfiles/filedetails/?id=191110234

    1) Open SpaceEngineers\Content\Data\CubeBlocks.sbc
    2) Add this almost to beginning of file:

    <Definition>
    <Id>
    <TypeId>CubeBlock</TypeId>
    <SubtypeId>HumanTestBlock</SubtypeId>
    </Id>
    <DisplayName>HumanTestBlock</DisplayName>
    <Icon>Textures\GUI\Icons\Cubes\HumanTest</Icon>
    <CubeSize>Large</CubeSize>
    <BlockTopology>TriangleMesh</BlockTopology>
    <Size>
    <X>1</X>
    <Y>1</Y>
    <Z>1</Z>
    </Size>
    <ModelOffset>
    <X>0</X>
    <Y>0</Y>
    <Z>0</Z>
    </ModelOffset>
    <Model>Models\human</Model>
    <Components>
    <Component Subtype="Construction" Count="8" />
    <Component Subtype="InteriorPlate" Count="12" />
    <Component Subtype="SmallTube" Count="4" />
    </Components>
    <CriticalComponent Subtype="Construction" Index="0" />
    <MountPoints>
    <MountPoint Side="Top" StartX="0" StartY="0.8" EndX="1" EndY="1" />
    <MountPoint Side="Bottom" StartX="0" StartY="0" EndX="1" EndY="0.2" />
    <MountPoint Side="Left" StartX="0" StartY="0" EndX="0.2" EndY="1" />
    <MountPoint Side="Right" StartX="0.8" StartY="0" EndX="1" EndY="1" />
    </MountPoints>
    <PhysicsOption>Box</PhysicsOption>
    <BuildProgressModels />
    <BlockPairName>HumanTest</BlockPairName>
    <ExcludedAreaForCamera />
    <CenterOffset xsi:nil="true" />
    </Definition>

    3) Add this almost to end of file:

    <BlockPosition>
    <Name>HumanTestBlock</Name>
    <Position>
    <X>7</X>
    <Y>2</Y>
    </Position>
    </BlockPosition>

    4) Create icon: SpaceEngineers\Content\Textures\GUI\Icons\Cubes\humantest.dds
    5) Add model: SpaceEngineers\Content\Models\human.mwm

    The most tricky part is step 3), make sure there's empty space in "Toolbar Config" screen on that position, {7,2} in this case, otherwise weird things may happen (this will be fixed after next update)
    To create mwm model, export from 3dsMax/Maya as FBX, then use MwmBuilder, more info here:
    https://www.spaceengineersgame.com/modding.html
     
    • Like Like x 1
  2. RedPhoenix

    RedPhoenix Moderator

    Messages:
    817
    Thanks Ondrej! You are awesome!
     
  3. CommanderHerpDerp

    CommanderHerpDerp Trainee Engineer

    Messages:
    98
    Life saver <3
     
  4. DrVagax

    DrVagax Administrator

    Messages:
    822
    And so the great modding factory started to roll.
     
  5. Nomad1

    Nomad1 Trainee Engineer

    Messages:
    3
    Thank you for posting this.
     
  6. Mishka

    Mishka Junior Engineer

    Messages:
    862
    Is it possible to add a model that is more than 1 block size? ie a circle that in total is 3x3 high/wide but only 1 "thick?" bit like how the steps/ramp arent only one block
     
  7. Ondrej.Petrzilka

    Ondrej.Petrzilka Developer

    Messages:
    297
    Sure, all it takes is to change <Size> tag.
    You can open CubeBlocks.sbc and find known blocks to see the possibilities.
    This is stairs:

    <Definition>
    <Id>
    <TypeId>CubeBlock</TypeId>
    <SubtypeId>LargeStairs</SubtypeId>
    </Id>
    <DisplayName>Stairs</DisplayName>
    <Icon>Textures\GUI\Icons\Cubes\stairs</Icon>
    <CubeSize>Large</CubeSize>
    <BlockTopology>TriangleMesh</BlockTopology>
    <Size>
    <X>1</X>
    <Y>1</Y>
    <Z>2</Z>
    </Size>
    <!-- boring stuff -->
    </Definition>
     
  8. W-S-Y

    W-S-Y Trainee Engineer

    Messages:
    36
    Wow the code is surprisingly straight forward.
     
  9. scragnog

    scragnog Trainee Engineer

    Messages:
    17
    Thanks a lot for this guide! The process works perfectly!
    My first attempts at importing a new Captains Chair block! (I'm a massive Star Trek TNG fan, I'm hoping to build a model pack based on assets from there)
    [​IMG][​IMG]
     
  10. Ondrej.Petrzilka

    Ondrej.Petrzilka Developer

    Messages:
    297
  11. scragnog

    scragnog Trainee Engineer

    Messages:
    17
    Aah this is exciting stuff! The import process makes it so straightforward to modify things like scale and diffuse color straight from the xml. I love it!

    Got 4 models ingame now, all just using a grey diffuse map until I can get to grips with the texture import process, sure it'll be straightforward.
    [​IMG]
     
  12. TokeCity

    TokeCity Trainee Engineer

    Messages:
    11
    I love SE i've been waiting for this :D
     
  13. Balmung

    Balmung Senior Engineer

    Messages:
    1,947
    Nice, the only problem is, that because all is so blocky too detailed Objects could seems wrong in place. But beside that, it looks great. :)
     
  14. Johnboy

    Johnboy Trainee Engineer

    Messages:
    25
    I have a quick question about sbc/sbs files.

    Is there any way to add comments? It'd be helpful for keeping organized.
     
  15. johncage

    johncage Trainee Engineer

    Messages:
    56
    nice. also, i recognize the outline and pose as the bioreign pilot model from bionic commando.

    wonder if we get custom player models next.
     
  16. johncage

    johncage Trainee Engineer

    Messages:
    56
    best case scenario: complete overhaul mod with detailed blocks.
     
  17. Suge

    Suge Trainee Engineer

    Messages:
    35
    Textures must be saved as .dds and compressed as DXT5


    Naming Format:

    <Material Name>_de.dds <-------Must be applied to model in 3d app before export
    <Material Name>_ns.dds

    Example: CaptainsChair_de.dds
    CaptainsChair_ns.dds

    de=Diffuse/Emissive <------------Diffuse = RGB and the Emissive goes in the alpha channel
    ns=Normal/Specular <----------- Normal = RGB and the Specular goes in the alpha channel.

    Textures must be named accordingly FIRST and THEN the de (diffuse/emissive) applied to your model in your 3d app. THEN exported to FBX.
    Our little team is still having problems getting emissive glow to work.
     
  18. Balmung

    Balmung Senior Engineer

    Messages:
    1,947
    Sure, but than it's the Question what is possible, where are the Limits, for Example how much different Blocks could SE use. At the Moment you have not much Space in the "G"-Menu to add many new Blocks.
     
  19. Suge

    Suge Trainee Engineer

    Messages:
    35
    Was wondering that myself.

    However, being there are so few remaining menu slots, it wont take long to figure out whether the menu will have a scroll bar or additional pages and generate new space as needed. If not I'm sure that capability will be added soon.

    The devs have been very supportive and accommodating of the mod community thus far. More than I would have expected. I'm sure we could just ask them to implement that as soon as they are able (if not already possible) and they would be happy to do it.
     
  20. scragnog

    scragnog Trainee Engineer

    Messages:
    17
    Thanks Suge! That does seem straightforward! I'll get on it asap and try and get the models all nice and textured. Plus the emissive capability will be great for having lights within the models. love this engine already!
     
  21. Stew2000

    Stew2000 Trainee Engineer

    Messages:
    20
    Thanks for the short tutorial.
    This was a quick test, but yay for simple modding. Now I gotta figure out how to refine it.
    [​IMG]
     
  22. Balmung

    Balmung Senior Engineer

    Messages:
    1,947
    For the Moment I give it up, didn't get my Object, that was only a modified Object from SE, to work (I can't see the Icon in SE). Don't know why, could be the Object or anything else.

    Edit: I think I made something wrong when I export the Model to FBX in Blender, but I don't know what. Is there something important to know?
     
  23. Stew2000

    Stew2000 Trainee Engineer

    Messages:
    20
    Any ideas why my models are black? I've assigned them to use 'default_grey_de.png' like the standard ones.
    [​IMG]
    *** Edit ***
    Problem Solved..
    In .xml ' <Material Name="01 - Default"> ' Needs to be same as in Modelling Software.
    [​IMG]
     
  24. Balmung

    Balmung Senior Engineer

    Messages:
    1,947
    Nice one. ^^
     
  25. Evis

    Evis Apprentice Engineer

    Messages:
    240
    Some of us want to write plugins to make your models do things :)
     
  26. Bort

    Bort Trainee Engineer

    Messages:
    79
    I am not a developer of this specific software but very generally speaking, in any coding language, any type of file, you are usually able to add comments for organization or instructions for other people viewing the file using REM which are usually 2 slashes (//) in the beginning of the line, or in some languages REM is the pound (#) symbol. Try the slashes first.
    REM is an old school term for "commenting out" or "comment" "tags" (HTML) lines. It simply disables the code following the REM hash marks from being generated as code and/or displayed anywhere other then in the text file of the code it self. Whatever software engine is being used will skip lines that begin with the correct REM and move on to the next line.
    I've studied many languages in my time. I have yet to find a software language that doesn't include REMs. They're usually double slashes "//" in the beginning of the line.
    Example:
    This text would display or if this line were code it would be generated.
    // This line would be ignored by the software but visible in the text file.
     
  27. Bort

    Bort Trainee Engineer

    Messages:
    79
    I have a question. For those of us creating models and modding. When multiplayer is available, are our creations going to be visible for everyone?
    How's that going to work?
    - Will we have to download and install player created model and texture packs?
    - Will they just automatically be downloaded so they display? (Security risk, long load times)
    - Will they only be available for single player games?

    - Or...how?
     
  28. Balmung

    Balmung Senior Engineer

    Messages:
    1,947
    Good Question, I like the Minecraft way: the Option at the Server you must have a specific one and you can download it from the Server. Install your own Pack is impossible because of the Player created Models. Good, it is possible, but unnecessary complicated.

    I think only Single Player is a thing that will not happen. But pretty sure we need after all the Custom Models to get on a Server with this Custom Models.
     
  29. Ondrej.Petrzilka

    Ondrej.Petrzilka Developer

    Messages:
    297
  30. Ondrej.Petrzilka

    Ondrej.Petrzilka Developer

    Messages:
    297
    We're considering to make MODs part of Steam workshop. When server is started with some MODs, other players must have it too (it may automatically download from steam of ask user...).
    What do you think?
     
Thread Status:
This last post in this thread was made more than 31 days old.