Modding Help Sorry for Asking so Many Questions, I Have One More...

Discussion in 'Starbound Modding' started by agmoyer, Aug 31, 2015.

  1. agmoyer

    agmoyer Cosmic Narwhal

    For a while now I thought I just messed something up when creating my shotguns but now I am starting to think I never knew to begin with. I want to ask if anyone can help me with creating the basis of a shotgun. I have the gun, it fires, it will kill. The only problem is it fires a single pellet like a rifle not scattered like a shotgun.

    So how do you make a shotgun? Because I have failed.

    I need to learn how to do this so I can fix my original shotgun and make my future ones work properly. So yeah, Thanks for Reading!
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    You know there are vanilla shotguns in the game.
     
  3. agmoyer

    agmoyer Cosmic Narwhal

    I'll check the files, thanks for the tip.[DOUBLEPOST=1441047482][/DOUBLEPOST]
    In an attempt to change it from random generated to just simple add gun to my custom crafting table, I have now completely broke the gun to generic item...
    Code:
    {
      "itemName" : "strun",
      "inventoryIcon" : "strunIconImage.png",
      "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    
      "price" : 150,
      "maxStack" : 1,
      "rarity" : "common",
      "tooltipKind" : "gun",
      "description" : "Look what I found!",
      "shortdescription" : "Strun",
      "handPosition" : [5, 2],
      "firePosition" : [-1, 10],
      "baseDps" : [9, 10],
      "rateOfFire" : [0.5, 3.5],
      "hands" : [2, 2],
      "twoHanded" : true,
      "walkWhileFiring" : false,
      "recoilTime" : 0.1,
      "projectileCount" : [5, 8],
      "inaccuracy" : 0.13,
      "weaponType" : "Shotgun",
      "multiplier" : 1.0,
      "muzzleFlashes" : [
        "/animations/muzzleflash/gunmuzzleflash/bulletmuzzle1.animation",
        "/animations/muzzleflash/gunmuzzleflash/bulletmuzzle2/bulletmuzzle2.animation",
        "/animations/muzzleflash/gunmuzzleflash/bulletmuzzle3/bulletmuzzle3.animation"
      ],
      "projectileType" : [ "bullet" ],
      "directories" : [ "/items/guns/strun/strun" ],
      "fireSound" : [ "/sfx/guns/strun.wav" ]
    }
    
     
    Last edited: Aug 31, 2015
  4. lazarus78

    lazarus78 The Waste of Time

    This is what a vanilla shotgun looks like:

    Code:
    {
      "itemName" : "aegisaltshotgun",
      "price" : 600,
      "inventoryIcon" : "aegisaltshotgun.png",
      "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
      "maxStack" : 1,
      "rarity" : "rare",
      "description" : "A shotgun worth its Aegisalt",
      "shortdescription" : "The Aegishot",
      "image" : "aegisaltshotgun.png",
      "handPosition" : [-9, -1],
      "firePosition" : [17, 0],
      "recoilTime" : 0.1,
      "level" : 5,
      "projectileCount" : 5,
      "inaccuracy" : 0.11,
      "tooltipKind" : "gun",
      "weaponType" : "Shotgun",
      "fireTime" : 0.85,
      "twoHanded" : true,
      "walkWhileFiring" : false,
    
      "projectileType" : "standardbullet",
      "projectile" : {
        "speed" : 150,
        "life" : 3,
        "power" : 1.7
      },
      "muzzleEffect" : {
        "fireSound" : [ { "file" : "/sfx/gun/shotgun3.wav" } ],
        "animation" : "/animations/muzzleflash/bulletmuzzle3/bulletmuzzle3.animation"
      }
    }
    
    
    Most noted sections would be the projectileType and muzzleEffect. Compare it to yours.
     
  5. agmoyer

    agmoyer Cosmic Narwhal

    Hallelujah! Thank you for this now the gun works perfectly. I have to adjust position, dmg, and rarity, but it is working properly. Thank you so much! You have helped not just fix the one shotgun but all future ones.
     
  6. lazarus78

    lazarus78 The Waste of Time

    Its a good idea to have the current vanilla assets handy when you are having issues with custom items. You can then compare yours to them to see if you made any mistakes.

    Also, a site like this will tell you if there are any syntax errors: http://jsonlint.com/
     

Share This Page