Modding Help Animation help

Discussion in 'Starbound Modding' started by Regn7, Apr 27, 2015.

  1. Regn7

    Regn7 Void-Bound Voyager

    Hi, I've only just begun learning modding in Starbound, however have modding experience in other games. I'm making a new object that is purely decorative and am having trouble understanding the .frames file and .animation file.

    So I want the object to be animated normally when idle, but when interacted with it will alter animations. Sounds pretty simple, but a transition animation is to be played in between altered states. I was basing my object off the apex console keyboard. It has its off state, switching on and off animations and on. The only difference with my object is the off and on are both animated.

    So I've named all my frames in the .frames file, and am having trouble understanding the "alias". For some reason my object is playing 4 random frames that are meant to be transition frames, rather than 'idle' frames. Also my object doesn't seem to be intractable for some reason. When I mouse over it, it doesn't highlight or anything. Is there some script somewhere I need to put my object name into for it to be intractable?
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Without seeing the code for each, really hard to tell you where the mistake lies.
     
  3. Regn7

    Regn7 Void-Bound Voyager

    Sorry for taking ages to reply. So far it's just a giant eyeball that opens in the wall and looks around when you interact with it. It's mostly a test object for the moment as I'm learning to get the hang of modding this game.

    The object file

    {
    "objectName" : "testobject",
    "rarity" : "Common",
    "category" : "decorative",
    "price" : 900,
    "description" : "description",
    "shortdescription" : "description",
    "race" : "generic",

    "apexDescription" : "What monstrous process is this?",
    "avianDescription" : "What monstrous process is this?",
    "floranDescription" : "What monstrous process is this?",
    "glitchDescription" : "What monstrous process is this?",
    "humanDescription" : "What monstrous process is this?",
    "hylotlDescription" : "What monstrous process is this?",

    "inventoryIcon" : "testobjecticon.png",
    "orientations" : [
    {
    "image" : "testobjecticon.png:<color>.closed",
    "imagePosition" : [-35, -28],
    "frames" : 23,
    "animationCycle" : 0.25,

    "spaceScan" : 0.1,
    "anchors" : [ "background" ]
    }
    ]
    }

    Objects .frames file. There are 4 frames that are played when the eye is closed, 7 frames when it opens, 4 frames when it's open, and 7 frames when it closes again. I have no idea if the aliases are even set up correctly.

    {
    "frameGrid" : {
    "size" : [103, 60],
    "dimensions" : [23, 1],
    "names" : [
    [ "closed.0", "closed.1", "closed.2", "closed.3", "opening.0", "opening.1", "opening.2", "opening.3", "opening.4", "opening.5", "opening.6", "open.0", "open.1", "open.2", "open.3", "closing.0", "closing.1", "closing.2", "closing.3", "closing.4", "closing.5", "closing.6" ]
    ]
    },
    "aliases" : {
    "default.closed" : "closed.0",
    "default.open" : "open.0",
    "openingeye.1" : "opening.0",
    "closingeye.1" : "closing.0"
    }
    }

    I've also got an animation file but I have no idea if it even does anything. I also can't interact with the item at all, usually objects like doors highlight when you mouse over them but this doesn't, so I'm not sure how to make it do that.
     
    Last edited: May 1, 2015
  4. The | Suit

    The | Suit Agent S. Forum Moderator

    Ah....
    The thing is JSON by it self can't do what you want.
    The animation file only works if you use a Lua file to set each state.

    You are unfortunately going to need to add a Lua script to do what you want to do.
    If you go to objects --> wired --> door you will see how doors work.
    Also if you open any door you will see the script and reference to the door.lua file.

    ==
    Otherwise at most you can do with JSON is make the eye just play animation constantly like stone furnace or the robotic crafting table.
     

Share This Page