Modding Help stationary bone blocks

Discussion in 'Starbound Modding' started by Vuldreg, Jan 28, 2016.

  1. Vuldreg

    Vuldreg Cosmic Narwhal

    Since bone blocks had been changed to be affected by gravity i have little use for them other then back walling and flooring, If possible I'd like it so i could craft a stationary version from the normal ones so that i could make use of both the gravity affected and stationary bone blocks.
     
  2. lazarus78

    lazarus78 The Waste of Time

    Blocks require the use of a block ID, which are in limited supply. (~65,000, but still) so I don't really think someone would be keen on making a new block with a new ID which could interfear with someone else's mod.

    Removing the gravity effect, however, would be trivial.
     
  3. Vuldreg

    Vuldreg Cosmic Narwhal

    I don't know how to mod blocks, So unless you could help me find out how then i need some one who can mod the block for me.
     
  4. Monijir

    Monijir Scruffy Nerf-Herder

    Here's how to do it and what you get. I started this thinking it would make a decent tutorial since it's a starting point for modding. In reality it might be more of a reflection of just how much work you're asking of modders when you make request for what seems like a simple mod. Anyhow it's a set of instructions for doing this thing what you want strangers to do for you:

    Open up /tiles/materials/bonematerial.material. You'll get this, but without my comments

    Code:
    {
    
    //CHANGE THIS NUMBER TO SOMETHING ELSE
      "materialId" : 129,
    
    //GIVE IT ANOTHER NAME
    "materialName" : "bonematerial",
      "particleColor" : [231, 223, 189, 255],
    
      "itemDrop" : "bonematerial",
      "description" : "A collection of bones tightly packed together.",
      "shortdescription" : "Packed Bones",
      "glitchDescription" : "Horrified. Bones from a variety of sources packed together.",
      "floranDescription" : "Bonesss!",
      "novakidDescription" : "Bunch of bones. Who needs 'em!",
      "footstepSound" : "/sfx/blocks/footstep_bone.ogg",
    
    //CHANGE THIS TO FALSE
      "falling" : true,
    //CHANGE THIS TO FALSE
      "cascading" : true,
      "health" : 4,
      "category": "materials",
    
      "renderTemplate" : "/tiles/classicmaterialtemplate.config",
      "renderParameters" : {
        "texture" : "bonematerial.png",
        "variants" : 5,
        "lightTransparent" : false,
        "multiColored" : false,
        "occludesBelow" : true,
        "zLevel" : 3940
      }
    }
    
    
    Just do what the comments say

    Here's a file with the changes all ready made.

    Now we can put the file here
    Code:
    Starbound/assets/user/tiles/materials/
    
    And start up starbound. To test if it's working you can spawn it with :

    Code:
    /admin
    /spawnitem sturdybonematerial
    
    Oh, that totally won't work come to think of it. We need to have materials and the materials item. I think those are in /items/materials/. Sure enough there's a file there called bonematerial.matitem. We'll just pop in and make the changes to whatever obviously needs to be changed.

    Code:
    {
    
    //GOTTA CHANGE THIS
      "itemName" : "bonematerial",
      "price" : 0,
      "rarity" : "Common",
      "inventoryIcon" : "bonematerial.png",
      "description" : "Polished bone made into a building material.",
    
    //THIS IS THE NAME WE SEE IN THE INVENTORY  SHOULD CHANGE IT, BUT WHATEVER MAN
      "shortdescription" : "Bone Block",
      "glitchdescription" : "Scared. This bone came from a huge creature.",
      "florandescription" : "Bonesss!",
      "novakidDescription" : "Bones. Who needs 'em!",
    
    //BETTER REMEMBER THE NUMBER WE USED BEFORE
      "materialId" : 129
    }
    
    
    Now we're going to save it in /items/materials as sturdybonematerial.matitem. Gotta keep it in the same directory 'cause reasons. It's also easier. Here's the edited file once again.

    Okay, gotta make it craftable. I've never done this before but I think we go to the /recipes/emptyhands folder to do this. I went there and opened up platform.recipe to get this (again comments are mine):

    Code:
    {
      "input" : [
        { "item" : "darkwoodmaterial", "count" : 1 }, //REMOVE THIS
        { "item" : "plantfibre", "count" : 1 }   //MAKE THIS THE REGULAR BONE BLOCK
      ],
      "output" : {
        "item" : "platform",//MAKE THIS THE SPECIAL BONE BLOCK
        "count" : 1
      },
      "groups" : [ "plain", "craftingfurniture", "materials", "all" ] //CHANGE THIS IF YOU WANT I GUESS WHATEVER MAN I'M NOT YOUR BOSS
    }
    
    
    So if we make those changes we'll get this file. I'm gonna save this file in /recipes/emptyhands/ with all its friends, but the emptyhands part is just for organizing. It doesn't say how to learn the recipe. For us we're going to do that by mutilating /player.config the file that lists all the recipes you start off with (among many other things.) Almost done, for real : next we're looking at the /player.config file. The file is huge but the part you care about is here, again my comments :

    Code:
      "defaultBlueprints" : {
        "tier1" : [
       //JUST ADD ONE AND MAKE IT LIKE THE OTHERS
          { "item" : "darkwoodmaterial" },
          { "item" : "logblock" },
          { "item" : "cabinroofing" },
    
    One more file. This one is a bit different because we're overwriting an existing file instead of creating a new one. This is totally something we should make a patch. Not just 'cause it could interfere with other mods but it'll totally break when the game has a big update. On the other hand, I don't feel like it.

    That lack of feelin' it extends to making this a proper modpak. Instead I'm zipping this mess up so you can merge it with you user folder. To be specific, extract this into Starbound/assets/ and load up the game. Here's the zip you'll need to do that. I tested it and everything is on the up and up. If you've been playing along at home and you find this doesn't work there's probably a misplaced comma somewhere, just touch up the file and try again.

    I guess the next step is making a proper .modpak file and turning the player.config into player.config.patch, but here's where I teach the secret of modding (also a great way to fit in) : always give up on your project when it's 90% done then fail to share it with the community. If you must, distract yourself by writing long winded and superfluous tutorials for simple mod requests.

    Okay, maybe I do feel like it, 'cause the forum posts that explains patching has an example that's like almost identical to what we need to patch player.config. And lo and behold I have comments again

    Code:
    [
    {"op":"add","path":"/defaultBlueprints/tier1/-",
    "value":
      {
    //GOTTA REPLACE TEST WITH OUR NEW RECIPE NAME
      "item":"test"
      }
    }
    ]
    
    That'll be our patch file. We name those by adding the .patch extension to whatever file we're modifying. So this time its /player.config.patch. Now we're gonna need a .modinfo file. This is the most complicated part get ready :

    Code:
    {
      "name" : "Sturdy Bone Blocks",
      "author" : "Ghost of James K Polk ooooh spooooooooky",
      "version" : "1.0"
    }
    
    Save it in the root directory of the asset source (next to player.config.patch) as sturdyblock.modinfo. You'll have to rename it pak.modinfo if you're going to put it in a proper modpak. The patch and modinfo file are in this zip . This one works as a mod if you just throw it in the mods folder. I prefer turning it into a .modpak 'cause it gives me an excuse to type commands in terminal and feel like a hacker in a 90s movie. You can run the asset_packer file to do this too. Just open up command line. (Windows key + R, then type CMD and hit enter). Then enter the following commands :

    Code:
    C:> something? I don't know not a windows guy
    C:> What did you think I'd go through this whole tutorial without being smug about linux?
    C:> Being smug is like 90% of the appeal of linux
    C:> we're like vegans driving hybrids but without the tangible benefits for society
    
    In truth you should just check out this post. I skipped the part where you ritualistically bash your head against a brick wall until you bleed trialing commas, that's another part of modding I guess. So here's the final mod.

    Yeah in an ideal world this post would be used to introduce people to modding, but at the very least I hope it demonstrates how much goes in to something you ask strangers to do. I mean I'm not complaining obviously I have a lot of time to kill I just wish people would say 'please' when making this sort of request, ya know?

    TLDR; Here's your bloody mod
     
    Amethystumn likes this.
  5. Vuldreg

    Vuldreg Cosmic Narwhal

    I've tried modding the game a few times and i can understand it's a pain, Most the things i tried ended up failing and then there is even times where files wont show up when i looked for them like the tiles/materials/bonematerial.material you said i need to open i entered a search for the file on my computer and nothing is showing up so it's likely stored in some manor that needs me to know the exact location of it in order to get it opened, But thank you for including the mod i was requesting.
     
  6. Monijir

    Monijir Scruffy Nerf-Herder

    Your welcome boss, I wasn't really sure how that post would be taken. I figured as long as you got the mod at the end you'd understand it wasn't meant to be mean-spirited.
     
  7. Mackinz

    Mackinz The Waste of Time

    That's because you haven't unpacked your assets. There on tutorials on doing this.
     

Share This Page