S
shadow7692
Guest
I have a couple of data structures set up beforehand:
When I run the code I get an error that
EDIT: I have also tried the accessor of
Code:
global.ItemIndex = ds_grid_create(Items.Length, Attributes.Length); // I have enums for these too.
Inventory = ds_list_create(); // [Items.ItemName (since its an enum, int64), Amount (int64), Equipped (boolean)]
'ds_grid_get argument 1 incorrect type (array) expecting a Number (YYGI32)'
and I have checked the argument being sent by using typeof()
which does indeed return a number - what is going on here?
Code:
for (var i = 0; i < ds_list_size(Inventory); i++) {
var Item = ds_list_find_value(Inventory, i);
show_debug_message(typeof(Item[0])); // Returns int64
if (ds_grid_get(global.ItemIndex, Item[0], Attributes.Class) == Class.Weapon) { // -- ERROR is here.
// Other code
};
};
global.ItemIndex[# Item[0], Attributes.Class]
which still returns the same error.