Modding Discussion Liquid Item to LiquidID?

Discussion in 'Starbound Modding' started by nickc01, Feb 26, 2017.

Tags:
  1. nickc01

    nickc01 Phantasmal Quasar

    Is there a way to convert a liquid item to a LiquidID and vice versa?

    I tried looking through the docs and I can't seem to find a function that allows me to do this.
     
  2. Errors4l

    Errors4l Spaceman Spiff

    I don't know if there's a beautiful solution, but I think this can work (at least for now).
    Code:
    local itemConfig = root.itemConfig("liquidfuel")
    local liquidConfig = root.assetJson("/liquids/"..itemConfig.liquid..".liquid")
    
    Of course, you'd probably want to have some safety measures in there to prevent it from calling itemConfig or assetJson with improper values, because they will crash your game unless pcalled.
     
    The | Suit likes this.
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    Honestly devs need to remove liquid ID number all together and only use liquid name.
    Less chance of conflicts and far easier to call.
     

Share This Page