Modding Help Is it possible to get the config of an item from the container's lua file?

Discussion in 'Starbound Modding' started by hythl0day, Dec 21, 2015.

  1. hythl0day

    hythl0day Subatomic Cosmonaut

    I am trying to create a unique weapon, with customizable abilities(abilities from latest combat patch)

    That means, to add/modify abilities to/of a pre-existed weapon.

    However, through neither "container" nor "craftinginterface" can I access to the config of a certain item.

    Any hint or reference for this task?
     
  2. TP_

    TP_ Title Not Found

    Best Answer
    root.itemConfig is what you´re looking for I believe:

    Code:
    itemDescs = world.containerItems(entity.id());
    root.itemConfig(itemDescs[x].name).config
    OR

    Code:
    itemDesc = world.containerItemAt(entity.id(), x);
    root.itemConfig(itemDesc.name).config
    Where x is replaced by the slot in the container

    Got this function a few days ago from the lovely fellas at the ##starbound-modding irc
     
  3. v6ooo

    v6ooo Space Kumquat

    I know @lillgrinn was working on modifying equipment, you might find some information from him, his mods or his posts.
     
  4. TP_

    TP_ Title Not Found

    Best Answer
    root.itemConfig is what you´re looking for I believe:

    Code:
    itemDescs = world.containerItems(entity.id());
    root.itemConfig(itemDescs[x].name).config
    OR

    Code:
    itemDesc = world.containerItemAt(entity.id(), x);
    root.itemConfig(itemDesc.name).config
    Where x is replaced by the slot in the container

    Got this function a few days ago from the lovely fellas at the ##starbound-modding irc
     
  5. zekrom_vale

    zekrom_vale Tentacle Wrangler

    Code:
    `Json` root.itemConfig(`ItemDescriptor` descriptor, [`float` level], [`unsigned` seed])
    Generates an item from the specified descriptor, level and seed and returns a JSON object containing the `directory`, `config` and `parameters` for that item.
     

Share This Page