Bazooks Posted Thursday at 04:21 AM Report Posted Thursday at 04:21 AM I have several items in a tf2 backpack which have attributes I would like to read on backpack load. For example, I have a professional killstreak item which sheen and killstreaker I would like to read using node-tf2: "attribute": [{ "def_index":2013, "value":null, "value_bytes": { "type":"Buffer", "data": [0,160,250,68] } }, { "def_index":2014, "value":null, "value_bytes": { "type":"Buffer", "data":[0,0,192,64] } }, { "def_index":2025, "value":null, "value_bytes": { "type":"Buffer", "data":[0,0,64,64] } }] While I know that def_index is referring through the attribute's id in items_game.txt, I'm struggling to figure out how to convert the attribute's value_bytes into a human-readable value. Is there any documentation on this? Value_bytes also seems to be able to be something other than a single integer, such as when defined by fabricators to list their crafting recipe. I'd also like to know how to parse these as well. Quote
Dr. McKay Posted 2 hours ago Report Posted 2 hours ago (edited) If value_bytes is 4 bytes, it's either a 32-bit int or a float. stored_as_integer in items_game.txt will tell you whether to read it as an int or as a float. The vast majority of attributes are either ints or floats. 2013, 2014, and 2025 are all stored as floats, so you should use Buffer.readFloatLE to read them. Edited 2 hours ago by Dr. McKay Quote
Recommended Posts
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.