Modding Help onInteraction Windows

Discussion in 'Starbound Modding' started by Whale Cancer, Dec 8, 2014.

  1. Whale Cancer

    Whale Cancer Big Damn Hero

    Can anyone point me to an example of an object with an associated .lua script that opens a window? I'm trying to get a generator going (so the window would be similar to the fuel hatch), but I can't find anything that calls a window in its .lua script so I can't even begin to do this element of the generator.

    I'm on the nightly build.

    Thanks in advance!

    Edit: Added a question about how to reference items in containers to my last post.
     
    Last edited: Dec 8, 2014
  2. Best Answer
    Thats because its so easy, you are likely overlooking it:
    Code:
    function onInteraction()
         return { "OpenCraftingInterface", {config = "/interface/colonytable.config", filter = { "colonies" } }}
    end
    
    Opens up a crafting table with the filter set to "colonies".

    There are a number of strings to return each doing different things:
     
    Last edited: Dec 17, 2014
  3. Whale Cancer

    Whale Cancer Big Damn Hero

    Awesome, that is just the kind of info I need to get started and learn this stuff. Thanks!

    Edit: Okay, now I need to figure out how to reference an item in a container. How to check to see what it is and how to remove it. Any guidance there would be appreciated.
     
    Last edited: Dec 8, 2014
  4. You would use the container API. Should be documented within Omni's stickied thread. You'll have to wait till I get off of work for some examples though.

    Also note that you will need to change the object type to the "Storage" type which unfortunately does not call the onInteraction hook if you intend on relying on that. Also note that you may not be able to do any sort of crafting within it then ( I have to go back and double check this for things like the Furnace and see what was used )
     
    Last edited: Dec 8, 2014
  5. So I completely forgot about doing this... You still need assistance with this @Whale Cancer or did you figure it out?
     

Share This Page