Modding Help How to change interface to show weapon type for crafted weapons?

Discussion in 'Starbound Modding' started by Innis, Dec 28, 2013.

  1. Innis

    Innis Orbital Explorer

    You know how it says "bonehammer" in grey under the weapon name here?

    [​IMG]

    I want to change it so that a crafted weapon might say, for example, "Shortsword" there.

    I'm willing to go through and change all of the crafted weapons individually to include whatever needed field, but just going through and adding "name" : "Shortsword", does nothing, and likewise adding "category" : "Shortsword", (like craftable objects have) does nothing, and "kind" : "Shortsword", is already in all the craftable shortswords, and those are the only three fields I can think of that it might help to add.

    I've looked at changing the interface, too, I've looked at all the files in assets/interface/itemdescription, and... well, nothing I've tried to change ends up having the effect I want. I'm stumped. I got nothing.

    Any help you have would be appreciated so much.
     
  2. Litterbox

    Litterbox Void-Bound Voyager

    I'm pretty sure that's defined via category. Try adding:

    Code:
    "category" : "Shortsword"
     
  3. Innis

    Innis Orbital Explorer

    That's what I figured! But unfortunately it doesn't work. Adding "category" to a craftable weapon has no visible effect.

    That is definitely the field that object-type items use to determine it--changing a tier-one light object's category to "Shortsword" works perfectly fine, for instance! But on a sword, no dice.

    At this point you're probably figuring that it's a difference between the way sword item descriptions and object item descriptions read the data in the .object or .sword files, right? That's what I thought! But if it is, it's not in any place I've managed to find. As far as I can tell, the only thing in assets that refers to / defines that part of the item description window is in object.itemdescription:

    Code:
      "subTitle" : {
        "type" : "label",
        "position" : [35, 171],
        "hAnchor" : "left",
        "color" : [176, 162, 152],
        "value" : ""
        },
    I would add that to sword.itemdescription, but it is already there, identical, in exactly the same place. It just doesn't work on the craftable weapons.

    (On randomly generated weapons, it appears to read from either "name" : "Whatever", or "kind" : "Whatever", but adding the former to a non-random weapon does nothing, and the latter field is already there just like that on every craftable .sword!)

    I'm baffled.
     
  4. Litterbox

    Litterbox Void-Bound Voyager

    Yeah. I feel like a dummy now. I see that you actually already said that category was something you had tried. I even double-checked before posting it as a possible solution and still missed it, somehow.

    I think I've read that not everything is exposed to modders currently, however. Is it possible that this is something that's not controlled via the files we're given access to, but something behind the scenes that's interpreting these mod-friendly files? Possibly during the stage when these random items are rolled?
     
  5. Hexagon5

    Hexagon5 Big Damn Hero

    Try this:
    Code:
    "kind" : "Shortsword"
    Maybe that'll give you the desired effect?
     
  6. HalcyonXIII

    HalcyonXIII Big Damn Hero

    There is a way to make it work, as a workaround at least. You can change the name of the "subTitle" object in the *.itemdescription file to something else, such as "subtitle".

    This might break random weapons though, so you would need to keep a separate copy of the *.itemdescription files, one for craftables and one for the random weapons.
     
  7. Innis

    Innis Orbital Explorer

    It's already there, looking just like that! All of the craftable weapons have that field filled out.

    That... doesn't actually do anything, though, does it? Unless you're suggesting I change that object's name to something specific that isn't "subtitle", in which case, what?
     
  8. HalcyonXIII

    HalcyonXIII Big Damn Hero

    It works. I was suggesting you change the name of the object called "subTitle" in the *.itemdescription file, to anything but "subTitle", and then set your desired sub-title text in the object's "value" variable. For example, in the sword.itemdescription file, you could replace the following:
    Code:
      "subTitle" : {
      "type" : "label",
      "position" : [35, 171],
      "hAnchor" : "left",
      "color" : [176, 162, 152],
      "value" : ""
      },
    
    with:
    Code:
      "subtitle" : {
      "type" : "label",
      "position" : [35, 171],
      "hAnchor" : "left",
      "color" : [176, 162, 152],
      "value" : "Shortsword"
      },
    
    This way, "value" will no longer be overridden by the default value (an empty string) of the corresponding variable (see the next paragraph) in the weapon file.

    Anyway, you can just forget what I suggested. I finally figured out the correct variable to set in the weapon item files. It is "weaponType".

    Code:
    ...
      "itemName" : "humantier1broadsword",
      "level" : 1,
      "dropCollision" : [-4.0, -3.0, 4.0, 3.0],
      "maxStack" : 1,
      "rarity" : "uncommon",
      "description" : "Regular Broadsword. A normal, unremarkable broadsword.",
      "shortdescription" : "Regular Broadsword",
      "inspectionKind" : "sword",
      "kind" : "Broadsword",
      "weaponType" : "Hello World",
    ...
    
    sb_weaponType_subtitle.png
     
    Innis and Nightmares like this.
  9. Innis

    Innis Orbital Explorer

    Oh, I see now.

    THANK YOU SO MUCH

    YOU'RE A STAR

    I've now used that bit of knowledge to make this little fix.

    (It'll also be a super handy little quality-of-life thing for the other mod I'm working on, which'll add seven craftable firearms for every race and tier to match the melee weapons. You can see how it will be nice to be able to be sure what type of gun a given firearm is at a glance.)
     
  10. Pyroxenite

    Pyroxenite Void-Bound Voyager

    Could we change the color of the weaponry?
     

Share This Page