Modding Help ISO drawables guides or examples

Discussion in 'Starbound Modding' started by IHart, Dec 6, 2016.

  1. IHart

    IHart Scruffy Nerf-Herder

    I have no clue how they work and my google attempts have turned up little of help.
    TIA
     
  2. Errors4l

    Errors4l Spaceman Spiff

    What type of drawables are we speaking of? Inventory icon, active item parts, multiplayer compatible custom sprites? All of these are implemented differently.
     
    IHart likes this.
  3. IHart

    IHart Scruffy Nerf-Herder

    I had no idea, that's awesome. Inventory icons is my focus right now. The others could still be useful if we have resources for them as well.
     
  4. Errors4l

    Errors4l Spaceman Spiff

    I suggest taking a look at the results generated by my Drawables Generator. You should be able to understand the format by looking at the output. Inventory icons are supported by the tool as of v1.2.

    For single player, it's probably best not to use the generated drawables (with directives), but instead to just use images from your mod.

    https://github.com/Silverfeelin/Starbound-DrawablesGenerator/releases

    You might also want to take a look at the wiki page on directives. http://starbounder.org/Modding:Image_Processing_Directives

    If you have any questions (or aren't on Windows), let me know.
     
    IHart likes this.
  5. IHart

    IHart Scruffy Nerf-Herder

    Thanks so much, am on linux and my wine is broken, but will see what i can do.
     
  6. Chofranc

    Chofranc Pangalactic Porcupine

    for activeitems you can use this
    activeItem.setInventoryIcon("image route")

    example: activeItem.setInventoryIcon("/items/active/weapons/melee/shortsword/customshortsword/icon.png?replace;ba1b01=b2bb00;dc1f00=d2dc00;f32200=e8f300;ff492b;f5ff2b")

    You can add directives to the route too.
     
  7. IHart

    IHart Scruffy Nerf-Herder

    i pulled out my old windows machine and got it working to set up some examples but, i am still clueless. Instead i'm just going to share the project applications i need it for.

    PROJECT A ) for the inventory I need to apply a change (offset) to weapon parts icon independent of the other parts while still utilizing the default weapon builder.
    project: https://github.com/IsaacHart/sbmod-psarm
    example file: https://github.com/IsaacHart/sbmod-...eapons/melee/shortspear/shortspear.activeitem

    PROJECT B ) for active-item (works for inventory icon) getting the standard format for weapon color swaps to work for randomly generated fists, which utilize frames. (includes dirty custom builder file, which definitely also needs work)
    project: https://github.com/IsaacHart/sbmod-fwarm
    example file: https://github.com/IsaacHart/sbmod-...active/weapons/melee/fist/commonfw.activeitem

    PROJECT B part 2 ) NOT A DRAWABLE ISSUE BUT im also trying to get the finishers of these fist weapons to select randomly from a list akin to altAbilities on two-handers.

    This is the wall i am at with each of these projects, so without help i'd be giving up on them for now.

    edit: PROJECT B, not :cool:
     
  8. Errors4l

    Errors4l Spaceman Spiff

    My apologies. People on servers often use the term drawables to describe multiplayer compatible images. For your problems my tool will do you no good, so it's best to just ignore that.

    A. I don't think the build script supports adjusted offsets. The code seems to point at (hardcoded?) offsets for gun parts, and static positions for melee weapon parts.

    As you can see in the code below (with other bits of code stripped so you see only the code related to the offsets I could find), no configurable variables are used in the position for generated inventory icons. These offsets also only apply for guns. The melee weapon parts are all rendered at the same position, but the reason weapons still look 'right' is because the weapon textures actually have a bunch of filler space in the images.
    EG. Hilts only cover the bottom part of a texture, and blades cover the top half of a texture. Stacking the two on top of each other makes the pieces 'fit' together.

    As your weapons are generated, you can't hardcode the inventory icon, so you can't manually set the position. As far as I know, activeItem.setInventoryIcon only supports one image path, so that also wouldn't be a viable option to display your inventory icon.

    Although there may be a way to accomplish what you're trying to achieve, I do not know of it.
    [​IMG]
     
  9. IHart

    IHart Scruffy Nerf-Herder

    Looks like i'm back to learning how to LUA :), thanks for the responses i super appreciate it.
     
  10. Pint

    Pint Space Spelunker

    no.

    Lua
     
  11. IHart

    IHart Scruffy Nerf-Herder

    LUA!?
     
  12. IHart

    IHart Scruffy Nerf-Herder

    After studying your drawables I figured out a solution to project A without changing any Lua, it's gorgeous.
     
  13. Errors4l

    Errors4l Spaceman Spiff

    Please do share, maybe I and some others will learn from it :).
     
  14. IHart

    IHart Scruffy Nerf-Herder

    Code:
    "builder" : "/items/buildscripts/buildweapon.lua",
    "builderConfig" : [{
    "nameGenerator" : "/items/active/weapons/melee/spear/spearnames.config:nameGen",
    "animationParts" : {
    "blade" : {
    "path" : "/items/active/weapons/melee/spear/blade/<variant>.png?crop=0;24;24;64",
    "variants" : 50,
    "paletteSwap" : true
    },
    "handle" : {
    "path" : "/items/active/weapons/melee/hammer/handle/<variant>.png?flipx",
    "variants" : 54,
    "paletteSwap" : true
    }
    },
    "palette" : "/items/active/weapons/colors/melee.weaponcolors",
    "iconDrawables" : [ "handle", "blade" ]
    }]
    i applied the directive directly to the path.

    https://github.com/IsaacHart/sbmod-...eapons/melee/shortspear/shortspear.activeitem

    NOTES: Cropping and centering created the offset but did not offset by the exact amount expected (half of the pixels cropped) so the values i ended up choosing were based on a couple of test spawns.
    This resulted in an inventory icon AND activeitem without having to do anything else to the animation files or any Lua scripts.
     
    Errors4l likes this.
  15. IHart

    IHart Scruffy Nerf-Herder

    i found a solution to reliably extend the offset beyond the image bounds (and theoretically infinitely) and still get the proper icon and activeitem
    observe halberd (https://github.com/IsaacHart/sbmod-...tive/weapons/melee/halberd/halberd.activeitem)
    Code:
    "builder" : "/items/buildscripts/buildweapon.lua",
    "builderConfig" : [{
    // "nameGenerator" : "/items/active/weapons/melee/axe/axenames.config:nameGen",
    "animationParts" : {
    "blade" : {
    "path" : "/items/active/weapons/melee/partisan/mask.png?blendmult=/items/active/weapons/melee/axe/blade/<variant>.png;0;-84?blendmult=/items/active/weapons/melee/partisan/masktrans.png;0;116?blendmult=/items/active/weapons/melee/partisan/masktrans.png;0;-148",
    "variants" : 59,
    "paletteSwap" : true
    },
    "handle" : {
    "path" : "/items/active/weapons/melee/spear/handle/<variant>.png",
    "variants" : 50,
    "paletteSwap" : true
    }
    },
    "altAbilities" : [
    "flurry",
    "spearspin"
    ],
    "palette" : "/items/active/weapons/colors/melee.weaponcolors",
    "iconDrawables" : [ "handle", "blade" ]
    }]
    to achieve this i added a fully opaque mask and a fully transparent mask, each size 24x200

    I published this new fix along with some of my other weapon experiments to the latest release of grand armory showcase: community.playstarbound.com/resources/4363/
     

Share This Page