Modding Help Permanent data

Discussion in 'Starbound Modding' started by Dante98dzc, Aug 14, 2020.

Tags:
  1. Dante98dzc

    Dante98dzc Void-Bound Voyager

    Need store a table type variable, save it's value and be able to load it after the game has closed and reopened ...

    I'm begginer in modding, but I think it have to be something related to the game API..

    ---Edit---

    I about to finish my mod, I just lack this last issue...
    mechset3.png mechset2.png

    The mod gives 3 sets of configurations on the mech assembly station. I need save in the game the variable that holds the mech itemSet of each set . Without that is useless... :' (
    I can't find any documentation about that ...
     
    Last edited: Aug 15, 2020
  2. bk3k

    bk3k Oxygen Tank

    Store it in the object with object.setConfigParameter()
    As for doing that, pane.sourceEntity() from the interface script can tell you the entityID that called it.
    Both the storing and retrieving of the data can be done with the messaging system.
    world.sendEntityMessage()
    Well you want to look at various existing scripts to see how to use that.
     
    Dante98dzc likes this.
  3. Dante98dzc

    Dante98dzc Void-Bound Voyager

    I figured it out just yesterday how to handle the messages. The functions are explained in the doc/Lua/world.md file, and I didn't know..
    Now I'm getting other problems... but I will keep researching how to make it work.

    Thanks a lot for your reply @bk3k..
     
  4. bk3k

    bk3k Oxygen Tank

    Come to think of it, if you are using the object at the Outpost... the Outpost is an instance. That's gonna be a problem. You need to get an object into player hands that can be placed in a permanent world (which could include their ship).

    An active item is a possibility too. Basically you'd consume and provide a new one with custom parameters (which contain the stored data).
     

Share This Page