Modding Help Creating a Projectile

Discussion in 'Starbound Modding' started by Dukke, Aug 17, 2016.

  1. Dukke

    Dukke Void-Bound Voyager

    So, I created an rocket launcher, and it's working, but now I need a custom projectile. Well, I've done the sprites, the script but, somehow, It doesn't works and the launcher shoots nothing. I don't know if I have to sign it in hte player.config.path likeI did with the gun. If it is, how can I do it? Also, how can I make the custom .frames works too?
     
  2. Dukke

    Dukke Void-Bound Voyager

    Bump because I'm really needing it and can't find help
     
  3. Wheee321

    Wheee321 Subatomic Cosmonaut

    Hello,
    you need a projectile.frames, projectile.png (the sprites) and .projectile file to make it work,
    it would help to show your logfile, my projectile didnt work once, because of typing error and this shows easily up in a logfile

    the .frames file has to have the same name as the .projectile file
    just copy an existing one, rename it and change it to your needs

    the important values are:
    "size" : [length of one frame, height of one frame] defines the size of one frame
    "dimensions" : [count in a row, quantity of rows]

    I hope that helps
     
  4. Dukke

    Dukke Void-Bound Voyager

    Here's the .projectile

    Code:
    {
      "projectileName" : "dnrocket",
      "image" : "dnrocket.png",
      "animationCycle" : 0.2,
      "frameNumber" : 4,
      "damageKindImage" : "icon.png",
      "lightColor" : [255, 255, 128],
      "pointLight" : true,
      "actionOnReap" : [
        {
          "action" : "config",
          "file" : "/projectiles/explosions/regularexplosion2/regularexplosionknockback.config"
        }
      ],
      "statusEffects" : [ ],
      "emitters" : [ "rocketsmoke" ],
      "flippable" : true,
      "power" : 10.0,
      "speed" : 1.0,
      "acceleration" : 150,
      "physics" : "dnrocket",
      "damageType" : "NoDamage",
      "damageKind" : "default"
    }
    
    
    And the .frame


    Code:
    {
      "frameGrid" : {
        "size" : [20, 7],
        "dimensions" : [4, 1],
    
        "names" : [
          [ "0", "1", "2", "3" ]
        ]
      }
    }
    
    Ps: Code edited duo mistake


    They adress: dkrpg\projectiles\guns\rocket
     
    Last edited: Aug 19, 2016
  5. Wheee321

    Wheee321 Subatomic Cosmonaut

    Your .projectile seems more like a .activeitem file

    look at other .projectile files, they look more like this:
    acidexplosion.projectile for instance(\_unpacked\projectiles\acidexplosion):
    Code:
    {
      "projectileName" : "acidexplosion",
      "image" : "acidexplosion.png",
      "animationCycle" : 0.3,
      "frameNumber" : 5,
      "speed" : 0,
      "damagePoly" : [ [-16, 0], [-10, -10], [0, -16], [10, -10], [16, 0], [10, 10], [0, 16], [-10, 10] ],
      "animationLoops" : false,
      "piercing" : true,
      "flippable" : true,
      "damageKind" : "acid"
    }
    
    so you have to add a dnrocket.projectile file similiar to the acidexplosion content
     
  6. Dukke

    Dukke Void-Bound Voyager

    Oh crap! Sorry! Wrnog file! This is the right one

     
  7. Wheee321

    Wheee321 Subatomic Cosmonaut

    Hmm, could you please start a game, and use your weapon, after this post your logfile (\starbound\storage\starbound.log) here please, that would help alot
     
  8. Dukke

    Dukke Void-Bound Voyager

    Here is:


    Code:
    [12:03:40.754] [Info] UniverseClient: Joined server as client 1
    [12:03:57.502] [Info] UniverseServer: Warping player 1 to ClientShipWorld:771d6b908ba36fb38b438d48ce9e1326=1067.2.1024.31
    [12:05:07.593] [Error] Could not load image asset '/items/active/weapons/ranged/gun/default', using placeholder default.
    (AssetException) No such asset '/items/active/weapons/ranged/gun/default'
    [12:05:23.633] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    [12:05:23.788] [Error] Could not load image asset '/items/active/weapons/ranged/gun/default:2.2', using placeholder default.
    (AssetException) No associated frames file found for image '/items/active/weapons/ranged/gun/default' while resolving image frame '/items/active/weapons/ranged/gun/default:2.2'
    [12:05:28.092] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    [12:05:29.347] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    [12:05:29.384] [Error] Could not load image asset '/items/active/weapons/ranged/gun/default:3.2', using placeholder default.
    (AssetException) No associated frames file found for image '/items/active/weapons/ranged/gun/default' while resolving image frame '/items/active/weapons/ranged/gun/default:3.2'
    [12:05:32.164] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    [12:05:32.195] [Error] Could not load image asset '/items/active/weapons/ranged/gun/default:1.2', using placeholder default.
    (AssetException) No associated frames file found for image '/items/active/weapons/ranged/gun/default' while resolving image frame '/items/active/weapons/ranged/gun/default:1.2'
    [12:05:35.080] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    [12:05:40.216] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    [12:05:43.860] [Warn] Could not spawn Projectile of type 'dnrocket', exception caught: (ProjectileDatabaseException) Unknown projectile with typeName dnrocket.
    
     
  9. Dukke

    Dukke Void-Bound Voyager

    Lol I made it worked now. Thanks anyway
     
  10. Wheee321

    Wheee321 Subatomic Cosmonaut

  11. Lemon drops

    Lemon drops Scruffy Nerf-Herder

    I have a similar problem and it says it had an error loading because it cannot parse json file. do you know what might be wrong?
     
  12. matthew57778

    matthew57778 Phantasmal Quasar

    how did you solve the unknown projectile with typename error?
     

Share This Page