Modding Help Need help with animations on *.thrownitem file

Discussion in 'Starbound Modding' started by PistolRcks, Jul 23, 2017.

  1. PistolRcks

    PistolRcks Void-Bound Voyager

    I've been fiddling with this for so long that it annoys me to no end. I'm trying to create an idle animation for a throwable item that I created, but it seems to not want to work at all. Here's the code.
    Code:
    {
      "globalTagDefaults" : {
        "paletteSwaps" : ""
      },
    
      "animatedParts" : {
        "stateTypes" : {
          "idle" : {
            "default" : "default",
            "states" : {
              "default" : {
                "frames" : 6,
                "cycle" : 0.6,
                "mode" : "loop"
              }
            }
          }
        }
      },
      "parts" : {
        "spell" : {
          "properties" : {
            "zLevel" : 0,
            "centered" : true,
            "fullbright" : true,
            "image" : "/items/throwables/kunaispell.png:<frame>",
            "offset" : [0, 0],
            "rotationCenter" : [0, 0],
            "transformationGroups" :  ["weapon"]
          }
        },
        "partStates" : {
          "spell" : {
            "idle" : {
              "properties" : {
                "image" : "/items/throwables/kunaispell.png:<frame>"
              }
            }
          }
        }
      },
    
      "transformationGroups" : {
        "weapon" : {}
      },
      "particleEmitters" : {
        "idleparticles" : {
          "active" : true,
          "transformationGroups" : ["weapon"],
          "emissionRate" : 10,
          "emissionRateVariance" : 5,
          "offsetRegion" : [0.25, 1.25, 0.75, 0.25],
          "particles" : [
            {
                "particle" : {
                  "type" : "animated",
                  "animation" : "/animations/kunaispelleffect/kunaispelleffect.animation",
                  "position" : [0, 0],
                  "initialVelocity" : [2.0, 0.0],
                  "finalVelocity" : [0, 0],
                  "approach" : [0, -4],
                  "destructionAction" : "shrink",
                  "destructionTime" : 5,
                  "fade" : 1,
                  "size" : 1,
                  "layer" : "back",
                  "timeToLive" : 0.6,
                  "variance" : {
                    "initialVelocity" : [0.0, 1.0],
                    "finalVelocity" : [0.0, 0.0],
                    "position" : [1,1],
                    "color" : [0,20,20,20]
                }
              }
            }
          ]
        }
      },
      "lights" : {
        "glow" : {
          "active" : true,
          "position" : [0.5, 1.5],
          "color" : [91, 209, 103],
          "flickerPeriod" : 1,
          "flickerMinIntensity" : 0.75,
          "flickerMaxIntensity" : 1.0,
          "flickerPeriodVariance" : 0.2,
          "flickerIntensityVariance" : 0.2
        }
      },
      "sounds" : {}
    }
    
    Also, kunaispelleffect.animation doesn't work, but that's a problem for another day.
    Just for kicks and giggles and not to mention clarification, here's the appropriate *.frames file, as well.

    Code:
    {
      "frameGrid" : {
        "size" : [8, 16],
        "dimensions" : [6, 1],
        "names" : [[ "default.0", "default.1", "default.2", "default.3", "default.4", "default.5" ]],
        "aliases" : {
          "default.default" : "default.0"
        }
      }
    }
    
    I am very frustrated at this and just want it to work.
     
  2. bk3k

    bk3k Oxygen Tank

    Your problem - at least the first I noticed right off - Is this. Your frames are
    Code:
    "default.0", "default.1", "default.2", "default.3", "default.4", "default.5"
    but you are referring in your animation to
    Code:
    "0", "1", "2", "3", "4", "5"
    If you changed it to
    Code:
    "image" : "/items/throwables/kunaispell.png:default.<frame>",
    then it would refer to the frames you actually have. <frame> is a tag that will be swapped. In this case swapped for numbers. That means
    "default.<frame>" will on frame one be "default.1" and so forth.

    Also note you don't have to use "default" if you don't want to. You can use whatever strings work for you. The period is also optional, but keeps things easy to read. Point is to make a literal strings match after the tags are swapped. And yes, you can define/swap your own tags, but not much point unless what you are animating is scripted.
     
    IHart likes this.
  3. PistolRcks

    PistolRcks Void-Bound Voyager

    Thank you so much! Sometimes things require just a tiny bit of proofreading.
     

Share This Page