• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

SOLVED Issue with ds_map_exists in project imported from GMS 1.4x to GMS 2

derboo

Member
I'm using a ds map in a project to store special attributes for animation frames.

In the below example frameset is the ds map (which exists) state contains a string which is my name for the current animation frame, and "_xmove" is my name for one of the attributes, combined they form the name of the key to check for the corresponding value, like this:

if (ds_map_exists(frameset, state + "_xmove")) xmove = ds_map_find_value(frameset, state + "_xmove");

The above line worked without issues in GMS 1.4x, but in most (but not all!) cases when the key combined from state + "_xmove" does not exist, I get the following runtime error:

REAL argument is undefined

That even happens when I replace the right part with something trivial like xmove = 0 so the issue must be in the ds_map_exists check? But I can't figure out what would cause it, since it should just return false?
 

gnysek

Member
Ensure that state is string. You can do it by either adding state = state(string) a line before one you posted in example, or you can use string(state) + "_xmove"
 

derboo

Member
Thanks, I tried it out, but that doesn't seem to solve the issue - I'm still getting the same error on that line.
 

derboo

Member
Oh, never mind. I've just got a notification to install the very new version of GMS Studio that just came out, and apparently it's fixed now. :oops:
 
Top