Skip to content

saving structs #30

Open
Open

Description

@Thijmen009

I'm adding structs to a global list var and they seem to be being deleted after a restart, is this intentional and if not is this a known issue? as I couldn't find anything in my code that deletes the structs from the list

Activity

  1. sovdeeth commented on Apr 10, 2026

    @sovdeeth
    Owner

    They cannot be saved since when variables are loaded, no templates have been parsed, so it's impossible to tell how the data should be unserialized

  2. Thijmen009 commented on Apr 11, 2026

    @Thijmen009
    Author

    ah, that's unfortunate. and there is nothing you think would be possible for this (in a future update?)

  3. Thijmen009 commented on Apr 11, 2026

    @Thijmen009
    Author

    and maybe add a warning that they can't be saved across restarts (like skript does with saving entities and inventories and such)

  4. sovdeeth commented on Apr 11, 2026

    @sovdeeth
    Owner

    and maybe add a warning that they can't be saved across restarts (like skript does with saving entities and inventories and such)

    That warning does exist

  5. Thijmen009 commented on Apr 11, 2026

    @Thijmen009
    Author

    and maybe add a warning that they can't be saved across restarts (like skript does with saving entities and inventories and such)

    That warning does exist

    huh, I'm fairly certain that I did not get a warning about it

  6. sovdeeth commented on Apr 11, 2026

    @sovdeeth
    Owner

    and maybe add a warning that they can't be saved across restarts (like skript does with saving entities and inventories and such)

    That warning does exist

    huh, I'm fairly certain that I did not get a warning about it

    Probably because you had it in another var already. The warning only appears when you put a struct directly into a global var and Skript can be certain about it being a struct.

  7. Thijmen009 commented on May 28, 2026

    @Thijmen009
    Author

    would it be possible to save the data deserialized instead of deleting it, and then having the possibility to serialize it again with something like x struct within {var} so you could do

    on load:
      set {structs::*} to x structs within {structs::*}
    

    (note that I don't know how any of this actually works so please forgive me if my question doesn't make any sense from the developer's perspective)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions