Modding Help Storage with additional LUA

Discussion in 'Starbound Modding' started by OffLuffy, May 6, 2018.

Tags:
  1. OffLuffy

    OffLuffy Void-Bound Voyager

    So I'm just getting into modding since about yesterday. I have programming experience, so I'm not entirely helpless (although LUA is new to me), and I'm trying to use vanilla assets as references where possible. I'm trying to make a storage object, but I'd like to add a button that can modify the inventory and a text label that will change as items are transferred in and out. I'm assuming I can control these somehow on events, but I'm not sure how to hook into a storage object with a LUA script.

    Is there a vanilla asset which does this that I can reference? Seems like most storage simply has a few options for uiConfig and slots, but nothing terribly special otherwise.

    Thanks in advance!
     
  2. bk3k

    bk3k Oxygen Tank

    Where container events are concerned, containerCallback() is what you want. Be sure to check out the \starbound\doc\ folder for documentation too. As far as containers are concerned, the functions in the world table are probably the first thing to look at.

    For reference you might want to look at a couple mods actually. Enhanced Storage and Improved Containers.
     
    OffLuffy likes this.
  3. OffLuffy

    OffLuffy Void-Bound Voyager

    So I think I've sorted out a good bit of what I wanted to do, but there is something else that I'm trying to sort out. I've noticed that some non-storage interact-able objects use a config file via interactData.config, whereas the storage types just use a uiConfig. Is there a way to override parts of the uiConfig with the op.add thing like you can with the interactData GUI configs?

    There's a few things I'd like to do to the storage GUI: add a button, shift the take all button over, add a label, and override the title contents. Would it be worth creating a new UI config for this or is it easy enough to override a vanilla config? In a way, I'd lean towards creating a new UI, although I'm unsure of how to implement the storage elements properly. I'll take a look at chest64 config in the mean time and see if I can't do some fancy guesswork.

    Guess it'd also be nice to know the difference between a UI loaded with interactData.config and uiConfig. Do these work essentially the same way? Can they be used interchangeably? If not, what is one designed to do that the other can't do?
     

Share This Page