Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get gun fire data? #99

Closed
DiegoZoracKy opened this issue Jan 8, 2019 · 10 comments

Comments

Projects
None yet
3 participants
@DiegoZoracKy
Copy link

commented Jan 8, 2019

Hi @saul,

First, thanks at for this awesome piece of work. Is it possible to get data from gun fires, bullets trajectory or anything like that? I couldn't find info about it on the readme, not even searching through the issues.

@Technoblazed

This comment has been minimized.

Copy link

commented Jan 8, 2019

If you add a hook for the player_shoot event, the object for the event includes a player location with vel/pos so you can figure out where the user is shooting.

@saul saul added the question label Jan 8, 2019

@saul

This comment has been minimized.

Copy link
Owner

commented Jan 8, 2019

@DiegoZoracKy has @Technoblazed's answer helped you, or do you have more questions?

@DiegoZoracKy

This comment has been minimized.

Copy link
Author

commented Jan 8, 2019

Thanks @Technoblazed and @saul. I'll try to take a look at this event. Is there some place where I can find a list of all events being emitted?

@DiegoZoracKy

This comment has been minimized.

@DiegoZoracKy

This comment has been minimized.

Copy link
Author

commented Jan 12, 2019

Where should I listen for this event? I tried at gameEvent and entities but I got nothing from them.

@saul

This comment has been minimized.

Copy link
Owner

commented Jan 12, 2019

@DiegoZoracKy what code are you using that isn’t working?

@DiegoZoracKy

This comment has been minimized.

Copy link
Author

commented Jan 12, 2019

@DiegoZoracKy what code are you using that isn’t working?

@saul, I tried with:

demoFile.gameEvents.on('player_shoot', ... and demoFile.entities.on('player_shoot', ....

But based on the list @Technoblazed posted above, it seems that the right event is weapon_fired.

@DiegoZoracKy

This comment has been minimized.

Copy link
Author

commented Jan 12, 2019

I've found the event bullet_impact on https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events , but I can't get any data when trying to listen at demoFile.gameEvents.on('bullet_impact'). Am I listening to it in a wrong way or is this event not being emmited for some known reason?

@saul

This comment has been minimized.

Copy link
Owner

commented Jan 13, 2019

Lots of events are not written to demo files, and so won't be available. It's hit and miss knowing which ones are recorded or not.

I'm pretty sure weapon_fire is networked, though. Please comment if you can't get what you want from that event.

@saul saul closed this Jan 13, 2019

@saul saul added the answered label Jan 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.