Modding Help Animation on consumeables

Discussion in 'Starbound Modding' started by michealv, Dec 21, 2013.

  1. michealv

    michealv Industrial Terraformer

    I am wanting to add basic animation to a consumable item.

    I have a 24x8 PNG, with the image 8x8, I've coded in the frame information to the .consumable file, and also modified the .frame file.

    The problem I have is that the consumable item shows the entire .PNG.

    Is animation not possible with a consumable?

    Frame Coding:
    Code:
    {
    
      "frameGrid" : {
        "size" : [8, 8],
        "dimensions" : [3, 1],
        "names" : [
          [ "default.0", "default.1", "default.2" ]
        ]
      },
    
      "aliases" : {
        "default.default" : "default.0"
      }
    }
    
    Consumeable Coding:
    Code:
    {
      "itemName" : "testanimation",
      "rarity" : "rare",
      "inventoryIcon" : "testanimation.png",
      "description" : "A test animation...",
      "shortdescription" : "Test Animation",
      "frames" : "testanimation.png",
      "animationCycle" : 0.5,
      "frameNumber" : 3,
     
      "effects" : [ [
          {
            "kind" : "bandage",
            "amount" : 10
          }
        ] ],
      "emote" : "angry"
    }
    
     
  2. Karull

    Karull Big Damn Hero

    I haven't looked into it much myself, but from what I've played around with not everything supports animation, or atleast not everything supports animation in the same way. It may just need to be implemented differently, or it may not be possible at all (yet). In this case, I haven't been able to find a way to animate these kind of items.
     
  3. GhostUnitVII

    GhostUnitVII Scruffy Nerf-Herder

    OK when having a image, you need to separate the images you want to show. for example...

    XXX___XXX___XXX___

    Imagine the image is above, the frames you want to display are the X's and the _'s are empty space, when using images you have to have the same size empty space to cover the previous frame. Another example is off my CMC (Crescent moon cannon).

    {
    "frameGrid" : {
    "size" : [24, 24],
    "dimensions" : [4, 1]
    }
    }

    The image that i want to display is 24 x 24 pixels, and the dimensions are 4,1, which means 4 images, 1 row. 2 images have to be the animation effect, as for the other 2 are for the empty space.

    so for the 1st example the code would be.

    {
    "frameGrid" : {
    "size" : [3, 1], (3 x's in 1 row of pixels)
    "dimensions" : [6, 1] 3rows of x's and empty space which ='s the length of the image to 6 spaces that should be displayed.
    }
    }

    after that you would want to set the offset in your animation file, with the frames you plan to use.

    here is another file from the CMC Prototype cannon...

    {
    "frames" : "CMC_MF.png",
    "variants" : 1,
    "frameNumber" : 4,
    "animationCycle" : 0.03,
    "offset" : [15, -1]
    }

    frame numbers = the "dimensions" length of "[4, 1]" for the X values which are 4 = X, 1 = Y.
    animation Cycle is the speed of the animation...
    and the Offset is a touchy area, it determines the area where the animation takes place, and how it is displayed on the item, this setup requires you to experiment each setting till you get it right, usually I use old reference files to help me determine where I want the animation to occur.


    I hope this helps.

    Ghost-
     
    Daniel345 likes this.

Share This Page