Modding Help Weapon Creation, [Assistance no longer Required]

Discussion in 'Starbound Modding' started by Dilrax, Jan 15, 2014.

  1. Dilrax

    Dilrax Ketchup Robot

    first of all, this was my last option and well... i have been finally beaten by it. haha anyhow...

    i decided to try my luck at some modding here in starbound, i was surprised to find you could use notepad++ which i had recently used for a couple other things, on top of that i had been impressed by the work of others, in particularly the Avali race mod, (now who cant love that mod?) any way i decided to try modding for my self and started with something easy...

    thus it brings us to the leading problem, having finally got starbound to load and skip the endless loading :eek:, after going over my files countless times of which i lost track of how many times i had done so as well as made smaller modifications here and there getting things in order, the ingame image/sprite breaks and fails, or it could just be the item in general.

    which this makes it a bit hard to further test and modify when the meant-to-be-Gun happens to be a green perfectly generic cube...o_O
    [​IMG] "perhaps a bit too perfect" indeed...

    i got the recipe to work but now its just a visual and "item" problem, so i was hoping that someone had some form of idea or perhaps even an answer to how i can solve this... my only lead into this problem is this.
    Code:
    Error: Could not load /items/guns/vulcan/vulcan.gun asset, attempting to use default.
    AssetException: Could not read variant asset /items/guns/vulcan/vulcan.gun
    caused by: JsonParsingException: Cannot parse json file: /items/guns/vulcan/vulcan.gun
    Code:
    {
        "itemName" : "Vulcan",
        "inventoryicon" : "Vulcanicon.png",
        "description" : "a Highly Advanced Vulcan MachineGun, a Avali called Reni told you how to build it."
        "dropCollision" [-8.0, -3.0, 8.0, 3.0],
        "maxStack" : 1,
        "level" : 3
        "rarity" : "common",
        "inspectionKind" : "gun",
        "image" : "Vulcan.png",
        "handPosition" : [-5.5, -3],
        "firePosition" : [12, 3],
        "weaponType" : "assault rifle",
        "classMultiplier" : 0.5,
       
        "fireTime" : 0.25,
        "twoHanded" : true,
       
        "projectileType" : "VulcanProjectile",
        "projectile" : {
        "power" : 10,
        "speed" : 90,
        "color" : [10, 255, 10]
        }
       
        "muzzleEffect" : {
        "animation" : "/animations/muzzleflash/gunmuzzleflash/VulcanMF.animation"
        "firesound" : [ { "file" : "/sfx/Vulcan.wav" } ]
        }
    }

    and i have the slightest clue on how to fix this, it might just be my own poor understanding of the system as this would be my first mod, so yeah no shame here in admitting to being a newbie with this ^^;
     
    Dagaz likes this.
  2. Jotagonist

    Jotagonist Subatomic Cosmonaut

    You missed a comma. Should be "level" : 3,
    :p

    EDIT:

    Looking at it one more time you're missing a comma after your description too.
     
  3. RyuujinZERO

    RyuujinZERO Supernova

    A JSON syntax checker like this one is handy if you're having problems:
    http://jsonsh.com/

    Just paste your text into there (All the plain text configuration files are JSON format) and it'll point out if you've missed any commas and stuff; sometimes it gets a bit overzealous though and says there is a problem where there isn't, but if you suspect a file is borked and you're not seeing the problem yourself, it can set you in the right direction.


    In this case:

    Code:
     "description" : "a Highly Advanced Vulcan MachineGun, a Avali called Reni told you how to build it.", // needed extra comma
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0], // missing a :
    ...
    "level" : 3, // needed extra comma
    ...
    },   // needed a comma here, before muzzle effect block
     
    "muzzleEffect" : {
    ...
    "animation" : "/animations/muzzleflash/gunmuzzleflash/VulcanMF.animation", // needed extra comma
    
    Code:
    {
      "itemName": "Vulcan",
      "inventoryicon": "Vulcanicon.png",
      "description": "a Highly Advanced Vulcan MachineGun, a Avali called Reni told you how to build it.",
      "dropCollision": [
        -8,
        -3,
        8,
        3
      ],
      "maxStack": 1,
      "level": 3,
      "rarity": "common",
      "inspectionKind": "gun",
      "image": "Vulcan.png",
      "handPosition": [
        -5.5,
        -3
      ],
      "firePosition": [
        12,
        3
      ],
      "weaponType": "assault rifle",
      "classMultiplier": 0.5,
      "fireTime": 0.25,
      "twoHanded": true,
      "projectileType": "VulcanProjectile",
      "projectile": {
        "power": 10,
        "speed": 90,
        "color": [
          10,
          255,
          10
        ]
      },
      "muzzleEffect": {
        "animation": "/animations/muzzleflash/gunmuzzleflash/VulcanMF.animation",
        "firesound": [
          {
            "file": "/sfx/Vulcan.wav"
          }
        ]
      }
    }




    Also, glad to see you were inspired to try modding too :)
     
    Last edited: Jan 15, 2014
  4. Dilrax

    Dilrax Ketchup Robot

    *facepalms* :facepalm: i thought i might have missed something but its still broken, from my understanding it reads that the item exists but not what it is,
    i also stumbled across these, which i missed before

    Code:
    Warn: Slow asset 0.298 : /items/guns/vulcan/vulcan.gun
    
    Error: Could not instantiate item '[ Vulcan, 1, {} ]'. ItemException: No such item 'Vulcan'
    in the starbound text document in the starbound folder when i took a quick search through it.
     
  5. RyuujinZERO

    RyuujinZERO Supernova

    If the JSON file associated with the item isn't working, then it won't "see" the item and give that same error I believe, which seems like the most logical problem as your item is definitely called "Vulcan" - as defined here:

    Code:
        "itemName" : "Vulcan",
     
  6. Dilrax

    Dilrax Ketchup Robot

    im surprised to find a response from you, ^^; but all forms of help is greatly appreciated, love your avali mod btw :up:


    got a bit of a nack for game editors and alike terrible at modding anything, haha, but i guess i should run all my coding files though the checker just to be sure i didnt miss anything else
     
  7. Dilrax

    Dilrax Ketchup Robot

    by the looks of things, and according to that json syntax highlight and format site, everything should defiantly be in order, though it still appears as the Generic cube :/
    Code:
    Could not instantiate item '[Vulcan, 1, {}]'. ItemException: No such item 'Vulcan'
    appears to be my only known problem, what ever it means, i dont think its got anything to do with the weapon appearance, but i'll play with that and see if it makes a difference... only because its slightly bigger then weapons iv seen made by other people...
     
  8. RyuujinZERO

    RyuujinZERO Supernova

    You could attach the mod to the thread and I'll have a look. I'm curious myself as I havn't messed with guns yet
     
  9. Dilrax

    Dilrax Ketchup Robot

    i was hoping to get this first one sorted out, and from it learn enough to then make custom set of all kinds of weapons but... i don't think that's happening anytime soon ^^; haha
    but here ya go, ryuujin, https://www.mediafire.com/?3hxy6c3jprd2dh3
    i also used this guide as a base for sorting all the files out, i think it might be a tad outdated in some area's, not sure though.
     
  10. RyuujinZERO

    RyuujinZERO Supernova

    I figured it out :)

    Firstly in the recipe it has "Vulcan" as the output, but the item is actually called "VulcanMG", "Vulcan" is the recipe
    Secondly, the projectile name in the gun itself is labelled incorrectly. The gun is looking for "VulcanProjectile" but the projectile itself is called "Vulcanprojectile" (notice the lower case), and that is what was bugging out the gun.

    EDIT: Thinking about it I should test the gun actually works <.< - I didn't have the resources on hand

    EDIT: Nope, crashes xD. Let's check cause of that...
     

    Attached Files:

    Last edited: Jan 15, 2014
  11. Dilrax

    Dilrax Ketchup Robot

    i had fiddled with the item name, changing it to vulcanMG
    after you had posted
    Code:
    "itemName" : "Vulcan",
    i must have forgotten to change it back after testing to see if it would make a difference ^^;
     
  12. RyuujinZERO

    RyuujinZERO Supernova

    I've ruled out the projectile, sound and muzzleflash as the cause of the crash when you fire the gun :/ - You might be best off looking at a working gun mod, copying out the contents of a working gun file, and then replacing the projectile/sound/muzzle lines one at a time to see where, if any of those stages it bugs out. I'm not too sure what the issue is.

    EDIT: AH - of course. When a weapon is generated, it stores any related attributes locally, like most other items and stuff. In order to test changes, you need to build a new weapon, so of course my changes "did nothing" I was still using an old buggy version of the gun.

    I can't get the vulcan projectile to actually show up visibly, and the Vulcan firing sound seems to be crashing it; so I'd switched over a couple entries to render it "working", anyway I've attached the working file, so from there you can probably get the projectiles to show up and maybe figure out what's up with the firing sound. (Oh, also I added a tag to make it work with tabula rasa, and set the price to 1 pixel to make testing easier you'll probably want to revert that)
     

    Attached Files:

    Last edited: Jan 15, 2014
  13. Dilrax

    Dilrax Ketchup Robot

    i noticed that, i had to fiddle and modify a couple things to get it to actually appear, as it was still the green cube for me, but at least i can see it in full detail and size -.- poor Reni though, its twice the size haha, can only just see the goggles upon his head, already worked on a solution to its size, might make the smaller version a bit smaller and more "under the arm" or in this case, wing.
    [​IMG]
    though i will have to go back and look at the pre-gen codes, as you said, i had done a comparison when working on the gun file, and i think the projectile code files are all vanilla files anyway, that might also be a problem too come to think of it... still even if you changes did nothing, this has been able to progress and work even more then it did before thanks to your assistance :D to me that still counts for something.
     
  14. Dilrax

    Dilrax Ketchup Robot

    i forgot to set it to easier crafting, but i built one on my char anyway which now the gun seems to get updated when i alter it, before i had to rebuild it because it was still a cube, but i have spare components anyway to build another with if need be, looking back though the starbound log text doccument i noticed the following "Error: Could not instantiate item '[Vulcan, 1, {}]'. StarException: Unknown projectile with typeName Vulcanprojectile." so im currently looking into that, little do i understand of it but i got the feeling i might need to re-write the projectiles, which i already made a couple modifications to fix things i missed but also im thinking of using a default projectile and altering the code to match, might change the sound now that you mention it, custom sounds might be better to use later when i work out the specific sound file details, think tone/pitch, stereo/mono stuff might effect it also ^^;

    but i have fixed the appearance, finally made it to a smaller usable size with a decent working icon now too, horay!

    [​IMG] [​IMG]
    looks like this now, small compact, the shoulder mount seems to fit perfectly, all a super lucky guess at the positioning haha, but yeah, gonna take a look at the projectiles and use default stuff to test with.
     
  15. RyuujinZERO

    RyuujinZERO Supernova

    You should check the projectile name (inside the file) matches the projectile name in the file; to the letter (same capitalisation), seems most likely cause if it's not a JSON syntax issue. You might consider using a default bullet sprite, i mean, most of the default bullets seem perfectly serviceable.

    The gun looks really awesome now. Interestingly one of the canonical weapons i have planned for the avali is a rotary cannon too, although theirs is a railgun that rather than a traditional machinegun, but it has a rotary triple barrel configuration
     
  16. Dilrax

    Dilrax Ketchup Robot

    oh i think i just beat you to it this time :rofl:, was in the middle of typing the below and was about to post when i got your post, haha.
    ____
    defiantly getting somewhere, the "held" gun broke and turned into a generic cube again and the construct info card updated to this... gonna have to work out them stats down i think, haha
    but i got it working :D its a bit out of place with the muzzle flash which is not even on the gun (yet) but it does shoot, it does make a sound when it shoots, it can kill (hit birds already) just have to tweak the stats and fix the muzzleflash, also the projectiles are a bit... instant hit... where as normally you shoot and you can see it travel/move before hitting where as here its "bang-hit" ahhhahahaha... ^^; i think i can work this out on my own from here on, shouldn't be to much of a problem.

    [​IMG] [​IMG]

    but thank you, RyuujinZERO, for the time you spent to help little me out with my weapon construction, instead of using that time to work on your own mod which i know alot of people are excited... even if it was a small bit of help that you gave, you still helped me find and solve my problem and progress it further then i ever could on my own, so if there is anything i can do to possibly return the favour and/or help you out somewhere in some way, possibly weapon designs should you ever make any (although i might not be the best 8-bit artist, i do end up making the occasional good looking weapon), please by all means feel free to ask, i would be happy to help in what ever way i can.
     
  17. Dilrax

    Dilrax Ketchup Robot

    well the gun works fine, although its not perfect it still works well, and with that i would have to bring this chat to a close.
    thank you Jotagonist for your input at the beginning, it helped having an extra pair of eyes, and a big thanks to RyuujinZERO who helped me along the way.
     

Share This Page