Closed Yesber closed 10 months ago
When you say "equipped" do you mean what item the player currently has in its hand or what items are in its "inventory" or whatever you want to call it.
"Currently in hand"
let ticks = parseTicks("path_to_demo.dem", ["active_weapon_name"])
Will give you these:
{
active_weapon_name: 'glock',
name: 'player1',
steamid: '765611111111111111',
tick: 288
},
Or are you interested in something like this (Not implemented atm but should):
let ticks = parseTicks("path_to_demo.dem", ["inventory"])
{
inventory: ["C4", "AK", "glock", "kevlar"],
name: 'player1',
steamid: '765611111111111111',
tick: 288
},
I get the active_weapon_name and it's working well, 2. is what I had in mind. Primary, secondary, knife, nades and c4 is what I used to get from the csgo parser. Thanks!
Made some good progress on this. I think I got the others working fine, but knife would require some different logic. Would you like to share why you are interested in the knife? I assume everyone to always have a knife in their inventory (or are you interested in the knife type or something?)
Nice, well done!
I'm not particularly interested in the knife, for my use case I would be fine assuming that everyone has one.
It is possible to make modes where you don't necessarily have a knife, and it could be fun to know the type.
Ok, so after very many unexpected turns it should be finally done in 0.8.0. You can use it with the "inventory" prop. The knife was also added.
Nice! Thank you so much, it is working great overall!
The player loses their knife when they die but keeps the rest of their inventory, the behavior I would expect was that the player loses all of their inventory on death.
I'm also looking at a demo where a bomb drop has been missed, resulting in two players having the bomb in their inventory at the same time. I run parseTicks(demoPath, ["inventory"], [5452])
and the returned object has two players with a c4 in their inventory. The player who originally dropped the bomb loses it from his inventory later in the round, which could be a clue.
I'd send you the demo on discord but the link in the readme doesn't work 😊
I am using python and I still get a DemoParser.Exception: UnknownPropName("inventory") using ticks = parser.parse_ticks(["inventory"])
@G4ble make sure you have the newest version. pip uninstall demoparser2 pip install demoparser2==0.8.1
Thanks everything works now!
@Yesber Damn. Was able to reproduce the c4 problem on other demo. Not too sure what could be causing this as I don't do anything special like tracking bomb drops etc, the demo has something similar to player.inventory that I use. Looking into this atm.
Also yes values of dead players are known to be buggy and this happens with other props also. For example dead players might have odd coordinates. The problem is that it's not so clear which props are ok to trust when the player is dead. (This is part of the demo and not due to some odd parser logic). Sometimes you might also want to know a value from a dead player. The solution for now is to make sure "is_alive" is true. The parser could of course do this, but as said sometimes this is not what you want. I'm still thinking about what to do to this.
Does this only happen with the C4 or has there been problems with other equipment? The C4 could be handled differently if it truly is the only problem.
I've only seen it happen with the C4
I've only seen it happen with the C4
Could you check if this was fixed in 0.10.0?
It seems to be fixed in 0.10.0 👍
Closing, feel free to re-open if more problems appear.
Hey,
I would like to keep track of what equipment (weapons + nades + c4) each player has equipped. I've tried parsing the "item_equip" event but it doesn't tell me who equipped the item, it also doesn't tell me when someone drops an item. Do you know if there is a way to do this? I'm using node.
All the best,