Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 936 Bytes

ds_list_create_from_array.md

File metadata and controls

30 lines (19 loc) · 936 Bytes

Home > Community Toolbox Reference > DS List utilities

ds_list_create_from_array

Go to source

Creates a new DS list with items from the given array.

Arguments
Argument Type Usage Description
array Array Required The array to get the items from.
Returns

Id.DsList

Example

The following code shows converting an in-game array to a DS list for legacy save system.

var _completed_levels_list = ds_list_create_from_array(global.completed_levels);
ds_map_add_list(_save_data, "completed_levels", _completed_levels_list);
var _save_json = json_encode(_save_data);

Update history

  • 24.6.0 - Created a function to create a DS list from an array.