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

[GUIDE] Shaostoul's Modding Guide & More

Discussion in 'Modding Guides and Tools' started by Shaostoul, Jun 19, 2017.

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

    Shaostoul Senior Engineer

    Expanding Your Universe
    and helping you learn how to do so too!

    Steam Workshop link to all my mods!

    Feel free to contact me with any comments, questions, suggestions, ideas, concerns, etc!

    Discord: Shaostoul#1658

    Want to show your support for my tutorials and mods?

    Patreon or Paypal

    Tutorial Videos
    Tutorial - Setup v3
    Tutorial - Gyroscope (deprecated)
    Tutorial - Rocket Turret


    Tips, Tricks, & Info
    Important Links

    You may be asking yourself, "What are all these different textures and what do they do?" well, look no further! I hope to explain in a simple sort of fashion what the different textures actually are.

    The following available textures types are CM, NG, ADD, and ALPHAMASK. When you're assigning textures to your model, make sure you always have the CM, NG, and ADD textures assigned; if you don't, your model will most likely experience some sort of display error and not look how you actually want it to.

    Textures need to be made in the power of 2 in terms of dimensions, meaning that your texture should be something along the lines of 256x256, 512x512, 1024x1024, 2048x2048, and so forth. It is also advisable that you work with one texture size, meaning if a model is made up of multiple textures and one of the textures is 2048x2048, all of the textures assigned to that model should be 2048x2048.

    If your model is magenta/pink, then you've messed up in the assigning process and your model can't find your textures. This should be a simple error in the file path or the file name, double-check where they're supposed to be and what they're supposed to be named and you should resolve your issue.

    CM: Color/Metalness
    Red, Green, Blue: Color is exactly what it sounds like; this is the color you see in-game, on the block; it is what gives your texture all of its pretty colors. The color here directly corresponds to colors you see in-game, minus extra effects like Metalness or Gloss. If your model is going to be recolorable, it is suggested the section that is recolorable be in Gray-scale or Black & White.

    Alpha: Metalness is kind of weird, as it produces some varied results. Typically you'll use black for non-metals like stone and wood, and white for metals. However, you can mess extensively with this to get things to look just right. Some metals, alloys, or plastic may even use some variant of gray to achieve their effect.

    NG: Normal/Gloss
    Red, Green, Blue: Normal is sort of like 'imaginary' mesh. A normal map can make sections of mesh appear raised or indented without actually physically affecting the mesh. A well done normal map can save a lot of polygon count when adding find details, such as a gash in metal, rivets, or raised lettering. The vanilla armor is a very good example of a well made normal mesh.

    Alpha: Gloss is pretty much how it sounds, you take a matte or flat paint job, slap some clear coat paint on there and now your paint is nice and shiny, like a brand new car! A really high gloss level is even reflective and can add some awesome effects, just be careful to not over do it. You could use high gloss/low metalness for stuff such as plastics and high gloss/high metalness for something like chrome.

    ADD: Additive
    Red: Ambient Occlusion is in gray-scale, since it is only one layer and is essentially artificial shadows. It can add a lot of fine detail to an object, such as shadows around keyboard keys, shading around a persons eyes/nose, and shadow to crevices that shouldn't be bright lit. This texture should by default be WHITE if you're not messing with it, if it is BLACK you will most likely have a very dark model in game.
    Green: Emissiveness is in gray-scale, since it is only one layer and will add a glow effect to your texture. This glow effect will not actually illuminate stuff around it. The usual purpose of the emissive layer is to add glow to terminal screens or light bars indicating whether a block is running or not. This can range from BLACK with no emissiveness, to WHITE with a very bright glow. I personally suggest around 50% gray for something that's not too harsh on the eyes in dark environments.
    Blue: Is not used
    Alpha: Recolorability
    is in gray-scale, since it is only one layer and will determine what is recolorable. It is suggested to pair recolorability with a gray-scale section of the CM. If the texture is BLACK, there is no recolorability. If the texture is WHITE, it has full recolorability. If it is GRAY, instead of being red, your recolored section will most likely appear more of a light pink.

    ALPHAMASK: Alpha masked
    Red, Green, Blue: Alphamask is gray-scale but, it uses all 3 layers of RGB, instead of just one, like the ADD texture, and this texture is a way of adding details to objects and hiding mesh, without it being a transparent material similar to that of glass. Whatever section of the texture is BLACK is transparent and whatever section is WHITE is opaque. You can fade sections using transitional gray areas. Alphamask would primarily be used to add decals, such as lettering, rivets, or icons to blocks OR it could be used to design foliage, such as leaves and grass. In my experience you do not want to generate mipmaps when saving an alphamask texture as the details will quickly fade away from LOD changing handled at the texture level, instead of the block level.
    Alpha: Is not used

    If you'd like to view the KeenSWH official documentation on textures go here.

    Important Information
    (regarding specific TypeID's)

    It'd appear that if you use anything other than <ModelOffset x="0" y="0" z="0" /> in the CubeBlocks.sbc, your turret with shoot in an offset direction of the thing it is shooting at while it is using AI to aim, if you control the turret, it will shoot properly. So, for example, if your ModelOffset Y=-5, your turret will most likely shoot about that same distance above the block you're aiming at, since "y" is up/down.

    Example Files

    TransparentMaterials.SBC with notes
    Here's the file
    With the recent changes to the way Transparent Materials behave, I put together this SBC to hopefully allow modders to fix their mods to look how they should. In this example SBC you'll find everything setup with notes explaining what is what, as well as the values set to allow for a force field like effect similar to that of my force field mod here.

    Example - Rocket Turret.zip for reference and tutorial
    Here's the file
    Turrets in general a bit of an advanced block to learn how to create; with this tutorial and the zip file provided here, I can hopefully make the process a lot easier for you to learn.

    Empty names, rotation, and location is vital to having a turret look and function properly.

    Empty rotation for the subpart mostly just dictates how the ghost model looks when you're going to place the block, if this orientation is wrong the player might accidentally place a turret facing the wrong way. The names are vitally important and can not have their names changed, if they are different, they will not function how you want them.

    If parts of the turret aren't where they're supposed to be, this is an indication that your origin points of the models are off OR the empties locations are off. The origin point of the subpart is the pivot point. The origin point of the subpart must align with the empty of the previous part in order to be properly placed.

    GatlingTurret.blend for proper gatling turret orientation
    Here's the file
    (It'll be a little bit before I get this one added)

    Rotors Change
    Rotors now have additional code that separates the large grid rotor heads from the small grid rotor heads. It is as follows:

    The selection you make depends on the
    <CubeSize>Large</CubeSize> or <CubeSize>Small</CubeSize>

    For a <CubeSize>Large</CubeSize> rotor head, you use:

    For a <CubeSize>Small</CubeSize> rotor head, you use:

    This distinction is for the difference between having a large grid rotor base with a small grid rotor head on top of it or a small grid rotor base with a large grid rotor head on it. This allows you to fine tune placement so things look appropriate.
    Last edited: Mar 16, 2018
    • Like Like x 1
Thread Status:
This last post in this thread was made more than 31 days old.