Copies the contents of an entire map into another id.


GML Code Example

ds_map_copy(id, source);

Argument Description
id The id of the map you are copying to</>
source The id of the map you are copying from

Returns: N/A


You can use this function to copy the contents of one map into another one that you have previously created using ds_map_create(). If the ds_map that is being copied to is not empty, then this function will clear it first before copying. The original ds_map remains un-changed by this process.


GML Code Example

inventory_2 = ds_map_create();
 ds_map_copy(inventory_2, inventory_1);

The above code will create a new map and assign it to the variable "inventory_2". It will then copy the contents of the ds_map indexed in the variable "inventory_1" to this new map.

Back: DS Maps

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here