Modding Help Gun modding,need help :(

Discussion in 'Starbound Modding' started by Babelrap, Aug 7, 2014.

  1. sayter

    sayter The Waste of Time

    False. its 25% starbound.log, 50% developing, 25% waiting for the game to load :) Unless on admin mode in nightly. Im not going to switch over though, I would rather wait. As it is, I am esentially going to have to rewrite FrackinFlora from the ground up anyhow, once this 1.0 patch is live :(
     
  2. Babelrap

    Babelrap Subatomic Cosmonaut

    Code:
    Error: Could not instantiate item '[LastResort, 1, {}]'. ItemException: No such item 'LastResort'
    It says that the item doesn't exist,what file should i fix to make it exist?
     
  3. Babelrap

    Babelrap Subatomic Cosmonaut

    btw the the gun's name is LastResort,because palm trees :)
     
  4. BitHorizon

    BitHorizon Ketchup Robot

    Make sure you spelled LastResort in the "itemName" correctly.
     
  5. Babelrap

    Babelrap Subatomic Cosmonaut

    Code:
    {
      "itemName" : "LastResort",
      "inventoryIcon" : "LastResorticon.png",
      "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
      "maxStack" : 1,
      "rarity" : "Rare",
      "description" : "Get it? Cuz it's got a palm tree on it...and...um...",
      "shortdescription" : "The LastResort",
      "inspectionKind" : "gun",
      "spread" : [1, 1],
      "weaponType" : "Plasma Pistol",
      "accuracy" : 100,
      "image" : "LastResort.png",
      "recoilTime" : 0.1,
      "handPosition" : [5, 2],
      "firePosition" : [-1, 10.5],
      "level" : 1,
      "rateOfFire" : [3.5, 4],
      "walkWhileFiring" : true,
      "hands" : [1, 1],
      "projectileType" : [ "LastResortProjectile"],
      "projectile" : {"power" : 5000,"speed" : 100},
      "muzzleEffect" : [ {"animation" : "animations/muzzleflash/gunmuzzleflash/LastResortMF.animation',"fireSound" : [ { "file" : "/sfx/LastResortSound.wav" } ]
    }
    }
    So here's the LastResort.gun code and every time i enter it into a JSON Formatter i get paradoxical stuff , like it wants me to put a "}" at the end but it also doesn't :( Also if you see anything else wrong with please let me know,i'm trying my best to learn how to do modding.
     
  6. BitHorizon

    BitHorizon Ketchup Robot

    Here, I fixed it:

    Code:
    {
        "itemName": "LastResort",
        "inventoryIcon": "LastResorticon.png",
        "dropCollision": [
            -8,
            -3,
            8,
            3
        ],
        "maxStack": 1,
        "rarity": "Rare",
        "description": "Get it? Cuz it's got a palm tree on it...and...um...",
        "shortdescription": "The LastResort",
        "inspectionKind": "gun",
        "spread": [
            1,
            1
        ],
        "weaponType": "Plasma Pistol",
        "accuracy": 100,
        "image": "LastResort.png",
        "recoilTime": 0.1,
        "handPosition": [
            5,
            2
        ],
        "firePosition": [
            -1,
            10.5
        ],
        "level": 1,
        "rateOfFire": [
            3.5,
            4
        ],
        "walkWhileFiring": true,
        "hands": [
            1,
            1
        ],
        "projectileType": [
            "LastResortProjectile"
        ],
        "projectile": {
            "power": 5000,
            "speed": 100
        },
        "muzzleEffect": {
            "animation": "/animations/muzzleflash/gunmuzzleflash/LastResortMF.animation",
            "fireSound": [
                {
                    "file": "/sfx/LastResortSound.wav"
                }
            ]
        }
    }
    
    Your problem was that entire "muzzleEffect" section. It wasn't formatted correctly. The correct way is:

    Code:
    "muzzleEffect": {
            "animation": "/animations/muzzleflash/gunmuzzleflash/LastResortMF.animation",
            "fireSound": [
                {
                    "file": "/sfx/LastResortSound.wav"
                }
            ]
        }
    Also, don't forget to put slashes before the start of a filepath.
     
  7. Babelrap

    Babelrap Subatomic Cosmonaut

    Thanks for the help :) none of this was as easy as i thought it would be.
     
  8. Babelrap

    Babelrap Subatomic Cosmonaut

    Does anyone know what "fireTime" does?
     
  9. BitHorizon

    BitHorizon Ketchup Robot

    That's how fast the sword/gun can be swung. Lower=faster.
     
  10. Babelrap

    Babelrap Subatomic Cosmonaut

    Oh ok,well i was planning on making a kinda gun that does massive damage at the expense of almost all of the player's energy,but also wanted the projectile to move pretty fast.Do you know what i should adjust to do that?
     
  11. BitHorizon

    BitHorizon Ketchup Robot

    Look in the "Projectile" section of your own code to see how to change the speed of your projectile. Experiment a little before immediately coming to the forums to ask.

    Also, guns use the same amount of energy as damage that they do. In order to change energy consumption, you'd have to do the math and add a variable called "classMultiplier" and change that to a % of the damage that the gun deals.
     
  12. Babelrap

    Babelrap Subatomic Cosmonaut

    Got it.Yea sorry i'm posting so much. :(
     
  13. Babelrap

    Babelrap Subatomic Cosmonaut

    Error: Could not instantiate item '[LastResort, 1, {}]'. VariantException: Improper conversion to int from list in get("spread")

    Code:
     "spread": [1,1]
    Any idea what went wrong? I tried messing with it but the error's the same.All the codes have been validated by JSONLint as well.
     
  14. Babelrap

    Babelrap Subatomic Cosmonaut

    Oh sorry i forgot the comma at the end,but the error stays the same though.
     
  15. BitHorizon

    BitHorizon Ketchup Robot

    Your gun isn't randomly generated. Don't use a random array in a predetermined gun. Just delete the spread parameter entirely.
     
  16. Babelrap

    Babelrap Subatomic Cosmonaut

    that was there because i was working off of a randomly generated plasma gun recipes,is there anything else in the code that would make the game still think it's random?
     
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    Use a base template to learn from - Peglaci mod is a great example of fantastic custom guns and projectiles
     
  18. Babelrap

    Babelrap Subatomic Cosmonaut

    Hey,I got that mod! :) thanks for the tip.
     
  19. Babelrap

    Babelrap Subatomic Cosmonaut

    Error: Could not instantiate item '[LastResort, 1, {}]'. StarException: Unknown projectile with typeName LastResortProjectile.png.
    ProjectileDatabase::damageKindImage(String)

    I left the "damageKind" as plasma,should I change that?
     
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    is Plasma a vanilla damage kind - or did you make it up?
    Stick to vanilla damage kinds - as you will need to create a custom damage file to use custom ones.
     

Share This Page