Results 1 to 5 of 5

Thread: Persistant information when entering chest to be retrieved when pulling from chest

  1. #1

    Persistant information when entering chest to be retrieved when pulling from chest

    I know I can use onSave() and onLoad(...), but the onLoad will only pick up changes to a variable made before the last autosave, rather than during onDestroy.

    How hard would it be to store local variables on an object when placed on a container to be placed back on the object when spawned from a container?

    edit: worth noting, I have tried to manually set the script_state encoded json during onDestroy, to no avail.

  2. #2
    Huh, pretty bad that script_state can't be set in onDstroy callback. I guess you'd have to use a separate object (hidden, anything) just to hold that persistent data. Let objects call some 'save' function on it with the data (e.g. in onDestroy) and then try to retrieve it in onLoad. For multiple objects, saved/loaded data could be keyed with GUID (bleh) or some other unique identifier.

  3. #3
    I think that script_state is just a container for data to be written to the game-level save file when auto-save (or manual save) is actually done. I CAN change script_state, but changes to script_state do not persist through a Enter-Bag / Leave-Bag unless an auto-save is run after the change but before the object enters the bag.

    Certainly less than ideal, but I do get why it works this way.

  4. #4
    Bump - any word on how viable this is?

    Turns out that onEnterBag is only global, which means it makes no sense to put them on individual objects in order to decide how to store the information in a bag... Besides, onObjectLeaveContainer on an object doesn't get called as it's leaving a container, which means I can't pull information about an object as it's leaving a bag.

    This is ridiculous. I just want a nice and simple way to let information survive and persist throughout between saves and when an object gets placed into a bag and when it gets pulled out.

  5. #5

    This has been a thing for over a year ( during which several releases have been made. Can I get some kind of acknowledgement at least?

Similar Threads

  1. Let us save Texttools to chest
    By BaconCatBug in forum Suggestions
    Replies: 2
    Last Post: 06-28-2017, 09:20 AM
  2. [ADDED] Chest features
    By Ceroshiro in forum Suggestions
    Replies: 6
    Last Post: 01-30-2017, 05:40 AM
  3. Disable - Save To Chest
    By Crazy in forum Suggestions
    Replies: 14
    Last Post: 01-22-2017, 06:17 AM
  4. [ADDED] Chest Workshop Support
    By Adventurer in forum Suggestions
    Replies: 0
    Last Post: 01-11-2016, 04:10 PM
  5. Workshop to chest
    By Sharpevil in forum General Discussion
    Replies: 1
    Last Post: 05-01-2015, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts