S
Selva
Guest
So. Related to a recent thread, but slightly different. Again, thank you all for being patient with me.
I'm initializing a variable in the "create" event of an instance. It is to be checked in the "draw" event. This seems like it aught to work. But I am getting an error that says the array does not exist. Code follows:
"Create" Event:
"Draw" event:
Sadly, the technique from my previous thread will not work here (<Thanks again to both Nocturne and NightFrost>) as these are local arrays. It seems as if the "Draw" event is running before the "Create" event. But I know that shouldn't be happening. So what am I missing?
Thanks in advance for any clues.
- Selva
I'm initializing a variable in the "create" event of an instance. It is to be checked in the "draw" event. This seems like it aught to work. But I am getting an error that says the array does not exist. Code follows:
"Create" Event:
Code:
var vIndex;
for (vIndex = 0; vIndex < 10; vIndex += 1)
{
My_Destination_AR[vIndex, 0] = false; // Instance ID of Destination
My_Destination_AR[vIndex, 1] = false; // Is this location connected?
}
Code:
draw_self();
var vMy_Dest;
if My_Destination_AR[1, 1] = true //<-----Error occurs here. - Selva
then
{
vMy_Dest = My_Destination_AR[1, 0]
draw_arrow(x,y, vMy_Dest.x, vMy_Dest.y, 1 );
}
if global.Player_Location = id
then draw_sprite(SPM_Player, -1, x+20, y+20);
Thanks in advance for any clues.
- Selva