Modding Discussion [Query] Gun Energy Variable

Discussion in 'Starbound Modding' started by Aimay, Dec 8, 2013.

  1. Aimay

    Aimay Big Damn Hero

    Does anyone know how to change the amount of energy a gun needs to use in order to fire?

    Because I can't seem to figure it out. Thanks.
  2. RockyTV

    RockyTV Big Damn Hero

    Try adding this line to your gun.

    "energyUsage" : 30.0
  3. Aimay

    Aimay Big Damn Hero

    That didn't work I'm afraid...

    EDIT: Does it perhaps have to go before or after another part? That seems to be the problem with few things.
    Last edited: Dec 8, 2013
  4. Terraziel

    Terraziel Astral Cartographer

    There is a stat on the projectiles called "energyCostPerDamagePoint", but having not investigated i can't say what exactly it does
  5. Aimay

    Aimay Big Damn Hero

    That didn't work either, I've checked as many of the other gun weapons as I could and found nothing...
  6. RockyTV

    RockyTV Big Damn Hero

    Try adding before the last variable in your item.
  7. Would you mind posting your code somewhere? because energyCostPerDamagePoint is the way to go.
  8. Aimay

    Aimay Big Damn Hero

    "itemName" : "lilmac",
    "inventoryIcon" : "lilmacicon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "level" : 5,
    "rarity" : "Rare",
    "description" : "Look after Lil' Macintosh for me, cousin.",
    "shortdescription" : "Lil' Macintosh",
    "inspectionKind" : "gun",
    "image" : "lilmac.png",
    "recoilTime" : 0.1,
    "handPosition" : [-5.5, -3],
    "firePosition" : [12, 3],
    "fireTime" : 1.4,
    "twoHanded" : false,
    "muzzleFlashes" : [
    "projectileType" : "bullet-1",
    "projectile" : {
    "power" : 6,
    "color" : [10, 255, 10]

    "muzzleEffect" : {
    "animation" : "/animations/muzzleflash/bulletmuzzle3/bulletmuzzle3.animation",
    "fireSound" : [ { "file" : "/sfx/gun/pistol2.wav" } ]
  9. Matterialize

    Matterialize Scruffy Nerf-Herder

    I can confirm that energyCostPerDamagePoint is what affects the gun's energy cost. You're using the bullet-1 projectile, so you need to go into assets/projectiles/guns/bullets/bullet-1/ and open up the projectile file to change that variable.

    Better yet, duplicate & rename that projectile before editing, and then have your gun use the renamed one so that you don't affect other guns using the bullet-1 projectile.

    Also, I don't know if this is common knowledge yet but on the off-chance that you're not doing this, you need to create a new copy of the item once in-game in order to see any of your changes. If you already had the gun on your character, it still retains its older stats from before you made your edit.
    Last edited: Dec 9, 2013
    Aimay likes this.
  10. Aimay

    Aimay Big Damn Hero

    That's exactly the problem. Editing the bullet is what is needed. Thanks for that. So case closed, thanks guys.

    And yes, I know about making a new one. Thanks.

Share This Page