Jump to content
McKay Development

Item Craftability from GC


KTVS
 Share

Recommended Posts

I was hoping to get an elaboration on this post that was made a year ago. Similar to this fellow, I'm wondering how to get the craftability & tradability of an item sent from the GC, but, as you eluded to, am struggling with the various conditions. At first I thought it was just a matter of the the 5th bit being set in the flag attribute for non-craftable items, but this lead to all supply crate keys being flagged as non-craftable. I pretty much gave up after realizing this and started reloading from the web, but I noticed that steam's inventory endpoints have some lag to them which caused issues when reloading soon after crafting metal (old metal would still show and new metal wouldn't).

I've effectively resolved the issues by using the GC just to get the asset ids of items that are in my inventory, and the names get filled in whenever they're seen by the web inventory. That solves the problems, but it would be fantastic to not have to reload the inventory from the web at all.

Is it actually possible to accurately get the craftability & tradability of an item just from the info the GC gives back? If so, is it possible to get (to your best knowledge) the key attributes I need to be looking at?

Your help is deeply appreciated.

Link to comment
Share on other sites

It's entirely possible that keys have the cannot-craft flag set. They're necessarily purchased from the store, after all. The web and in-game UIs might just hide that text for keys.

It is actually possible to accurately get craftability and tradability from the GC data (after all, that's the same data the official game client gets and it has to be able to determine if items are tradable or craftable), but it's a complete mess and you need to check a handful of different conditions and attributes because it's Valve and Valve can't write good code.

For example, there's an attribute "cannot trade" but then there's also an attribute "always tradable" and I have no idea which takes precedence. My wild guess would be that "always tradable" trumps the achievement origin but is itself trumped by the flag and other untradable attributes (e.g. "tradable after date") but this is likely a really deep rabbit hole to dive into and I've never been insane enough to try.

What is it you're doing? How frequently do you need to retrieve item data?

Link to comment
Share on other sites

12 hours ago, Dr. McKay said:

...but this is likely a really deep rabbit hole to dive into and I've never been insane enough to try.

I'm satisfied enough with this answer; if you say it's that bad then I'm sure the enormous headache outweighs the benefit.

The main issue I'm facing is re-finding items after they've been acquired in a trade. Trades that don't require confirmation can have the new item's asset ids determined by looking at the trade receipt, but I haven't seen a way to get the trade ID for the trade receipt when the offer required confirmation or was a sent offer that was accepted. Luckily enough, the asset ids are right there in the message from the GC... but I don't know to what items they belong and I don't want to be making educated guesses. 

Due to the nature of my program, I run right up against Steam's web inventory rate limit (100 calls every 2 minutes). I would definitely benefit from trimming unnecessary inventory calls, especially those that are just updating my own inventory, but I still need them anyway to determine which items are currently tradable and which aren't based on the inventory cache. It seems like an unnecessary hassle forcing steam to uncache my inventory every time I want to send a trade offer, so for those two reasons (the headache of parsing the craftability/tradability and handling cached items), it looks like the web calls must stay. 
 

12 hours ago, Dr. McKay said:

The web and in-game UIs might just hide that text for keys.

This sounds like a nightmare that, as you suggested, probably isn't worth trying to figure out.

My core issue of Steam's inventory rate limit actually brings me to another question, but it's unrelated to this topic so I think it's best to start a new one for clarity.

As always, thank you for your help!

Edited by KTVS
Link to comment
Share on other sites

8 hours ago, KTVS said:

Trades that don't require confirmation can have the new item's asset ids determined by looking at the trade receipt, but I haven't seen a way to get the trade ID for the trade receipt when the offer required confirmation or was a sent offer that was accepted.

If you know the ID of the trade offer you're trying to map new item IDs for, this is actually really easy. GetTradeOffer includes the trade_id of the completed trade, and GetTradeStatus includes the mapping of old to new asset IDs for all items. It even has the new asset IDs in the original user's inventory if the trade was rolled back (due to an error in the middle of committing, or canceled escrow).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...