• 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!

Need help with "Switch" in D&D

M

MMGames

Guest
Dear all,

I've never used Switch on Drag and Drop before in Game Maker Studio 2.
For some reason, its giving me an error and I don't know what I am doing wrong. Could you please let me know if you see something I am missing?

Thanks!!

This is the "code":



This is the error I get when this object is executed (hence, created):

___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_preparacion_azul1:

local variable miID(100001, -2147483648) not set before reading it.
at gml_Object_obj_preparacion_azul1_Create_0 (line 23) - var l216E9BF5_0 = miID;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_preparacion_azul1_Create_0 (line 23)
called from - gml_Object_obj_seleccionarlospokemon_Create_0 (line 241) - instance_create_layer(400, 220, "Instances", obj_preparacion_azul1);
 

Yal

šŸ§ *penguin noises*
GMC Elder
The Switch module is available under NDA only, you're not going to get any help with it from the public part of the forum.


...nah, I know this is about switch statements, just kidding. Seriously, though, you'd probably gotten an answer sooner if this topic had been in the appropriate forum board, programming. Game Design doesn't get all that much traffic, and people that wanna discuss game design will just skip over random programming questions.
 

Slyddar

Member
Are you sure it has a value assigned to it before the switch statement? Put a show_debug_message codeblock in there after you get the global variable, and see what value milD has.
 
Top