From aa687e7946ebbd2d4f800e33294bc84f5a02af85 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Sun, 23 Apr 2017 14:40:06 +0200 Subject: [PATCH] Updated Storage (markdown) --- Storage.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Storage.md b/Storage.md index a7cb7e9..9fccfd5 100644 --- a/Storage.md +++ b/Storage.md @@ -29,4 +29,10 @@ GlobalStorage["favoriteColor"] = "blue"; -- Retrieve the value at a later time local favoriteColor = GlobalStorage["favoriteColor"]; -``` \ No newline at end of file +``` + +## Notes +A few things to keep in mind when storing values +* You can only store [primitive types](https://www.tutorialspoint.com/lua/lua_data_types.htm) and tables (which can also only contain primitive types). If you try to store something else Artemis will not save any of your settings. +* If you try to access a value that has never been set before, you'll get ```nil``` so be sure to check for that, especially when [concatenating](https://www.lua.org/pil/3.4.html) strings. +* Values are read from disk when the script is loaded and stored to disk when the script is unloaded. \ No newline at end of file