• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • 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.

Question - Code how to distinguish real and ds_map?

Y

Yoon-SeokJin

Guest
Code:
a = ds_map_create()
check = ds_exists(1, ds_type_map)
check was true.

Code:
check = ds_exists(1, ds_type_map)
check was false


even I don't put a in ds_exists argument0
just real number 1.

I don't understand this result.
 
Last edited by a moderator:

Ricardo

Member
If there exists a valid ds map on index 1, ds_exists will return true. You've raised a pertinent question here.
 

chamaeleon

Member
Code:
a = ds_map_create()
check = ds_exists(1, ds_type_map)
check was true.

Code:
check = ds_exists(1, ds_type_map)
check was false


even I don't put a in ds_exists argument0
just real number 1.

I don't understand this result.
Because the return value of the creation of a data structure is a number. Numbers don't have inherent meaning, they are just numerical values. There is no metadata associated with numbers that tells you what it is.
 
Y

Yoon-SeokJin

Guest
Because the return value of the creation of a data structure is a number. Numbers don't have inherent meaning, they are just numerical values. There is no metadata associated with numbers that tells you what it is.
Thank you! I understood
 

Mert

Member
Because the return value of the creation of a data structure is a number. Numbers don't have inherent meaning, they are just numerical values. There is no metadata associated with numbers that tells you what it is.
There are two exceptions : true and false. They represent 1 and 0.

If you set
Code:
speed+=true
Then the speed value of the object will be increased by 1 :D
 
Top