Modding Help Help me correcting my mistakes in this mod, please

Discussion in 'Starbound Modding' started by jpvi1207, May 30, 2014.

  1. jpvi1207

    jpvi1207 Aquatic Astronaut

    hello, after reading a guide of how to do some modding, i tried it out myself, but i just cant simply make my weapon mod work, im kinda desperate and ive been trying for quite a while, i literally feel like punching through the monitor and if i can just get my weapon mod right ill be happy

    TLDR: need help finding my own mistakes in the mod, it crashes the game, and it wont let me upload any of the archives to the forums, so maybe i could give it through a e-mail or some other way for someone to revise it
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

  3. prodamn

    prodamn Spaceman Spiff

    a crashlog maybe ? doesn't require uploading at all, just throw it in as
    Code:
     code 
     
  4. jpvi1207

    jpvi1207 Aquatic Astronaut

    Error: Could not load /staff/wizard weapon.gun asset, attempting to use default.
    AssetException: Could not read variant asset /staff/wizard weapon.gun
    caused by: JsonParsingException: Cannot parse json file: /staff/wizard weapon.gun
    caused by: JsonParsingException: Error extra data at end of input at 27:1
    Variant inputUtf8Json<char*>(char*, char*, bool)
    Assets::readVariant(String)
    _Function_handler<shared_ptr<Assets::AssetData> (), Assets::loadVariant(String)::{lambda()#1}>::(_Any_data)
    Assets::processAssetData(function<shared_ptr<Assets::AssetData> ()>)
    Assets::loadVariant(String)
    Assets::loadAsset(Assets::AssetId)
    Assets::doLoad(Assets::AssetId)
    Assets::workerMain()
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain


    and then this

    Error: Could not instantiate item '[Wizard weapon, 1, {}]'. ItemException: No such item 'Wizard weapon'
    ItemDatabase::itemData(String)
    ItemDatabase::createItem(ItemDescriptor)
    ItemDatabase::item(ItemDescriptor)
    Recipe::Recipe(Variant)
    RecipeDatabase::parseRecipe(Variant)
    RecipeDatabase::scan()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain

    Error: Could not instantiate item '[Wizard weapon, 1, {}]'. ItemException: No such item 'Wizard weapon'
    ItemDatabase::itemData(String)
    ItemDatabase::createItem(ItemDescriptor)
    ItemDatabase::item(ItemDescriptor)
    ItemDatabase::addItemBlueprint(ItemDescriptor)
    RecipeDatabase::scan()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain

    Error: Could not instantiate item '[Wizard weapon, 1, {}]'. ItemException: No such item 'Wizard weapon'
    ItemDatabase::itemData(String)
    ItemDatabase::createItem(ItemDescriptor)
    ItemDatabase::item(ItemDescriptor)
    ItemDatabase::addItemBlueprint(ItemDescriptor)
    RecipeDatabase::scan()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain
     
  5. prodamn

    prodamn Spaceman Spiff

    Code:
    Error: Could not load /staff/wizard weapon.gun asset, attempting to use default.
    AssetException: Could not read variant asset /staff/wizard weapon.gun
    caused by: JsonParsingException: Cannot parse json file: /staff/wizard weapon.gun
    caused by: JsonParsingException: Error extra data at end of input at 27:1
    Variant inputUtf8Json<char*>(char*, char*, bool)
    Assets::readVariant(String)
    _Function_handler<shared_ptr<Assets::AssetData> (), Assets::loadVariant(String)::{lambda()#1}>::(_Any_data)
    Assets::processAssetData(function<shared_ptr<Assets::AssetData> ()>)
    Assets::loadVariant(String)
    Assets::loadAsset(Assets::AssetId)
    Assets::doLoad(Assets::AssetId)
    Assets::workerMain()
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain
    

    this is the important part

    now! something in the wizard weapon.gun file is causing it.

    Code:
    Error: Could not load /staff/wizard weapon.gun asset, attempting to use default.
    AssetException: Could not read variant asset /staff/wizard weapon.gun
    caused by: JsonParsingException: Cannot parse json file: /staff/wizard weapon.gun
    caused by: JsonParsingException: Error extra data at end of input at 27:1



    extra data? did you set the brackets right and or maybe set commas ?

    would be easier to figure out if you could show us the code of the wizard weapon.gun.
     
  6. jpvi1207

    jpvi1207 Aquatic Astronaut

    heres the weapon.gun file
    {
    "itemName" : "Wizard weapon",
    "inventoryIcon" : "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\mods\Wizards Weapon\Staff\Wizard Weapon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "rarity" : "Legendary",

    "image" : "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\mods\Wizards Weapon\Staff\Wizard Weapon.png",

    "handPosition" : [1, -3],
    "firePosition" : [5, 1.5],

    "fireTime" : 0.01,
    "twoHanded" : true,

    "projectileType" : "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\mods\Wizards Weapon\Projectiles\rainbowprojectile.projectile",
    "projectile" : {
    "speed" : 60,
    "life" : 3,
    "color" : [255, 10, 10]
    },

    "muzzleEffect" : {
    "animation" : "/mods/Wizards weapon/Animation/rainbowbubble.animation"}, "fireSound" : [
    { "file" : "mods/Wizards Weapon/sfx/Europe - The Final Countdown.wav" } ]
    }
    }
     
  7. prodamn

    prodamn Spaceman Spiff

    What a mess! xD


    Code:
    {
    "itemName" : "Wizard weapon",
    "inventoryIcon" : "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\mods\Wizards Weapon\Staff\Wizard Weapon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "rarity" : "Legendary",
    
    "image" : "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\mods\Wizards Weapon\Staff\Wizard Weapon.png",
    
    "handPosition" : [1, -3],
    "firePosition" : [5, 1.5],
    
    "fireTime" : 0.01,
    "twoHanded" : true,
    
    "projectileType" : "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\mods\Wizards Weapon\Projectiles\rainbowprojectile.projectile",
    "projectile" : {
    "speed" : 60,
    "life" : 3,
    "color" : [255, 10, 10]
    },
    
    "muzzleEffect" : {
    "animation" : "/mods/Wizards weapon/Animation/rainbowbubble.animation"}, "fireSound" : [
    { "file" : "mods/Wizards Weapon/sfx/Europe - The Final Countdown.wav" } ]
    }
    }
    why are you specifying the filepaths like that ? o0

    the root folder for starbound is the assets folder...
    which would be mods(the actual mod folder itself) in this case

    i belive you don't really need a filepath for the icons, i'm afraid.
    same for the projectile you ONLY need the projectile type not the whole file name.

    so first we fix that:

    Code:
    {
    "itemName" : "Wizard weapon",
    "inventoryIcon" : "Wizard Weapon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "rarity" : "Legendary",
    
    "image" : "Wizard Weapon.png",
    
    "handPosition" : [1, -3],
    "firePosition" : [5, 1.5],
    
    "fireTime" : 0.01,
    "twoHanded" : true,
    
    "projectileType" : "rainbowprojectile,
    "projectile" : {
    "speed" : 60,
    "life" : 3,
    "color" : [255, 10, 10]
    },    <----- line 21!!!!
    
    "muzzleEffect" : {
    "animation" : "/Animation/rainbowbubble.animation"
    },   <----- wrong!
    "fireSound" : [
    { "file" : "/sfx/Europe - The Final Countdown.wav" }
    ]
    }
    }
    now it's saying extra data after line 21..

    line 21 would be "},"

    "animation" is irritating me, oh there it is! you don't need "}," after animation

    although, animation ? is this a thing ? i only found it in 1 file, "ptester" that's it.


    all in all the code would like this in the end:

    Code:
    {
    "itemName" : "Wizard weapon",
    "inventoryIcon" : "Wizard Weapon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "rarity" : "Legendary",
    
    "image" : "Wizard Weapon.png",
    
    "handPosition" : [1, -3],
    "firePosition" : [5, 1.5],
    
    "fireTime" : 0.01,
    "twoHanded" : true,
    
    "projectileType" : "rainbowprojectile,
    "projectile" : {
    "speed" : 60,
    "life" : 3,
    "color" : [255, 10, 10]
    },
    
    "muzzleEffect" : {
    "animation" : "/Animation/rainbowbubble.animation",
    "fireSound" : [ { "file" : "/sfx/Europe - The Final Countdown.wav" } ]
    }
    }
    i hope that's it, try it out!
     
    Last edited: May 30, 2014
  8. jpvi1207

    jpvi1207 Aquatic Astronaut

    Error: Could not load /staff/wizard weapon.gun asset, attempting to use default.
    AssetException: Could not read variant asset /staff/wizard weapon.gun
    caused by: JsonParsingException: Cannot parse json file: /staff/wizard weapon.gun
    caused by: JsonParsingException: Error parsing json: bad object, should be '}' or ',' at 17:2
    Variant inputUtf8Json<char*>(char*, char*, bool)
    Assets::readVariant(String)
    _Function_handler<shared_ptr<Assets::AssetData> (), Assets::loadVariant(String)::{lambda()#1}>::(_Any_data)
    Assets::processAssetData(function<shared_ptr<Assets::AssetData> ()>)
    Assets::loadVariant(String)
    Assets::loadAsset(Assets::AssetId)
    Assets::doLoad(Assets::AssetId)
    Assets::workerMain()
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain
     
  9. prodamn

    prodamn Spaceman Spiff

    ooops, see i forgot the " after
    "rainbowprojectile, :p

    Code:
    {
    "itemName" : "Wizard weapon",
    "inventoryIcon" : "Wizard Weapon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "rarity" : "Legendary",
    
    "image" : "Wizard Weapon.png",
    
    "handPosition" : [1, -3],
    "firePosition" : [5, 1.5],
    
    "fireTime" : 0.01,
    "twoHanded" : true,
    
    "projectileType" : "rainbowprojectile",
    "projectile" : {
    "speed" : 60,
    "life" : 3,
    "color" : [255, 10, 10]
    },
    
    "muzzleEffect" : {
    "animation" : "/Animation/rainbowbubble.animation",
    "fireSound" : [ { "file" : "/sfx/Europe - The Final Countdown.wav" } ]
    }
    }
     
  10. jpvi1207

    jpvi1207 Aquatic Astronaut

    k that fixed my .gun file, but this still is failing
    Error: Could not instantiate item '[Wizard weapon, 1, {}]'. MapException: Key 'power' not found in Map::get()
    Map<String, Variant, unordered_map<String, Variant, hash<String, void>, equal_to<String>, allocator<pair<String, Variant> > > >::get(String)
    Gun::Gun(Variant, String)
    GunFactory::instance(Variant, String, Variant)
    ItemDatabase::createItem(ItemDescriptor)
    ItemDatabase::item(ItemDescriptor)
    Recipe::Recipe(Variant)
    RecipeDatabase::parseRecipe(Variant)
    RecipeDatabase::scan()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain

    Error: Could not instantiate item '[Wizard weapon, 1, {}]'. MapException: Key 'power' not found in Map::get()
    Map<String, Variant, unordered_map<String, Variant, hash<String, void>, equal_to<String>, allocator<pair<String, Variant> > > >::get(String)
    Gun::Gun(Variant, String)
    GunFactory::instance(Variant, String, Variant)
    ItemDatabase::createItem(ItemDescriptor)
    ItemDatabase::item(ItemDescriptor)
    ItemDatabase::addItemBlueprint(ItemDescriptor)
    RecipeDatabase::scan()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain

    Error: Could not instantiate item '[Wizard weapon, 1, {}]'. MapException: Key 'power' not found in Map::get()
    Map<String, Variant, unordered_map<String, Variant, hash<String, void>, equal_to<String>, allocator<pair<String, Variant> > > >::get(String)
    Gun::Gun(Variant, String)
    GunFactory::instance(Variant, String, Variant)
    ItemDatabase::createItem(ItemDescriptor)
    ItemDatabase::item(ItemDescriptor)
    ItemDatabase::addItemBlueprint(ItemDescriptor)
    RecipeDatabase::scan()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain
     
  11. prodamn

    prodamn Spaceman Spiff

    you're missing the "power" entry.


    blwergh. this is obnoxious.
    let's see xD

    Code:
    {
    "itemName" : "Wizard weapon",
    "inventoryIcon" : "Wizard Weapon.png",
    "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
    "maxStack" : 1,
    "rarity" : "Legendary",
    
    "image" : "Wizard Weapon.png",
    
    "handPosition" : [1, -3],
    "firePosition" : [5, 1.5],
    
    "fireTime" : 0.01,
    "twoHanded" : true,
    
    "projectileType" : "rainbowprojectile",
    "projectile" : {
    "speed" : 60,
    "power" : 6,
    "life" : 3,
    "color" : [255, 10, 10]
    },
    
    "muzzleEffect" : {
    "animation" : "/Animation/rainbowbubble.animation",
    "fireSound" : [ { "file" : "/sfx/Europe - The Final Countdown.wav" } ]
    }
    }
    you'd have to adjust "power" to your needs, 6 may not serve your likes.

    we'll figure it out! the tutorial you used may be outdated, be sure to use an up to date one next time ;)
     
  12. jpvi1207

    jpvi1207 Aquatic Astronaut

    sorry im VERY new to this, basically you are kinda like my master right now, thanks for pointing out my mistakes,

    alright no errors in the log, though it wont appear as craftable, maybe my .recipe file is written wrong, ill leave it here

    {
    "input" : [
    { "item" : "money", "count" : 750 }
    ],
    "output" : {
    "item" : "Wizard weapon",
    "count" : 1
    },
    "groups" : [ "metalworkstation", "objects", "all", "other" ]
    }
     
  13. prodamn

    prodamn Spaceman Spiff

    nope that's good.

    maybe you're coming across the same problem as i did, when i first started with this, i made a crafting table told the game the recipe etc. but it wasn't showing up.


    it took me like forever to figure out what was going on, i told the game that i want this item/object to be there. But the game didn't tell me that i can make this object^^

    so what you want to do is, the easiest way, copy the player.config file, delete everything in it and add a merge command which adds the recipe to craft this tool/weapon to the first tier.

    if you'd add it to the 2nd for instance you'd have to start a new character, anyhow if you add it to the first you don't.

    Anyway. You will have to put the player.config(which was copied and edited before) in /mods/YOURMODNAME/


    Code:
    {
        "__merge": [],
      "defaultBlueprints" : {
        "tier1" : [
          { "item" : "YOUR WEAPON RECIPE NAME HERE" },
        ]
    }
    }

    this should unlock the recipe once you load your character.

    if you're coming across errors again remove the comma after

    { "item" : "YOUR WEAPON RECIPE NAME HERE" },

    so:


    Code:
    {
        "__merge": [],
      "defaultBlueprints" : {
        "tier1" : [
          { "item" : "YOUR WEAPON RECIPE NAME HERE" }
        ]
    }
    }
    i took the code from one of my mods and just deleted everything after the 1st entry. :p
    didn't think about it
     
    Last edited: May 31, 2014
  14. jpvi1207

    jpvi1207 Aquatic Astronaut

    ok it works, one problem im finding now is the transparency, i tried working with both white and black as a transparent background in the png., but they dont work as intended, i use paint tool SAI for this, i cant install any other program because i dont have the administrator permission thing in my user, so it would be awesome if i could get some help with this or you could give me a tip for how to make the layers transparent
     

    Attached Files:

  15. sayter

    sayter The Waste of Time

    Just don't put a background.

    I have no idea what SAI is, but there is bound to be some way to simply delete the background, keeping only the sprite. I use photoshop for everything, and this is default behavior for new layers there.

    Then simply save it out as a png, as you are already doing. PNG supports transparency by default.
     
  16. The | Suit

    The | Suit Agent S. Forum Moderator

    Transparent means Transparent. White and black are opaque.
    There should absolutely no colour data in the background.

    We haven't used colour identification as transparent layer since the 90's.
    [Unless your working with Video - in that case Green screen is only around because reality prevents such an option ]
     
    Icyblue likes this.
  17. prodamn

    prodamn Spaceman Spiff

    Many people also work with a blue screen not just green screens, whatever the chromakey can erase every color. But as the 2 above already stated, i don't have a clue about SAI, i used it before but i don't get along with it, just dont put a backround. Or use the magic wand to remove the white.

    well, this doesn't work like that. you can't just remove the white, you will have to redo the sprites.

    eg, the rainbowbubble, colors like super super light blue, nearly white will look stupid when removing the white.

    that's the best i can get from it, the whole graphic is semi-transparent

    rainbowbubble1.png
     
    Last edited: Jun 3, 2014
  18. jpvi1207

    jpvi1207 Aquatic Astronaut

    ok so, i guess the basic knowledge i have of using SAI is zero, how to NOT white background?
     
  19. prodamn

    prodamn Spaceman Spiff

    @xxswatelitexx you don't have an tutorial for SAI, do you ? :p

    the easiest solution really is to swap programs, try using Paint.net maybe ?
     
    Last edited: Jun 7, 2014
    The | Suit likes this.
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    None of us work with SAI so you are on your own.
    I am profeccient in PS 7 - current. While I know a bit of GIMP for those who want a free option to image editing.
    http://gimp.org/

    I have written several tutorials for creating images - 2 of which on the forums which code wise is outdated. But the instructions to use gimp to make images is not.
    http://community.playstarbound.com/...pixel-art-and-putting-it-into-the-game.57153/

    Keep in mind don't bother reading the code aspect of it - just read upto the part where it shows you how to make the image.
    The tutorial is currently being rewritten for starbounder website - but still not completed.
     

Share This Page