Modding Help [RESOLVED] Can't add race-exclusive item, tried everything

Discussion in 'Starbound Modding' started by Iaeyan Elyuex, Sep 7, 2017.

  1. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    All I'm trying to do is mod an "invisible slime gun" into my game so only slime people can craft it. I've looked all over the forums trying to find a solution. I've run all my files through a JSON validator. I even tried making a new character to check to see if it unlocks only with new characters. Nothing works.

    The .activeitem file

    {
    "itemName" : "castslime",
    "price" : 0,
    "inventoryIcon" : "slimeshot.png",
    "maxStack" : 1,
    "rarity" : "rare",
    "description" : "I cast Slime Puddle.",
    "shortdescription" : "Slime Shot",
    "level" : 3,
    "category" : "Inexplicable",
    "itemTags" : ["weapon","ranged","machinepistol"],
    "tooltipKind" : "gun2",
    "twoHanded" : false,
    "animation" : "/items/active/weapons/ranged/gun.animation",
    "animationParts" : {
    "butt" : "",
    "middle" : "invisigun.png",
    "barrel" : "",
    "muzzleFlash" : ""
    },
    "animationCustom" : {
    "sounds" : { "fire" : [ "/sfx/projectiles/goo_spit2.ogg" ] },
    "lights" : { "muzzleFlash" : {"color" : [118, 172, 141] } }
    },

    "baseOffset" : [0.0, 0.0],
    "muzzleOffset" : [0.0, 0.0],

    "scripts" : ["/items/active/weapons/ranged/gun.lua"],

    "elementalType" : "electric",

    "primaryAbility" : {
    "scripts" : ["/items/active/weapons/ranged/gunfire.lua"],
    "class" : "GunFire",
    "fireTime" : 0.156,
    "baseDps" : 2,
    "energyUsage" : 5,
    "fireType" : "auto",
    "inaccuracy" : 0.02,
    "projectileCount" : 1,
    "projectileType" : "squirtslime",
    "projectileParameters" : {
    "speed" : 32
    },
    "stances" : {
    "idle" : {
    "armRotation" : 0,
    "weaponRotation" : 0,
    "twoHanded" : false,

    "allowRotate" : true,
    "allowFlip" : true
    },
    "fire" : {
    "duration" : 0,
    "armRotation" : 0,
    "weaponRotation" : 0,
    "twoHanded" : false,

    "allowRotate" : false,
    "allowFlip" : false
    },
    "cooldown" : {
    "duration" : 0.0,
    "armRotation" : 0,
    "weaponRotation" : 0,
    "twoHanded" : false,

    "allowRotate" : false,
    "allowFlip" : false
    }
    }
    },

    "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }


    The recipe, to be crafted by hand and known by default by slime people

    {
    "input" : [
    { "item" : "money", "count" : 0 }
    ],
    "output" : { "item" : "castslime", "count" : 1 },
    "groups" : [ "plain", "ranged", "weapon", "all" ]
    }


    The file slimeperson.species.patch, taken from a forum post and slightly modified

    [
    {
    "op": "add",
    "path": "/defaultBlueprints/tier1/-",
    "value": {
    "item": "castslime"
    }
    }
    ]

    The weapon works perfectly when I spawn it in, and it even appears in the plain crafting list in admin mode. I just don't know how to tell my game that it can be made by default by slime people. I am losing sleep, hair and sanity.
     
  2. slowcold

    slowcold Pangalactic Porcupine

    If it works when you spawn it and appears in crafting in admin mode, the problem has to be in the species patch file.

    Which looks right. :chrono:

    Possibly foolish question - is your mod loading before the slimeperson mod? Can't patch a file that hasn't yet been read. It's the only thing I can think of. (yeah, I'm having a similar problem, though with an .item patch, not a species patch).
     
  3. Sparklink

    Sparklink Ketchup Robot

    I think that to patch another person's mod with your own mod you must have a requires parameter in the metadata file of your mod.
     
  4. bk3k

    bk3k Oxygen Tank

    In _metadata (don't bother having a .modinfo file anymore BTW)
    Code:
    "requires" : [ "whatever_the_slime_mod_name_is" ],
    
    if you want to require the other mod
    Code:
    includes" : [ "whatever_the_slime_mod_name_is" ],
    
    If you want to optionally support the mod, but not require it.
     
  5. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    Yeah, see, I never would have thought to do that. I never actually knew the purpose of that file. It works as intended. Thank you once again, Lite Brite Ignignark.
    [​IMG]
     

Share This Page