1. These forums are archived and available in read-only format. No new accounts may be created and content may not be added or edited. This archive is dedicated to hoshiwara.t who tragically passed away in April of 2015. She will be forever missed.

StarCheat visual weapon-mod guide

Discussion in 'Modding Guides' started by Dreganius, May 23, 2014.

  1. Dreganius

    Dreganius Dearly Departed

    Joined:
    Jan 2, 2014
    Messages:
    120
    Likes Received:
    0
    So, it's about time I make this guide a little more up-to-date, and add to it with more information about melee weapons. In this post, I'll be explaining the method I use to construct various guns in Starbound, using the StarCheat program. Note; this guide assumes you have basic knowledge of how StarCheat works. So, let's get on with the interesting part of...

    HOW TO MAKE GUNS
    I'll start with my custom "Vintage AKS-74U".​

    [​IMG]

    In its Drawables and Inventory Icon sections (both have the same values), the Vintage AKS-74U reads as follows:

    Code:
    [
        {
            "image": "/items/guns/randomgenerated/assaultrifle/butt/5.png?replace;e35f5d=aa1d1b;b22042=8b1311;871132=5d0100;808080=808080;606060=606060;404040=404040",
            "position": [
                -8.9,
                0.0
            ]
        },
        {
            "image": "/items/guns/randomgenerated/assaultrifle/middle/1.png?replace;e35f5d=64967f;b22042=446556;871132=1e2c26;808080=787784;606060=4f545a;404040=33343c",
            "position": [
                0.0,
                0.0
            ]
        },
        {
            "image": "/items/guns/randomgenerated/assaultrifle/barrel/17.png?replace;e35f5d=ff9d1e;b22042=bb6a0b;871132=6b3501;808080=787784;606060=4f545a;404040=33343c",
            "position": [
                10.9,
                -0.5
            ]
        }
    ]
    (Feel free to use this if you want your gun to look like an AKS-74U if you want)

    Wowsers! That's a lot to read! How are we ever gonna use that! Well, not so fast, let's break this down a bit. It's actually quite simple. There are three parts of an Assault Rifle: The butt, the middle, and the barrel. The amount of parts to a weapon will vary depending on the weapon, but there are three aspects to any part that will remain the same no matter how many parts there are. These three aspects, all of which you can edit, are the image the part uses, the colours of the image, and the position of the image.

    Image: To use the buttstock as an example, the image aspect is obviously the "image": "/items/guns/randomgenerated/assaultrifle/butt/5.png line. You can go into your Starbound folder and find the /items/guns/randomgenerated/ folder, and honestly you can pick ANY part you want from ANY gun to attach to your assault rifle. You can have a crossbow stock, or a pistol barrel for a stock if you wanted. It's up to you. So long as you're using the assets already in the game, it'll be visible for anyone else. And guess what! You can place additional images onto the weapon! Just add another "image": line to the weapon and make sure that it has a comma at the end, UNLESS it is the last "image": line on the asset list.

    Colours: The ?replace; immediately after that indicates that the default colours of the part are going to be changed, and the e35f5d=aa1d1b;b22042=8b1311;871132=5d0100;808080=808080;606060=606060;404040=404040 are describing the default colours, and what to change the defaults to. First example in the colour line above is e35f5d=aa1d1b, which shows that e35f5d is the default colour hex, and aa1d1b is the colour hex it has been changed to. This takes a fair bit more effort, but by taking a truecolour screenshot of your current gun and crossreferencing the colours in Photoshop (or another image editor that will give you the colour's hex value), you can more easily find which colour is which, and change up the colours visibly without having to trial and error it. Otherwise, you can use an internet colour hex chart/display and trial and error things.

    Position: Finally, the position is described with the "position": [ line. Position is fairly simple. The first value is on the X axis (horizontal, positive moves it to the right, negative moves it to the left), and the second is the Y axis (vertical, positive moves it upwards, negative moves it downwards), so where 0.0 is the default point of origin it will begin at, other values then move it from the origin. Here's the example from the AKS-74U's buttstock:
    Code:
      "position": [
                -8.9,
                0.0
    The first value is the X value of "-8.9,". This means it's 8.9 pixels to the left of its default point (origin). The Y value is "0.0," which means it's exactly at the vertical origin point. You can edit these as you need to in order for the parts to sit where they need to so you don't have silly empty gaps in the gun.
    A note on editing the position numbers, I'd round anything more than one decimal point up to only one decimal. You may find any of the default positions in your in-game gun to read as something ridiculously long. At the end of the day, you can't really notice a difference between something with only one decimal digits compared to something with ten decimal digits, so round it up to a single decimal just for readability and comprehension.


    Oh, before I forget, you may also need to edit the firePosition value in the Item, which should be the option just below the Drawables. This just uses an X and Y axis in the same way as the Position line previously described.


    So there you have it, my (rather lengthy) explanation in how to create your own guns using the default assets in Starbound! Hope it helps any of you that want to create/edit the look of your guns. (btw, editing melee weapons are almost exactly the same, except for the swinging animations, which is explained in detail in the next post.)
     
  2. Dreganius

    Dreganius Dearly Departed

    Joined:
    Jan 2, 2014
    Messages:
    120
    Likes Received:
    0
    So, let's move on from guns. You know how to make a good shooter, and now you want something that'll carve a little more meat off the bone. You want to make a kickass sword, or hammer, or mop and bucket, or a plush of Numi that'll devour your enemies whole. Can we do it? Sure, it's pretty simple. Let's get started on...

    HOW TO MAKE SWORDS
    Note: Starbound refers to all melee weapons as a "sword", assetwise.​



    Before we begin, make sure to read the post above on how to construct firearms if you're not already aware. It's got very similar aspects to melee weapons that I won't be repeating (mainly the image and colouring parts), but there are some differences that could throw you off. Keep in mind that although both are weapons, melee weapons aren't immediately the same as firearms in gameplay terms, for obvious reasons. They function in slightly different ways. It's still pretty easy to translate the knowledge of creating guns into creating a kickass blade, though.

    With both melee weapons and firearms, you can construct prettymuch anything you want, weapon-wise, with just the vanilla assets, and positioning an image asset is more or less the same as a firearm.


    However, the animation of the weapon requires a little more effort, if you don't want to use a simple default swing. You will need to open up the 'primaryStances' option in the weapon.


    [​IMG]
    I'm going to use Astora's 'Claymore of Light' as an example for this.​


    Here's an overview of what the entire "primaryStances" option holds, for Astora's personal Claymore:
    Code:
    {
        "cooldown": {
            "armAngle": -45,
            "duration": 0.4,
            "handPosition": [
                -2.7,
                -27
            ],
            "statusEffects": [
                {
                    "duration": 0.3,
                    "kind": "shieldsuppressed"
                }
            ],
            "swordAngle": -90,
            "twoHanded": true
        },
        "directional": false,
        "idle": {
            "armAngle": -20,
            "armFrameOverride": "idleMelee",
            "duration": 0.3,
            "handPosition": [
                4.7,
                -10.5
            ],
            "swordAngle": 70,
            "twoHanded": false
        },
        "projectile": {
            "level": 1.0,
            "power": 1500.0,
            "speed": 0.1
        },
        "projectileType": "firebroadsword",
        "projectileTypes": [
            "firebroadsword"
        ],
        "windup": {
            "armAngle": 90,
            "duration": 0.3,
            "handPosition": [
                -2.7,
                -16.5
            ],
            "statusEffects": [
                {
                    "duration": 0.3,
                    "kind": "shieldsuppressed"
                }
            ],
            "swordAngle": 90,
            "twoHanded": true
        }
    }


    What's all this do? Well, it means the Claymore of Light looks a little different when compared to other 2H weapons. Something more like this.

    [​IMG]

    Well, we start off by breaking it down a little more simply. We've got four major frames of the animation. In the primaryStances option, they are listed by cooldown, idle, projectile and windup frames.
    However, in actual animation terms in-game, the frames seem to run in the following order:​
    1. Idle
    2. Windup
    3. Projectile
    4. Cooldown
    5. Idle.
    Let's explain each option further.



    Cooldown:​
    [​IMG]
    The Cooldown frame is the frame that displays after the blow has landed, but before the weapon is moved back into the idle position.​
    Code:
    {
        "cooldown": {
            "armAngle": -45,
            "duration": 0.4,
            "handPosition": [
                -2.7,
                -27
            ],
            "statusEffects": [
                {
                    "duration": 0.3,
                    "kind": "shieldsuppressed"
                }
            ],
            "swordAngle": -90,
            "twoHanded": true
        },
    Now, I'll rip through this quickly. There are a few lines you'll notice to begin with here's a run down of what they do.
    • "armAngle": {180 to -180}
      The angle the arm as a whole is directed at its Z pivot

    • "duration": {time}
      How long the frame will be displayed for before moving to the next in the cycle

    • "handPosition": [ {x, y} ]
      Where exactly the weapon is located in the hand. Note: This moves the weapon, not the hand.

    • "statusEffects": [ {duration and kind} ] Things such as 'shieldsuppressed' and whatnot. Duration here is the same as above. I won't go into "kind". If you've unpacked your game files, you can find them in your Starbound\assets\statuseffects folder.

    • "swordAngle": -90,
      The angle the weapon is pointing.
    • "twoHanded": {true or false}
      This ripper of a value, believe it or not, dictates whether the frame is a 2H frame or not.

    Idle:
    [​IMG]
    Idle is the standby frame. It is the frame that plays when you're not swinging your sword.​

    Code:
        "directional": false,
        "idle": {
            "armAngle": -90,
            "duration": 0.1,
            "handPosition": [
                0.5,
                -7.5
            ],
            "swordAngle": -90,
            "twoHanded": false
    These options are mostly the exact same as the ones in the Cooldown frame, except for one new option right at the top.
    • "directional": {true/false}
      This dictates whether or not your weapon is aimed with your mouse.

    Projectile:
    [​IMG]
    The Projectile frame runs right after the wind-up frame. Like in guns, it's the projectile that deals the damage.​
    Code:
        "projectile": {
            "level": 1.0,
            "power": 1500.0,
            "speed": 0.1
        },
        "projectileType": "firebroadsword",
        "projectileTypes": [
            "firebroadsword"
    • "projectile": {level, power, projectile speed}
      The damage and speed of the projectile. Remember, tweaking the level or power values is frowned upon, especially to make overpowered weapons or such.
    • "projectileType": "{projectile/swoosh}"
      The specific projectile, or in the case of a melee weapon, "swoosh", used by the weapon when swung. You can find the swoosh projectiles in \Starbound\assets\projectiles\swoosh if your game data is unpacked.
    • "projectileTypes": [ "{projectiles/swooshes}"
      Seems to be a reference list of swooshes the weapon can use. The swoosh used in projectileType MUST also exist in projectileTypes or the weapon doesn't work.

    Wind-up:
    [​IMG]
    The wind-up frame is the first frame in the animation sequence. It plays just before the weapon is swung.
    Code:
        "windup": {
            "armAngle": 90,
            "duration": 0.3,
            "handPosition": [
                -2.7,
                -16.5
            ],
            "statusEffects": [
                {
                    "duration": 0.3,
                    "kind": "shieldsuppressed"
                }
            ],
            "swordAngle": 90,
            "twoHanded": true
        }
    This one is basically the same deal as the Cooldown frame.


    And there you have it so far! I hope to see some seriously awesome looking weapons circulating on the server soon!
     
  3. Dreganius

    Dreganius Dearly Departed

    Joined:
    Jan 2, 2014
    Messages:
    120
    Likes Received:
    0
    [Reserved]
     
  4. Iridium616

    Iridium616 New Member

    Joined:
    Feb 2, 2014
    Messages:
    1,133
    Likes Received:
    2
    It's a pretty good guide. It's just a shame that there isn't a way to calculate the X,Y co-ords other than guessing them, I was expecting to found that here. It's the only "hard" thing for me.
    (Almost impossible, actually)
     
  5. Angre

    Angre Majestic Penguin

    Joined:
    Dec 23, 2013
    Messages:
    256
    Likes Received:
    665
  6. Finestein Goodlad

    Finestein Goodlad Wizard Mod

    Joined:
    Mar 27, 2014
    Messages:
    427
    Likes Received:
    0
    There is no way to rotate a sprite for a weapon, correct?
     
  7. Terallis

    Terallis Dark Matter of Fact

    Joined:
    Dec 18, 2013
    Messages:
    577
    Likes Received:
    0
    I don't /think/ there is, at least. Then again, I'm not the greatest with the scripting. I could be wrong.
     
  8. Reconus

    Reconus Moderator
    Staff Member

    Joined:
    Feb 23, 2014
    Messages:
    276
    Likes Received:
    45
    On the contrary, I found a very good way to find an estimate of x and y is to use a painting program (I use GIMP). Make a point to be "0,0" and align the center of your part there. Then use the arrow keys to move it, counting the spaces as you go.

    It usually works. A way I like to do it is make a selection box around the 0, 0 point and then paste, to get it on center.
     
  9. Finestein Goodlad

    Finestein Goodlad Wizard Mod

    Joined:
    Mar 27, 2014
    Messages:
    427
    Likes Received:
    0
    There is also a bit of a primitive explanation to this. First 0.0 number goes to left (positive numbers) or goes to right (negative numbers). 0,0 that should be below goes up (positive numbers) or goes down (negative numbers). Some sprites have different impacts on them done by position script. You'll get most of it correct by guessing once you'll get the hang of it.
     
  10. Terallis

    Terallis Dark Matter of Fact

    Joined:
    Dec 18, 2013
    Messages:
    577
    Likes Received:
    0
    Actually, I have an exact way to do that, assuming you have Photoshop or something similar. Open up the asset (lets say the middle piece) of a weapon, in Photoshop. Zoom in until the individual pixels are easily seen. Open up the next part (lets say the butt) of whatever weapon, in Photoshop. Now Ctrl+A then Ctrl+C on the second image. Move back to the first image and paste. It'll paste it at what would be classified as 0,0 on the grid. Now, with that layer, you just slowly move it, pixel by pixel, counting the number of pixels it was moved in each direction. Then you just repeat for each part you are wanting to add.

    Important note: Do NOT save over the first file while working on it. Always be sure to save it as a new file.
     
  11. Dreganius

    Dreganius Dearly Departed

    Joined:
    Jan 2, 2014
    Messages:
    120
    Likes Received:
    0

    Yeah that's pretty much what I do. The easiest way to do it is start a new file and then drag those PNGs into the new Photoshop file. It's how I made my Howitzer, my Claymore, hell prettymuch all of my weapons these days. I also use Photoshop and StarCheat to colour my armors, to the point that I don't even use SBSE any more.
     
  12. FFPLEASE

    FFPLEASE DANK MEMES

    Joined:
    Mar 16, 2014
    Messages:
    898
    Likes Received:
    0
    Hi, is there any way to change two handed sword for one handed?
     
  13. Reconus

    Reconus Moderator
    Staff Member

    Joined:
    Feb 23, 2014
    Messages:
    276
    Likes Received:
    45
    Yes. In starcheat you scroll down the properties until you come to "Two-handed". set it to false.
    much easy yesh?
     
  14. Iridium616

    Iridium616 New Member

    Joined:
    Feb 2, 2014
    Messages:
    1,133
    Likes Received:
    2
    Yes, change twoHanded or something like that to false, and do the same to all primaryStance's "twoHanded" fields.
     
  15. M-Bot

    M-Bot #swellest

    Joined:
    Apr 4, 2014
    Messages:
    492
    Likes Received:
    0
    change all of the "two handed = true" to "false" in primary stances
     
  16. DeltaV

    DeltaV New Member

    Joined:
    Apr 16, 2014
    Messages:
    375
    Likes Received:
    191
    How do you add a second attack to a weapon? I've seen it with things like John's blood-knight boltgun, which can shoot and attack, presumably with left and right click.
     
  17. Dreganius

    Dreganius Dearly Departed

    Joined:
    Jan 2, 2014
    Messages:
    120
    Likes Received:
    0
    Seperate weapons. They look identical, however.
     
  18. DeltaV

    DeltaV New Member

    Joined:
    Apr 16, 2014
    Messages:
    375
    Likes Received:
    191
    Ah. That's a shame, I was hoping there was a nice trick to do it.
     
  19. John_McFakename

    John_McFakename New Member

    Joined:
    Dec 22, 2013
    Messages:
    192
    Likes Received:
    0
    How to make a "melee-gun":

    Rifles and other two-handed firearms:
    1. Get a random generated "Broadsword"
    2. Get the "Gun" you want to pummel someone to death with for no reason in a universe that has an abundance of swords.
    3. Copy-paste the "drawables" from the "Gun" to the "Broadsword's" "drawables"
    4. Copy-paste the "inventoryIcon" from the "Gun" to the "Broadsword's" "inventoryIcon"
    5. Check the "Broadsword" that "directional" in the "primaryStance" on "idle" is true
    6. Test the "Broadsword" ingame. Your character will be mostlikely floating it around with his/her Jedi powers.
    7. Fiddle with the "Broadsword's" "primaryStance" section, specifically the "idle" part's "handPosition" and "swordAngle" until it looks identical to aiming the actual "Gun".
    8. Do the same for the rest of the animations if necessary.

    For pistols and other one-handed firearms, it's almost the same thing expect it's directional by default and it will use a horizontal swipe for the melee animation. Yet to test that myself.
     
  20. fukkireta

    fukkireta New Member

    Joined:
    Jul 10, 2014
    Messages:
    34
    Likes Received:
    0
    Is star cheat not banned?