Modding Help Loungeable and sound

Discussion in 'Starbound Modding' started by PerfectRaito, Jul 11, 2015.

  1. PerfectRaito

    PerfectRaito Scruffy Nerf-Herder

    (Decided to make a new thread since i havent been able to solve this in my old thread, and it was marked as answered since i asked two questions. If this is wrong, then i am sorry. Please merge the threads then)

    Anyways. My problem. I have a loungeable object, a chair. When you interact with the chair i want it to play a sound. From my other thread we managed to figure out i had to make an animation file with the soundeffect in there ( "test" : [ "/sfx/humanoid/drink.wav" ] to test it out). Then, in the object file (the chair) we used "animation" : "chairanimation.animation" inside to call for the sound.

    The chair itself is made out of a basefile called chairidle.png and a sitCoverImage chairoccupied.png.
    The orientation part of the object is as following:

    "orientations" : [
    {
    "image" : "chairidle.png",
    "imagePosition" : [-16, 0],
    "direction" : "left",
    "flipImages" : true,

    "sitPosition" : [2, 22],

    "spaceScan" : 0.1,
    "anchors" : [ "bottom" ],

    "detectArea" : [ [-8, 0], [-2, 5] ]
    },
    {
    "image" : "chairidle.png",
    "imagePosition" : [-16, 0],
    "direction" : "right",

    "sitPosition" : [2, 22],

    "spaceScan" : 0.1,
    "anchors" : [ "bottom" ],

    "detectArea" : [ [2, 0], [8, 5] ]
    }
    ],

    Inside he script, the following was added for the sound:

    entity.playSound("test")

    The following happens:

    I "buy" the chair, and select it. I can see the ghost of it before i place it, but the moment i put it down it turns invisible. You can still see the outline of the chair while hovering over it. When you enter the chair, the sound plays and the sitCoverImage appears.

    Been looking into it and i am not sure why this does not work. I have tried the following:

    Removing the sitCoverImage (appon sitting into the chair, the character turns invisible and the chair is still invisible.
    Removing the "animation" line from the chair. This removes the sound, but it worked as intended then.
    Adding in "frames" : 1, and "animationCycle" : 0.5, to the Orientation part of the object file. Nothing happens.
    Adding in <color> and <color>, <frame> onto the end of chairIdle.png. The log says it can't find the file, and there is no outline or "ghost" of the chair when you try to place it down, or place it down. The sitCoverImage still works.

    Any ideas?
     
  2. kyleetehkitty

    kyleetehkitty Title Not Found

    Best Answer
    So it works!

    The issues were:
    • Missing .frames file
    • Animation file needed tweaks
    • Object file needed tweaks
    The new .object file
    Code:
    {
      "objectName" : "apexchair",
      "rarity" : "Common",
      "category" : "furniture",
      "price" : 0,
      "description" : "Test Chair",
      "shortdescription" : "Apex Chair",
      "race" : "apex",
      "printable" : false,
    
      "apexDescription" : "It's a simple chair.",
      "avianDescription" : "It's a simple chair.",
      "floranDescription" : "It's a simple chair.",
      "glitchDescription" : "It's a simple chair.",
      "humanDescrtiption" : "It's a simple chair.",
      "hylotlDescription" : "It's a simple chair.",
      "novakidDescription" : "It's a simple chair.",
    
      "inventoryIcon" : "/objects/chair/apex/chairplaceholder.png",
      "orientations" : [
      {
      "image" : "/objects/chair/apex/chairidle.png:<color>.test",
      "imagePosition" : [-16, 0],
    
      "spaceScan" : 0.1,
      "anchors" : [ "bottom" ],
      "flipImages" : true,
      "direction" : "left",
      "sitPosition" : [2, 22],
      "detectArea" : [ [-8, 0], [-2, 5] ]
      },
      {
      "image" : "/objects/chair/apex/chairidle.png:<color>.test",
      "imagePosition" : [-16, 0],
    
      "spaceScan" : 0.1,
      "anchors" : [ "bottom" ],
      "direction" : "right",
      "sitPosition" : [2, 22],
      "detectArea" : [ [2, 0], [8, 5] ]
      }
      ],
    
      "objectType" : "loungeable",
      "sitOrientation" : "lay",
      "sitAngle" : 0,
      "sitFlipDirection" : false,
      "sitCoverImage" : "/objects/chair/apex/chairOccupied.png",
    
      "sitStatusEffects" : [
      "intents"
      ],
    
      "scripts" : [ "/objects/chair/chairscript.lua" ],
      "scriptDelta" : 2,
    
      "animation" : "/objects/chair/apex/chairanimation.animation",
      "animationCustom" : {
      "sounds" : {
      "test" : [ "/sfx/statuseffects/bandage.wav" ]
      }
      },
      "animationParts" : {
      "chair" : "/objects/chair/apex/chairidle.png"
      },
      "animationPosition" : [0, 0],
    
      "chairOptions" : [
      "TestLine 1",
      "TestLine 2",
      "TestLine 3"
      ],
      "sitChair" : [
      "TestLine 4",
      "TestLine 5",
      "TestLine 6"
      ],
      "occupiedChairIdle" : [
      "TestLine 7",
      "TestLine 8",
      "TestLine 9"
      ],
      "emptyChairIdle" : [
      "TestLine 10",
      "TestLine 11",
      "TestLine 12"
      ]
    }
    
    The new .animation file
    Code:
    {
      "animatedParts" : {
      "stateTypes" : {
      "apexChair" : {
      "default" : "test",
      "states" : {
      "test" : {
      }
      }
      }
      },
    
      "parts" : {
      "chair" : {
      "properties" : {
      "centered" : false
      },
      "partStates" : {
      "apexChair" : {
      "test" :{
      "properties" : {
      "image" : "<partImage>:<color>.test"
      }
      }
      }
      }
      }
      }
      },
    
      "sounds" : {
      "test" : [ ]
      }
    }
    
    The missing chairidle.frames file
    Code:
    {
      "frameGrid" : {
      "size" : [32, 40],
      "dimensions" : [1, 1],
      "names" : [
      [ "default.test" ]
      ]
      }
    }
    
    
    And the working mod zip url: http://1drv.ms/1gyhOio
     
    Last edited: Jul 14, 2015
    kikitehkitty and PerfectRaito like this.
  3. kyleetehkitty

    kyleetehkitty Title Not Found

    Check your log file after you place the object and use it. It may tell you why it is not showing up.
     
    PerfectRaito likes this.
  4. PerfectRaito

    PerfectRaito Scruffy Nerf-Herder

    Well, that's the thing. The log says nothing. It just loads up the mods normally, then the assets, then loads settings, starter world, player and account. That is what is confusing me.
     
  5. kyleetehkitty

    kyleetehkitty Title Not Found

    From my personal experience with such issues, it is normally a bad asset path or a missing asset that results in stuff not showing up. The logs usually point this out too though.
     
    PerfectRaito likes this.
  6. PerfectRaito

    PerfectRaito Scruffy Nerf-Herder

    It is mostly why i am confused too. Usually the log would tell me that i messed up the pathing of files or something but no. Nothing in the log. Also before you place the chair it is fully detailed (the the ghost placing mode). It is when you place it, and only when it is placed and empty, it will not show the image.
     
  7. v6ooo

    v6ooo Space Kumquat

    Are you able to upload the object or mod to dropbox, or somewhere of your own choosing.
    That way we could try and narrow it down without having to recreate your assets.
     
    PerfectRaito likes this.
  8. PerfectRaito

    PerfectRaito Scruffy Nerf-Herder

    Here. Please note that there arent really any assets yet. Mostly placeholders. Still waiting for the art assets from my friend, but this should do the trick. Hopefully this helps.
     

    Attached Files:

  9. kyleetehkitty

    kyleetehkitty Title Not Found

    Best Answer
    So it works!

    The issues were:
    • Missing .frames file
    • Animation file needed tweaks
    • Object file needed tweaks
    The new .object file
    Code:
    {
      "objectName" : "apexchair",
      "rarity" : "Common",
      "category" : "furniture",
      "price" : 0,
      "description" : "Test Chair",
      "shortdescription" : "Apex Chair",
      "race" : "apex",
      "printable" : false,
    
      "apexDescription" : "It's a simple chair.",
      "avianDescription" : "It's a simple chair.",
      "floranDescription" : "It's a simple chair.",
      "glitchDescription" : "It's a simple chair.",
      "humanDescrtiption" : "It's a simple chair.",
      "hylotlDescription" : "It's a simple chair.",
      "novakidDescription" : "It's a simple chair.",
    
      "inventoryIcon" : "/objects/chair/apex/chairplaceholder.png",
      "orientations" : [
      {
      "image" : "/objects/chair/apex/chairidle.png:<color>.test",
      "imagePosition" : [-16, 0],
    
      "spaceScan" : 0.1,
      "anchors" : [ "bottom" ],
      "flipImages" : true,
      "direction" : "left",
      "sitPosition" : [2, 22],
      "detectArea" : [ [-8, 0], [-2, 5] ]
      },
      {
      "image" : "/objects/chair/apex/chairidle.png:<color>.test",
      "imagePosition" : [-16, 0],
    
      "spaceScan" : 0.1,
      "anchors" : [ "bottom" ],
      "direction" : "right",
      "sitPosition" : [2, 22],
      "detectArea" : [ [2, 0], [8, 5] ]
      }
      ],
    
      "objectType" : "loungeable",
      "sitOrientation" : "lay",
      "sitAngle" : 0,
      "sitFlipDirection" : false,
      "sitCoverImage" : "/objects/chair/apex/chairOccupied.png",
    
      "sitStatusEffects" : [
      "intents"
      ],
    
      "scripts" : [ "/objects/chair/chairscript.lua" ],
      "scriptDelta" : 2,
    
      "animation" : "/objects/chair/apex/chairanimation.animation",
      "animationCustom" : {
      "sounds" : {
      "test" : [ "/sfx/statuseffects/bandage.wav" ]
      }
      },
      "animationParts" : {
      "chair" : "/objects/chair/apex/chairidle.png"
      },
      "animationPosition" : [0, 0],
    
      "chairOptions" : [
      "TestLine 1",
      "TestLine 2",
      "TestLine 3"
      ],
      "sitChair" : [
      "TestLine 4",
      "TestLine 5",
      "TestLine 6"
      ],
      "occupiedChairIdle" : [
      "TestLine 7",
      "TestLine 8",
      "TestLine 9"
      ],
      "emptyChairIdle" : [
      "TestLine 10",
      "TestLine 11",
      "TestLine 12"
      ]
    }
    
    The new .animation file
    Code:
    {
      "animatedParts" : {
      "stateTypes" : {
      "apexChair" : {
      "default" : "test",
      "states" : {
      "test" : {
      }
      }
      }
      },
    
      "parts" : {
      "chair" : {
      "properties" : {
      "centered" : false
      },
      "partStates" : {
      "apexChair" : {
      "test" :{
      "properties" : {
      "image" : "<partImage>:<color>.test"
      }
      }
      }
      }
      }
      }
      },
    
      "sounds" : {
      "test" : [ ]
      }
    }
    
    The missing chairidle.frames file
    Code:
    {
      "frameGrid" : {
      "size" : [32, 40],
      "dimensions" : [1, 1],
      "names" : [
      [ "default.test" ]
      ]
      }
    }
    
    
    And the working mod zip url: http://1drv.ms/1gyhOio
     
    Last edited: Jul 14, 2015
    kikitehkitty and PerfectRaito like this.

Share This Page