Modding Help Mod weapon ignoring alt ability, reading .png wrong

Discussion in 'Starbound Modding' started by Iaeyan Elyuex, Aug 30, 2017.

  1. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    [​IMG]

    This is the Omnicannon. Or at least it would be, if the darn thing rendered correctly and actually recognized its ammo switcher. I have spent all night and half the day trying to spot the problem. There was a long process of copying and pasting, but if the files were missing a comma somewhere, the game wouldn't even start. I'm certain I misspelled something somewhere. But where?

    omnicannon.frames:
    Code:
    {
      "frameGrid" : {
        "size" : [29, 11],
        "dimensions" : [14, 1],
        "names" : [
          ["hunting.1", "napalm.1", "frost.1", "shock.1", "bioooze.1", "shadow.1", "radioactive.1", "cosmic.1", "avikanhunting.1", "centensian.1", "jumpweapon.1", "linerifle.1", "violatedlinerifle.1", "xanafian.1" ]
        ]
      },
    
      "aliases" : {
      }
    }
    

    omnicannon.activeitem
    Code:
    {
      "itemName" : "omnicannon",
      "price" : 1500,
      "inventoryIcon" : "omnicannon.png:hunting.1",
      "maxStack" : 1,
      "rarity" : "Legendary",
      "description" : "Enough elements to give you the heebeezeebees.",
      "shortdescription" : "Omnicannon",
      "level" : 8,
      "tooltipKind" : "gun",
      "category" : "uniqueWeapon",
      "itemTags" : ["weapon","ranged","energy"],
      "twoHanded" : true,
    
      "animation" : "/items/active/weapons/ranged/gun.animation",
      "animationParts" : {
        "butt" : "",
        "middle" : "omnicannon.png",
        "barrel" : "",
        "muzzleFlash" : ""
      },
      "animationCustom" : {
        "sounds" : {
          "fire" : [ "/sfx/omnicannonfire.ogg" ]
        }
      },
    
      "baseOffset" : [0.5, 0.0],
      "muzzleOffset" : [1.875, 0.125],
      "handGrip" : "wrap",
    
      "scripts" : ["/items/active/weapons/ranged/gun.lua"],
    
      "elementalType" : "physical",
      "primaryAbility" : {
        "scripts" : ["/items/active/weapons/ranged/gunfire.lua"],
        "class" : "GunFire",
    
        "fireTime" : 0.2,
        "baseDps" : 10,
        "energyUsage" : 3,
        "inaccuracy" : 0.001,
    
        "projectileCount" : 1,
        "fireType" : "auto",
    
        "projectileType" : "omnicannonbeam-hunting",
        "projectileParameters" : {
          "knockback" : 20
        },
        "stances" : {
          "idle" : {
            "armRotation" : 0,
            "weaponRotation" : 0,
            "twoHanded" : false,
    
            "allowRotate" : true,
            "allowFlip" : true
          },
          "fire" : {
            "duration" : 0,
            "armRotation" : 0,
            "weaponRotation" : 0,
            "twoHanded" : false,
    
            "allowRotate" : true,
            "allowFlip" : true
          },
          "cooldown" : {
            "duration" : 0.25,
            "armRotation" : 0,
            "weaponRotation" : 0,
            "twoHanded" : false,
    
            "allowRotate" : true,
            "allowFlip" : true
          }
        }
      },
    
      "altAbilityType" : "omnicannonammo",
      "builder" : "/items/buildscripts/buildunrandweapon.lua"
    }
    

    omnicannonammo.weaponability
    Code:
    {
      "animationCustom" : {
        "animatedParts" : {
          "stateTypes" : {
            "ammoType" : {
              "default" : "1",
              "states" : {
                "1" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ]
                  }
                },
                "2" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "napalmAmmo" ]
                  }
                },
                "3" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "frostAmmo" ]
                  }
                },
                "4" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "shockAmmo" ]
                  }
                },
                "5" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "biooozeAmmo" ]
                  }
                },
                "6" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "shadowAmmo" ]
                  }
                },
                "7" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "radioactiveAmmo" ]
                  }
                },
                "8" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "cosmicAmmo" ]
                  }
                },
                "9" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ]
                  }
                },
                "10" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "centensianAmmo" ]
                  }
                },
                "11" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "jumpweaponAmmo" ]
                  }
                },
                "12" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "linerifleAmmo" ]
                  }
                },
                "13" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "violatedlinerifleAmmo" ]
                  }
                },
                "14" : {
                  "frames" : 1,
                  "properties" : {
                    "particleEmittersOff" : [ "napalmAmmo", "frostAmmo", "shockAmmo", "biooozeAmmo", "shadowAmmo", "radioactiveAmmo", "cosmicAmmo", "centensianAmmo", "jumpweaponAmmo", "linerifleAmmo", "violatedlinerifleAmmo", "xanafianAmmo" ],
                    "particleEmittersOn" : [ "xanafianAmmo" ]
                  }
                }
              }
            }
          },
    
          "parts" : {
            "middle" : {
              "properties" : {
                "image" : null
              },
    
              "partStates" : {
                "ammoType" : {
                  "1" : {
                    "properties" : {
                      "image" : "<partImage>:hunting.<frame><paletteSwaps>"
                    }
                  },
                  "2" : {
                    "properties" : {
                      "image" : "<partImage>:napalm.<frame><paletteSwaps>"
                    }
                  },
                  "3" : {
                    "properties" : {
                      "image" : "<partImage>:frost.<frame><paletteSwaps>"
                    }
                  },
                  "4" : {
                    "properties" : {
                      "image" : "<partImage>:shock.<frame><paletteSwaps>"
                    }
                  },
                  "5" : {
                    "properties" : {
                      "image" : "<partImage>:bioooze.<frame><paletteSwaps>"
                    }
                  },
                  "6" : {
                    "properties" : {
                      "image" : "<partImage>:shadow.<frame><paletteSwaps>"
                    }
                  },
                  "7" : {
                    "properties" : {
                      "image" : "<partImage>:radioactive.<frame><paletteSwaps>"
                    }
                  },
                  "8" : {
                    "properties" : {
                      "image" : "<partImage>:cosmic.<frame><paletteSwaps>"
                    }
                  },
                  "9" : {
                    "properties" : {
                      "image" : "<partImage>:avikanhunting.<frame><paletteSwaps>"
                    }
                  },
                  "10" : {
                    "properties" : {
                      "image" : "<partImage>:centensian.<frame><paletteSwaps>"
                    }
                  },
                  "11" : {
                    "properties" : {
                      "image" : "<partImage>:jumpweapon.<frame><paletteSwaps>"
                    }
                  },
                  "12" : {
                    "properties" : {
                      "image" : "<partImage>:linerifle.<frame><paletteSwaps>"
                    }
                  },
                  "13" : {
                    "properties" : {
                      "image" : "<partImage>:violatedlinerifle.<frame><paletteSwaps>"
                    }
                  },
                  "14" : {
                    "properties" : {
                      "image" : "<partImage>:xanafian.<frame><paletteSwaps>"
                    }
                  }
                }
              }
            }
          }
        },
    
        "particleEmitters" : {
          "napalmAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 3.0,
            "particles" : [
              { "particle" : "fireember" },
              { "particle" : "fireember" },
              { "particle" : "fireember" }
            ]
          },
          "frostAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 3.0,
            "particles" : [
              { "particle" : "iceaura" }
            ]
          },
          "shockAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 1.0,
            "particles" : [
              { "particle" : "teslabolt" },
              { "particle" : "electricalburn" },
              { "particle" : "electricalburn" },
              { "particle" : "electricswoosh2" },
              { "particle" : "electricswoosh2" }
            ]
          },
          "biooozeAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 1.0,
            "particles" : [
              { "particle" : "poisondrip2" },
              { "particle" : "poisondrip2" },
              { "particle" : "poisondrip2" }
            ]
          },
          "shadowAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 1.5,
            "particles" : [
              { "particle" : "shadowsmoke" },
              { "particle" : "shadowsmoke" }
            ]
          },
          "radioactiveAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 2.0,
            "particles" : [
              { "particle" : "radioactiveswoosh1" },
              { "particle" : "radioactiveswoosh2" },
              { "particle" : "radiationburndust" }
            ]
          },
          "cosmicAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 2.0,
            "particles" : [
              { "particle" : "smallcosmiccloud1" },
              { "particle" : "smallcosmiccloud2" }
            ]
          },
          "centensianAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 2.0,
            "particles" : [
              { "particle" : "centensgravitysmall" },
              { "particle" : "centensgravitysmall" },
              { "particle" : "centensgravitysmall" }
            ]
          },
          "jumpweaponAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 2.0,
            "particles" : [
              { "particle" : "jumprifleburn" },
              { "particle" : "jumprifleburn" }
            ]
          },
          "linerifleAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 2.0,
            "particles" : [
              { "particle" : "linerifleburn" },
              { "particle" : "linerifleburn" }
            ]
          },
          "violatedlinerifleAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 2.0,
            "particles" : [
              { "particle" : "violatedlinerifleburn" },
              { "particle" : "violatedlinerifleburn" }
            ]
          },
          "xanafianAmmo" : {
            "transformationGroups" : ["weapon"],
            "offsetRegion" : [0, 0, 1.5, 0],
            "emissionRate" : 1.5,
            "particles" : [
              { "particle" : "xanafiantrail" },
              { "particle" : "xanafiantrail" }
            ]
          }
        },
    
        "sounds" : {
          "switchAmmo" : [ "/sfx/omnicannonswitch.ogg" ]
        }
      },
    
      "ability" : {
        "type" : "omnicannonammo",
        "name" : "Omnicore",
        "scripts" : ["/items/active/weapons/other/adaptablecrossbow/adaptableammo.lua"],
        "class" : "AdaptableAmmo",
    
        "adaptedAbilityIndex" : 1,
    
        "ammoTypes" : [
          {
            "projectileType" : "omnicannonbeam-hunting",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-fire",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-ice",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-shock",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-poison",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-shadow",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-radioactive",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-cosmic",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-avikanhunting",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-centensian",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-jumpweapon",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-linerifle",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-violatedlinerifle",
            "energyUsage" : 2
          },
          {
            "projectileType" : "omnicannonbeam-xanafian",
            "energyUsage" : 2
          }
        ],
    
        "stances" : {
          "idle" : {
            "armRotation" : 0,
            "weaponRotation" : 0,
            "twoHanded" : false,
    
            "allowRotate" : true,
            "allowFlip" : true
          },
          "switch" : {
            "aimAngle" : 0,
            "armRotation" : 0,
            "weaponRotation" : 0,
            "weaponAngularVelocity" : 0,
            "armAngularVelocity" : 0,
            "twoHanded" : false,
            "duration" : 0.4,
    
            "allowRotate" : true,
            "allowFlip" : true
          }
        }
      },
      "critChance" : 2,
      "critBonus" : 10
    }
    


    There are also 14 ammo type folders, each with an ammo type file in them.
     
  2. lazarus78

    lazarus78 The Waste of Time

    Edit: Ignore me. My bad.
     
  3. bk3k

    bk3k Oxygen Tank

    If you have a JSON error, your log should tell you this and it should tell you where. You can also use any JSON Lint checker.
     
  4. Peelz

    Peelz Giant Laser Beams

    I think it might be this line in your .activeitem file:
    Code:
    "animation" : "/items/active/weapons/ranged/gun.animation",
    
    You will probably need to create a new .animation file for your weapon. I think. I haven't done much with activeitems.
     
  5. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    All my JSON files check out. I have it set up the same structurewise as the FU adaptable crossbow. I'm not exactly certain how this weapon knows where to find the projectiles, as there's no line of code in the weapon ability that points directly to them. I hypothesize that my weapon files don't know where to look to find the other projectiles. It fires the first one in the sequence just fine, and that projectile is mentioned in the .activeitem file, just like the iron bolt is mentioned in the FU adaptable crossbow's .activeitem file.

    I'm two cups and a Monster buzzed, because I can only remotely comprehend these files when under stimulants, and I'm having life issues I'd rather not darken the forum further by elaborating on. This code is kicking my butt, and it was supposed to be the last thing I made before designing my modded race of quasi-bug mammal guys.
     
    Last edited: Sep 3, 2017
  6. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    I give up. I don't know where to start looking for the error. This mod has so many files, and they all seem to mesh together. The addition of more elements shouldn't be a problem, due to the adaptable nature of adaptableammo.lua.
    I've been explaining the code to my plushie, because apparently that's supposed to help. I have made zero progress on this mod despite having a big breakfast and an energy drink.

    Here is the file. The one who solves it gets a statue of a character of their choice in my capital city, because I know I can at least do that. Just send me a screencap of said character as a png file.
     

Share This Page