Modding Help Gun modding,need help :(

Discussion in 'Starbound Modding' started by Babelrap, Aug 7, 2014.

  1. Babelrap

    Babelrap Subatomic Cosmonaut

    So i was trying to make a mod of a plasma pistol (i think using some outdated tutorial because i couldn't find any other gun modding tutorial,so that might be the problem) and when i thought i was done i started up starbound and got this error...

    Error: StarException: An error occurred during loading: VariantException: Improper conversion to double from string in get("power")
    float Variant::tget<float>(String, float)
    Variant::getFloat(String, float)
    ProjectileDatabase::readConfig(String)
    ProjectileDatabase::load()
    Root::reload()
    _Function_handler<void (), _Bind<ClientApplication::preSplashInitialization()::{lambda()#1} ()> >::(_Any_data)
    ThreadImpl::runThread(void*)
    BaseThreadInitThunk
    RtlInitializeExceptionChain
    RtlInitializeExceptionChain

    ClientApplication::postSplashInitialization()
    ClientApplication::update()
    StarApplicationBase::run()
    _SDL_main
    _console_main

    Anyone know what this means? I'm pretty new at modding so idk.
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    More than likely you put quotes around a number - in the power variable
     
    severedskullz likes this.
  3. Babelrap

    Babelrap Subatomic Cosmonaut

    ah ok i'll see if that's the problem
     
  4. The | Suit

    The | Suit Agent S. Forum Moderator

  5. Babelrap

    Babelrap Subatomic Cosmonaut

    thanks
     
  6. Babelrap

    Babelrap Subatomic Cosmonaut

    i fixed the problem but now i'm getting this

    Error: Could not load /projectiles/lastresortprojectile/lastresort.projectile asset, attempting to use default.
    AssetException: Could not read variant asset /projectiles/lastresortprojectile/lastresort.projectile
    caused by: JsonParsingException: Cannot parse json file: /projectiles/lastresortprojectile/lastresort.projectile
    caused by: JsonParsingException: Error parsing json: bad object, should be '}' or ',' at 3:1

    this is from the starbound.log
     
  7. sayter

    sayter The Waste of Time

    That means you have a problem in line 3 of your script.

    It's missing a } or a ,

    Usually that means you forgot a " , " at the end of the line.


    post the entire script here in a CODE bubble (click the icon that look slike a piece of paper with a <> in it on the forum post area. Then paste your code)

    we can't help for sure until we can see that.
     
  8. Babelrap

    Babelrap Subatomic Cosmonaut

    Code:
    {
    "projectileName" : "LastResortProjectile"
    "physics" : "laser"
    "bounces" : 0
    "level" : 3
    "energyCostPerDamagePoint" : 155
    "damageKindImage" : "LastResortProjectileicon.png"
    "frames" : "LastResortProjectile.png"
    "animationCycle" : 0.2
    "frameNumber" : 2
    "power" : 5000
    "supportsProcessing" : true
    "actionOnReap" : [{"action" : "config","file" : "/projectiles/explosions/plasmabulletexplosion/plasmabulletexplosion.config"}]
    "lightColor" : [155, 212, 255]
    "damageKind" : "plasma"
    }
    There it is(it probably looks like a mess though,this is my first mod that i started pretty much yesterday).
     
  9. sayter

    sayter The Waste of Time

    well, there's your problem.

    every line except the last one and the closing } needs to have a , beside it. Otherwise it will error out.

    Like so:

    Code:
    {
    "projectileName" : "LastResortProjectile",
    "physics" : "laser",
    "bounces" : 0,
    "level" : 3,
    "energyCostPerDamagePoint" : 155,
    "damageKindImage" : "LastResortProjectileicon.png",
    "frames" : "LastResortProjectile.png",
    "animationCycle" : 0.2,
    "frameNumber" : 2,
    "power" : 5000,
    "supportsProcessing" : true,
    "actionOnReap" : [{"action" : "config","file" : "/projectiles/explosions/plasmabulletexplosion/plasmabulletexplosion.config"}],
    "lightColor" : [155, 212, 255],
    "damageKind" : "plasma"
    }
    
     
  10. Babelrap

    Babelrap Subatomic Cosmonaut

    Huh, i thought i had to get rid of those for some reason,thanks.
     
  11. Babelrap

    Babelrap Subatomic Cosmonaut

    Ok, so i'm still getting the same error here,and i'm looking at an example file from the tutorial i mentioned and it doesn't even have the "physics" or "bounces" part in it,should i just go ahead and get rid of those or are they ok?
     
  12. The | Suit

    The | Suit Agent S. Forum Moderator

    Don't read old tutorials.
    That is like still believing the world is still flat.
     
  13. Babelrap

    Babelrap Subatomic Cosmonaut

    Yeah, that was a bad idea,but it was was the only one relating to weapons that i could find.
     
  14. Babelrap

    Babelrap Subatomic Cosmonaut

    Well, guns specifically.
     
  15. The | Suit

    The | Suit Agent S. Forum Moderator

    Nightly supports live edits in admin mode.
    just type /reload with admin mode active. And respawn a new gun to see the changes.

    That way you can quickly see the what each line does - without qutting and reloading the game each time
     
  16. Babelrap

    Babelrap Subatomic Cosmonaut

    Actually these problems happen when i try to start up the game,like while it's loading.Also,how do you do nightly?
     
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    Right click on SB in steam - properties --> betas --> nightly
     
  18. Babelrap

    Babelrap Subatomic Cosmonaut

    Ok! Through much trial and JSON errors i've finally stopped crashing at startup,but now it's just showing up as a perfectly generic item for some reason,also nightly build doesn't work for me(I'm running this on the 3D analyser so that's probably why...).
     
  19. The | Suit

    The | Suit Agent S. Forum Moderator

    When you get a PGI - just quit the game and check your starbound.log
    it will tell you why it is a PGI.

    Modding is 50% starbound.log 50% developing.
     
    BitHorizon likes this.
  20. BitHorizon

    BitHorizon Ketchup Robot

    Fixed that for you.

    Also, for the OP, if the Starbound.log cannot "read variant asset", try running the unreadable file through http://jsonlint.com/

    This site automatically checks for errors in JSON files.
     

Share This Page