Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Steamworks.gml example

Sample project for Steam-based networking for GameMaker. · By YellowAfterlife

steam_inventory_exchange_items error

A topic by sew1707 created Oct 16, 2021 Views: 241 Replies: 1
Viewing posts 1 to 2

Am I doing something wrong?

create_arr[0] = 10 // item_id

create_arr[1] = 1 // quantity

destroy_arr[0] = 11 // item_id

destroy_arr[1] = 1 // quantity

steam_inventory_exchange_items(create_arr,destroy_arr)


trying to index a variable which is not an array

 at gml_Script_steam_inventory_exchange_items (line 29) -               buffer_write(_buf, buffer_s32, _struct_1[0]); // item_def

Developer (1 edit)

As per documentation, create_arr is an array of structs (or arrays, if you’re on pre-2.3 or struct flag is disabled) so you’d want

create_arr = [
    [10, 1], // item id, quantity
]

or, in 1.4

var item;
item[0] = 10;
item[1] = 1;
create_arr[0] = item;