What is the default value meaning of -2 in GML?

Hello,
Can anyone tell me what the -2 default value is for GML? Like -4 means that there isn't an instance id. What does -2 mean? Thanks!
I getting this error:

############################################################################################
FATAL ERROR in
action number 6
of Step Event0
for object obj_enemy_peasant:
Push :: Execution Error - Variable Get -2.repair_list(100242, -2147483648)
at gml_Object_obj_enemy_peasant_StepNormalEvent_6 (line 98) - ds_list_delete(target.repair_list,ds_list_find_index(target.repair_list,id))
############################################################################################
 

Yal

🐧 *penguin noises*
GMC Elder
-1 is self, so I'm imaging -2 is other. (-4 is noone, as you said). Not sure what global is, but given the pattern, let's just guess it's -3? :p
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
-1 is self, so I'm imaging -2 is other. (-4 is noone, as you said). Not sure what global is, but given the pattern, let's just guess it's -3? :p
Pretty close, -3 is all, -4 is noone, and -5 used to be global (deprecated for some time now). Then there were -6 and -7 for local variable scope that were never documented and were already removed as of GM:S.
 

Yal

🐧 *penguin noises*
GMC Elder
Thanks! I think you're right. I needed to use other.id to get it working. Also, isn't -5 global?
It was before, it's deprecated now, so it might be unavailable depending on the version of GM you're using:
-5 used to be global (deprecated for some time now).
...then again, using these magic numbers instead of the human-readable constants is just inviting disaster.
 

Yal

🐧 *penguin noises*
GMC Elder
What, they still do? <__< (I write so good code these days I don't get error messages very often, so I'm outta the loop with what they're actually saying)
 
Top