Variables: Difference between revisions
More information about saved variables (from the old wiki)
(Created the page) |
(More information about saved variables (from the old wiki)) |
||
Line 40: | Line 40: | ||
Saved variables currently only have number type and there can only be up to 64 saved variables per game. | Saved variables currently only have number type and there can only be up to 64 saved variables per game. | ||
=== Notes === | |||
* Saved variables are saved whenever the player wins, loses, or leaves a game, but not when Fancade is force-closed from the task menu. | |||
* If the game is stored in the Edit section, opening the editor resets all saved variables, and they won't be saved when played from inside it. However, updating the game won't cause its players to lose their saved variables, as long as their names don't change. | |||
* During box art generation (the game is run for a single frame every time a level is selected), saved variables can both be read from and written to; take note of that if you have any scripts writing to them in the first frame. | |||
* Saved variables will not save values such as <code>NaN</code>, <code>Infinity</code> and <code>-Infinity</code>, however, they will be stored until the game ends. | |||
* If there are not enough saved variables or they are cumbersome to use, it is possible to encode multiple values into one variable, such as with [https://play.fancade.com/60A0BAEF67EF6DD9 Float Encoder] by [[The Questers#sounak9434|Sounak9434]]. | |||
[[Category:Scripting]] | [[Category:Scripting]] |