Finds the key specified and returns the paired value from the ds_map.


GML Code Example

ds_map_find_value(id, key)

Argument Description
id The id of the map to use.
key The key to find.

Returns: Real, string or undefined


With this function you can get the value from a specified key. The input values of the function are the (previously created) ds_map to use and the key to check for.

NOTE: If no such key exists then the function will return <undefined>. You should always check this using the is_undefined() function.


GML Code Example

amount = ds_map_find_value(inventory, "food");

Or, using the map accessor "?":

GML Code Example

amount = inventory[? "food"];

The above code will get the value of the key "food" and store it in the variable "amount".

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