Tutorial MOD-TUTORIAL 3: How to make your own Gun (OUTDATED)

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

Thread Status:
Not open for further replies.
  1. SaintPanda

    SaintPanda Cosmic Narwhal

    Alright, here we go.....
    dangit, this doesn't accept .rar files.....I'll upload them 1 by 1 I guess....
    Can't upload the code files ether apparently. I'll just copy them into code areas.
    USCMHandgun.gun
    Code:
    {
      "itemName" : "USCMHandgun",
      "inventoryIcon" : "USCMHandgunicon.png",
      "description" : "The best handgun around!",
      "shortdescription" : "USCM Handgun",
      "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
      "maxStack" : 1,
      "level" : 15,
      "rarity" : "Rare",
      "inspectionKind" : "gun",
      "image" : "USCMHandgun.png",
      "recoilTime" : 0.1,
      "handPosition" : [-5.5, -3],
      "firePosition" : [12, 3],
     
      "fireTime" : 0.5,
      "twoHanded" : false,
     
      "projectileType" : "USCMHandgunProjectile",
      "projectile" : {
      "speed" : 60,
        "color" : [10, 255, 10]
      },
     
      "muzzleEffect" : {
        "animation" : "/MyNewGun/USCMHandgunMF.animation:",
        "fireSound" : [ { "file" : "/MyNewGun/Projectile/USCMHandgunSound.wav" } ]
      }
    }
    
    USCMHandgun.recipe
    Code:
    {
      "input" : [
        { "item" : "darkwoodmaterial", "count" : 15 },
        { "item" : "money", "count" : 10 }
      ],
      "output" : { "item" : "USCMHandgun", "count" : 1 },
      "groups" : [ "plain", "weapons", "all" ]
    }
    
    USCMHandgunMF.animation
    Code:
    {
      "frames" : "USCMHandgunMF.png",
      "variants" : 1,
      "frameNumber" : 3,
      "animationCycle" : 0.03,
      "offset" : [-3, 0]
    }
    
    USCMHandgunMF.frames
    Code:
    {
      "frameGrid" : {
        "size" : [15, 15],
        "dimensions" : [3, 1]
      }
    }
    
    USCMHandgunProjectile.frames
    Code:
    {
      "frameGrid" : {
        "size" : [11, 3],
        "dimensions" : [1, 1],
     
        "names" : [
          [ "0" ]
        ]
      }
    }
    
    USCMHandgunProjectile.projectile
    Code:
    {
      "projectileName" : "USCMHandgunProjectile",
      "frames" : "USCMHandgunProjectile.png",
      "animationCycle" : 0.25,
      "armorPenetration" : 10,
      "energyCostPerDamagePoint" : 5,
      "frameNumber" : 1,
      "damageKindImage" : "USCMHandgunProjectileicon.png",
      "pointLight" : false,
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/bulletexplosion/bulletexplosion.config"
        }
      ],
      "power" : 30.0,
      "damageKind" : "default"
    }
    
     

    Attached Files:

  2. Ghoul159

    Ghoul159 Scruffy Nerf-Herder

    ok did you name the images png.png? name them only "USCMHandgun.png"...
    the file formating looks correct...
    in case this won't help you can upload it as zip file or take a look at my uploaded file in my first post...

    PS:
    besides i just noticed i did not write how to set the damage value of the weapon in my tutorial
    i just edited my tutorial it's the power propertie in the "MyNewGun.gun" i highlighted it...
     
  3. necKros

    necKros Space Hobo

    @SaintPanda, from those .png.png files looks like you might have the "hide unknown file extensions" enabled in your windows explorer. Always have that disabled when you are tinkering with these kind of things (specially in starmade, which plays alot with file extensions).
     
    Ghoul159 likes this.
  4. killerkitt

    killerkitt Void-Bound Voyager

    so the link from ghoul it says some kind of error or something and i have been trying this to is it something wrong with the projectiletype since it is in the other file like starbound\assets\MyNewGunMod\projectile and not just in the MyNewGunMod???
     
  5. Ghoul159

    Ghoul159 Scruffy Nerf-Herder

    hmm i just deleted and reuploaded it maybe that corrupted the file?
    i'll try to download and use it...

    Edit:
    It should work :) and keep in mind to add this weapon to your "player.config" if you are just using the file...
     
    Last edited: Dec 10, 2013
  6. SaintPanda

    SaintPanda Cosmic Narwhal

    Thanks, I see my problem now.
     
  7. killerkitt

    killerkitt Void-Bound Voyager

    download works thx gonna see if i can get it to work like on starbound
     
  8. SaintPanda

    SaintPanda Cosmic Narwhal

    How do I disable hiding those?
    Also, will I have to rename the code files if I did it with them too?
     
  9. killerkitt

    killerkitt Void-Bound Voyager

    so i just tryed it and got a loading screen so what do i do about that
     
  10. Ghoul159

    Ghoul159 Scruffy Nerf-Herder

    aehhm that should be normal with the newest version of Starbound :)
     
  11. killerkitt

    killerkitt Void-Bound Voyager

  12. SaintPanda

    SaintPanda Cosmic Narwhal

    Dangit, I can see it, but trying to fire it still crashes, even though I renamed all of the Picture files.
    Edit- Do I need to have them called "USCMHandgunMF.png" etc. or can it just be "USCMHandgunMF"
    I can't remember if I did that, you can check my code files that I posted.
     
  13. killerkitt

    killerkitt Void-Bound Voyager

    oh nvm it fixed it self i accidently spamed z when talking with some friends so i fixed it
     
  14. Ghoul159

    Ghoul159 Scruffy Nerf-Herder

    hmm i would bet it's a problem with the paths... like i said upload it as zip or look at my template in the first post
     
  15. SaintPanda

    SaintPanda Cosmic Narwhal

    I just realized I had the sound file in the main folder instead of the projectiles subfolder........
    Anyways, I'll test it again now. Hopefully this time my complete inexperience with code will not mess this up.
    Still broken.....can you please check my code....I think I did something else wrong..
    I moved the sound file to projectile though....
     
  16. St Fonz

    St Fonz Existential Complex

    In windows explorer, go to organize at the top left. Click folder and search options.

    Once inside, click the view tab and un-tick "Hide extensions for known file types".
     
  17. killerkitt

    killerkitt Void-Bound Voyager

    so that it is disabled?
     
  18. St Fonz

    St Fonz Existential Complex

    "Un-tick".
     
  19. SaintPanda

    SaintPanda Cosmic Narwhal

    I tried everything I could think of, but nothing has fixed it. I can see everything, but it closes starbound with no error message when I try to shoot it.
     
  20. Ghoul159

    Ghoul159 Scruffy Nerf-Herder

    can you upload it as zip to your post?
     
Thread Status:
Not open for further replies.

Share This Page