mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Edits to the arrays document
This commit is contained in:
+7
-5
@@ -73,8 +73,8 @@ Basically arrays are implemented using number of new operators (script functions
|
||||
// create map:
|
||||
{5: "Five", "health": 50, "speed": 0.252}
|
||||
```
|
||||
__NOTES:__
|
||||
Make sure to call `fix_array` if you want new array to be available in the next frame or `save_array` if you want to use it for a longer period (see next section for details).
|
||||
__NOTE:__
|
||||
Make sure to call `fix_array` if you want the new array to be available in the next frame or `save_array` if you want to use it for a longer period (see next section for details).
|
||||
|
||||
* Iterating in loop. Use `foreach` key word like this:
|
||||
```js
|
||||
@@ -88,7 +88,7 @@ Basically arrays are implemented using number of new operators (script functions
|
||||
end
|
||||
```
|
||||
|
||||
See "scripting_docs\compiler\sslc_readme.txt" file for full information on new SSL syntax features.
|
||||
See "scripting_docs\compiler\sslc_readme.html" file for full information on new SSL syntax features.
|
||||
|
||||
## Storing arrays
|
||||
|
||||
@@ -238,9 +238,11 @@ _*mixed means any type_
|
||||
|
||||
For those who used arrays in their mods before sfall 3.4:
|
||||
|
||||
* Previously `create_array` would create permanent arrays which were "saved" by default and their IDs were also permanent. Now permanent arrays from `create_array` are not "saved" by default anymore. Make sure to review your scripts if you need to save arrays into savegames.
|
||||
* There is an INI parameter **ArraysBehavior** in **Misc** section of ddraw.ini. If set to 0, all scripts which used sfall arrays before should work. This basically changes that `create_array` will create permanent arrays which are "saved" by default and their IDs are also permanent. It is 1 by default.
|
||||
|
||||
* __NOTE:__ Starting from sfall 4.3.3/3.8.33, the **ArraysBehavior** option is removed, and arrays always work in **ArraysBehavior=1** mode. Make sure to review your scripts if you need to save arrays into savegames.
|
||||
|
||||
* How savegame compatibility is handled?\
|
||||
Saved arrays are stored in **sfallgv.sav** file (in savegame) in new (more flexible) format, just after the old arrays. So basically, when you load older savegame, sfall will load arrays from old format and save them to new format on next game save. If you load savegame made with sfall 3.4 using sfall 3.3 (for example), game shouldn't crash, but all arrays will be lost.
|
||||
Saved arrays are stored in **sfallgv.sav** file (in savegame) in new (more flexible) format, just after the old arrays. So basically, when you load older savegame, sfall will load arrays from old format and save them to new format on next game save. If you load savegame made with sfall 3.4 using sfall 3.3 (for example), the game shouldn't crash, but all arrays will be lost.
|
||||
|
||||
* Previously you had to specify size in bytes for array elements. This parameter is now ignored and you can store strings of arbitrary length in arrays.
|
||||
|
||||
Reference in New Issue
Block a user