## VERY IMPORTANT NOTE
In order to save any variable you have to go to some passage, so please use **GO HERE** before complaining that any kind of saving doesn't work (including built-in one) - it's just how Twine works (saves state on the BEGINNIG of passage - when it arrives there). So if you change variable here and don't go anywhere - nothing will be saved.
[[GO HERE->START]]
---
## TWINE FUNCTIONS
(link-repeat: "Print test variable")[(replace: ?t)[(transition: "dissolve")[$test]]] []<t|
(link-repeat: "Set test variable")[(set: $test to (prompt: "Enter test value", "1"))]
(link-repeat: "SAVE TWINE MACRO")[(go-to: "SAVE")]
(link-repeat: "LOAD TWINE MACRO")[(if: (saved-games:) contains "TEST_SLOT")[(load-game: "TEST_SLOT")](else:)[(alert: "There is no valid save!")]]
(link-repeat: "REMOVE ALL SAVES")[<script>
for (let k of Object.keys(localStorage)) {
if (k.indexOf("(Saved Game") === 0) localStorage.removeItem(k);
}
</script>]
---
## CUSTOM FUNCTIONS
(link-repeat: "READ FROM FILE")[(readfromfile: "TEST_SLOT")]
(link-repeat: "SAVE DIRECT")[(savetofiledirect: "test_save_direct", "TEST_SLOT")]
(link-repeat: "SAVE FROM COOKIES")[(savetofile: "test_save", "TEST_SLOT")]
(link-repeat: "READ UNACCEPTED SLOT (should throw error)")[(readfromfile: "TEST_SLOT", ...(a: "OTHER_SLOT"))](save-game: "TEST_SLOT")
(go-to: "START")