Steamworks API playtimegenerator drops

Hello,

I’ve been working on integration Steamworks API with our game. We use blueprints to trigger API functions written in C++ scripts and I’m able to do this now.

Items drop and appear in my Steam inventory when I trigger;

 SteamItemDef_t newItems[1];
 uint32 quantities[1];
 newItems[0] = 50;
 quantities[0] = 1;
 SteamInventoryResult_t transferResult;
 SteamInventory()->GenerateItems(&transferResult, newItems, quantities, 1)
 SteamAPI_RunCallbacks();

I check result on callback finished and this flow works without problem.

We need to drop play time items. I’ve done requirements explained in this doc. Even callback result is success (k_EResultOK) and play time is enough(We set it 1 minute), no items is being dropped.

I’ll share the code, playtime settings and item definition json below. Probably I’m missing a very basic step. Could you please help?

The function I’m triggering drop;

void USteamUtils::TriggerPlayTimeDrop()
{
      SteamInventoryResult_t transferResult;
      bool success = SteamInventory()->TriggerItemDrop(&transferResult, 60);
      SteamAPI_RunCallbacks();
}

Event that is triggered after callback’s been completed.

void USteamUtils::OnInventoryResult(SteamInventoryResultReady_t* pCallback)
{
	bool bGotResult = false;
	std::vector<SteamItemDetails_t> vecDetails;
	uint32 count = 0;

	if (SteamInventory()->GetResultItems(pCallback->m_handle, NULL, &count))
	{
		vecDetails.resize(count);
		bGotResult = SteamInventory()->GetResultItems(pCallback->m_handle, vecDetails.data(), &count);
	}

	SteamInventory()->DestroyResult(pCallback->m_result);
}

Item definition json;

{
  "appid": "-------",
  "itemdefid": "60",
  "Timestamp": "2023-11-30T09:30:09Z",
  "modified": "20231130T093009Z",
  "date_created": "20231128T171549Z",
  "type": "playtimegenerator",
  "display_type": "",
  "name": "Golden Panner(PlayTime)",
  "description": "",
  "background_color": "4D4D4D",
  "icon_url": "some working .png image url",
  "icon_url_large": "some working .png image url",
  "name_color": "F3D400",
  "tradable": false,
  "marketable": false,
  "commodity": false,
  "item_slot": "golden"
}

And the play time settings;

It’s incredible, I have exactly the same issue. I’ve defined the generator and the item in the same way as you did, then called TriggerItemDrop.

The result is an empty array, as if the user is not eligible for the drop.

Your definitions are wrong.
I had to figure this stuff out over a 3 hour debugging session, jesus christ.
Unity has this sorted out, but Epic made no progress in making Steamworks integration more straight-forward in 7 f**king years. Thanks EPIC.

Anyway - the solution - you need to have the playtimegenerator specified with bundle of drops of actual items, and I assume it also needs to have item_slot set to generator.

Example (you call the number itemid 1 here, it then drops the item 2):

{
    "appid": xxxx,
    "items": [
        {
            "itemdefid": 1,
            "type": "playtimegenerator",
            "name": "genStuff",
            "description": "stuff gen",
            "name_color": "FFC0CB",
            "background_color": "3C352E",
            "bundle": "2x100", # drop itemID 2 with 100% chance
            "item_slot": "generator",
            "icon_url": "img.png",
            "icon_url_large": "imgbig.png",
            "tradable": false,
            "marketable": false
        },
        {
			"itemdefid": 2,
			"type":  "item",
			"name": "ITEM",
			"description": "droppable item",
			"price": "1;VLV25",
			"name_color":  "FFC0CB",
			"background_color":  "3C352E",
			"item_slot": "decoration",
 			"icon_url": "itm.png",
            "icon_url_large": "itm222.png",
			"tradable": true,
			"marketable": true
		}
    ]
}