Modding Help Craft from nearby containers

Discussion in 'Starbound Modding' started by Kolossus, Aug 18, 2016.

  1. Kolossus

    Kolossus Space Hobo

    I am trying to determine if it is possible to check other containers besides the players inventory when determining if you have the materials to craft an item. Would also want to remove from that inventory as well. I looked at the player lua and see some methods that I'm guessing are called when viewing a crafting menu and determining what is craftable. However, I don't see the object and methods related to an open container and checking it's inventory.

    Edit: looks like world may have what I need

    #### `unsigned` world.containerAvailable(`EntityId` entityId, `ItemDescriptor` item)

    Returns the number of the specified item that are currently available to consume in the specified container, or `nil` if the entity is not a container.
     
    Last edited: Aug 18, 2016
  2. Kolossus

    Kolossus Space Hobo

    While I believe I now know most of the methods I'll need to use I do still have one problem... I haven't been able to find the code that controls crafting stations. Crafting stations seem to be in a continuous loop while open that checks each recipe in the list against the players inventory. Any assistance is much appreciated.
     
  3. Inkadventure

    Inkadventure Space Hobo

    This is what I want most in the game right now
     
  4. ShadePT

    ShadePT Scruffy Nerf-Herder

    Hope you manage to pull it off. Would love something like this in game.
     
  5. zetaPRIME

    zetaPRIME Pangalactic Porcupine

    If all else fails, you could definitely do it by reimplementing the crafting mechanic yourself... though that's of course a bit of a ridiculous undertaking...
     
  6. Shadox2.0

    Shadox2.0 Spaceman Spiff

  7. ryo.pasternak

    ryo.pasternak Big Damn Hero

    Any progress for 6 years?

    In fact 7 years according this topic. :nuruneutral:
     
    Last edited: Jan 14, 2022

Share This Page