Modding Help Trouble with flickering animation on object

Discussion in 'Starbound Modding' started by Silverforte, Feb 28, 2015.

  1. Silverforte

    Silverforte Spaceman Spiff

    Made this:

    Code:
    {
      "objectName" : "pistgen",
      "rarity" : "Common",
      "description" : "A monitor. But who monitors the monitor?",
      "shortdescription" : "Outpost Monitor",
      "race" : "generic",
    
      "category" : "decorative",
      "price" : 500,
      "lightColor" : [92, 133, 153],
      "flickerDistance" : 0.2,
      "flickerStrength" : 0.05,
      "flickerTiming" : 4,
    
      "apexDescription" : "A monitor. I can't read what it says here.",
      "avianDescription" : "Ah, this old classic! Better not repeat what it says.",
      "floranDescription" : "Floran think this sssay; Haloom kissface plant. Ssshudder.",
      "glitchDescription" : "Amusement. This monitor is displaying the lyrics to a bawdy Avian folk song.",
      "humanDescription" : "I don't understand what it says but it's making me giggle.",
      "hylotlDescription" : "Another language.",
    
      "inventoryIcon" : "icon.png",
      "orientations" : [
        {
          "image" : "pistgen.png:<color>.<frame>",
          "imagePosition" : [-16, -8],
          "flipImages" : true,
          "direction" : "left",
    
          "spaceScan" : 0.1,
          "anchors" : [ "background" ]
        },
        {
          "image" : "pistgen.png:<color>.<frame>",
          "imagePosition" : [-16, -8],
          "direction" : "right",
    
          "spaceScan" : 0.1,
          "anchors" : [ "background" ]
        }
      ],
    
      "soundEffect" : "/sfx/objects/outpostmonitor_static.wav",
      "soundEffectRadius" : 15,
    
      "animation" : "pistgen.animation",
      "animationParts" : {
        "bg" : "pistgen.png",
        "fg" : "pistgen.png"
      },
      "animationPosition" : [-16, -8],
    
      "scripts" : [ "/objects/wired/light/light.lua" ],
      "scriptDelta" : 60,
    
      "inboundNodes" : [ [0, 0] ]
    
    }
    
    It's a static object called a Piston Generator. It has 17 frames of animation. When I place it down, it flickers.

    .animation file:

    Code:
    {
      "animatedParts" : {
        "stateTypes" : {
          "light" : {
            "default" : "off",
            "states" : {
              "off" : {},
              "on" : {
                "frames" : 17,
                "cycle" : 0.3,
                "mode" : "loop"
              }
            }
          }
        },
    
        "parts" : {
          "bg" : {
            "properties" : {
              "centered" : false
            },
    
            "partStates" : {
              "light" : {
                "off" : {
                  "properties" : {
                    "image" : "<partImage>:<color>.off"
                  }
                },
    
                "on" : {
                  "properties" : {
                    "image" : "<partImage>:<color>.<frame>",
                    "fullbright" : true
                  }
                }
              }
            }
          },
          "fg" : {
            "properties" : {
              "centered" : false,
              "zLevel" : 1
            },
    
            "partStates" : {
              "light" : {
                "off" : {
                  "properties" : {
                    "image" : "<partImage>:<color>.off"
                  }
                },
    
                "on" : {
                  "properties" : {
                    "image" : "<partImage>:<color>.<frame>"
                  }
                }
              }
            }
          }
        }
      }
    }
    
    And finally, .frames file:

    Code:
    {
      "frameGrid" : {
        "size" : [36, 126],
        "dimensions" : [17, 1],
        "names" : [
          [ "default.1", "default.2", "default.3", "default.4", "default.5", "default.6", "default.7", "default.8", "default.9", "default.10", "default.11", "default.12", "default.13", "default.14", "default.15", "default.16", "default.off" ]
        ]
      },
    
      "aliases" : {
        "default.default" : "default.off"
      }
    }
    
    No matter what I do, I cannot get it to stop flickering. I suspect the issue is in the .animation file. Any ideas? It appears to flicker once at the end of the animation before looping.
     
    Last edited: Feb 28, 2015
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    add
    "frames" : 16

    inside each orientation array
     
  3. Silverforte

    Silverforte Spaceman Spiff

    Can you be more specific? I just starting out and I'm not entirely sure what you mean. Where specifically should I add that?
     
  4. The | Suit

    The | Suit Agent S. Forum Moderator

    Check the object ironbeacon as reference
    Code:
    \unpacked\objects\boss
     
  5. Mackinz

    Mackinz The Waste of Time

    To decipher what xxswatelitexx said, I think he means to change this:

    Code:
    "orientations" : [
    {
    "image" : "pistgen.png:<color>.<frame>",
    "imagePosition" : [-16, -8],
    "flipImages" : true,
    "direction" : "left",
    
    "spaceScan" : 0.1,
    "anchors" : [ "background" ]
    },
    {
    "image" : "pistgen.png:<color>.<frame>",
    "imagePosition" : [-16, -8],
    "direction" : "right",
    
    "spaceScan" : 0.1,
    "anchors" : [ "background" ]
    }
    ],
    To this:

    Code:
    "orientations" : [
    {
    "image" : "pistgen.png:<color>.<frame>",
    "frames" : 16,
    "imagePosition" : [-16, -8],
    "flipImages" : true,
    "direction" : "left",
    
    "spaceScan" : 0.1,
    "anchors" : [ "background" ]
    },
    {
    "image" : "pistgen.png:<color>.<frame>",
    "frames" : 16,
    "imagePosition" : [-16, -8],
    "direction" : "right",
    
    "spaceScan" : 0.1,
    "anchors" : [ "background" ]
    }
    ],
     
    The | Suit likes this.
  6. Silverforte

    Silverforte Spaceman Spiff

    I tried it, the object still flickers the same.
     
  7. The | Suit

    The | Suit Agent S. Forum Moderator

  8. Silverforte

    Silverforte Spaceman Spiff

    That didn't help. Isn't the delta part of the wiring node?
     
  9. The | Suit

    The | Suit Agent S. Forum Moderator

    Delta script of the object is 60 which is really slow
     
  10. Silverforte

    Silverforte Spaceman Spiff

    Lowering it to 5 isn't too low when 60 is low? I don't know, I've tried everything, was working on it for hours. It just won't stop blinking.
     
  11. The | Suit

    The | Suit Agent S. Forum Moderator

    5 is default
     
  12. Silverforte

    Silverforte Spaceman Spiff

    I fixed it. As many times as I went over and over the png file, redoing it completely (with essentially the same image...) seemed to fix it. I really don't understand what was wrong but I'm just going to move past it now.
     

Share This Page