-
Notifications
You must be signed in to change notification settings - Fork 95
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
Distinction between bought and picked up weapon #146
Comments
Hmm, interesting problem. Unfortunately I don't have a quick answer. It would probably be worth it to integrate this directly into the library. I will do some more testing, depending on the findings a PR would be very welcome 😄 |
Side note: your current code will think knifes and starter pistols are bought. This may or may not be what you want. |
I personally think that However
Thank you for your care 😃 app.nonBuyable = map[common.EquipmentElement]bool{
common.EqGlock: true,
common.EqP2000: true,
common.EqUSP: true,
common.EqKnife: true,
common.EqBomb: true,
} |
Good point, yeah. I guess for the flashbang having the custom rule until #145 is solved would be acceptable. But if you'd rather wait for that to be resolved that's fine as well, I think it shouldn't be too long away.
Technically, a Glock or USP can be bought if dropped first. But I assume that edge case is not super important 😄 |
That's true, I'm just hoping that in a real game (and I was recently working hard on eliminating all the unimportant rounds from the competitive game) when the player actually wants to win they wouldn't do such a nonsense 😃 |
TBH I think that your library, being in a sense a fundamental one, shoudn't rely on such rules as mine for a second flashbang 🙂 There always might be a case when e.g. a |
I agree, but from what I understand this situation would actually be covered by the buytime check. But anyway, it's certainly safer to wait since we don't know all the edge cases. |
Not really, in this particular case This actually is the real problem I've encountered when parsing some MM demos. DD2 seems to be the only map where such situations (player's death in the buy zone in the first seconds of the round) can occur but still it is affecting my economy calculations 😞 I probably should implement some other checks like "have the player spent money equivalent of the item in the same tick as they have picked it up" but I don't know how to perform it aside from storing all players' money which they had in the previous availiable frame which is not reliable since there are some demos where there can be up to 13 in-game ticks between two demo frames and theoretically a player can obtain several new items in between. |
Ahhh, bollocks! Yeah we definitely better wait then. |
So with #147 being merged, do you think your fix would be possible now? If so please feel free to file a PR 🙂. |
Well #147 doesn't really solve this issue: while we are now able to tell how many flashbangs a player has, there is still no way to tell if the second flashbang was bought or picked up since I suspect that there is some fix that can help us but I don't know how to implement it. Let me describe why do I think so: Case 1: a player has no flashbangs and they pick up (and I mean actually pick up) one. Now the flashbang they have has the same Case 2: a player has one flashbang and they pick up or buy another one. Now So I think there should be a method to catch this moment when |
Hmm you're right.
Not quite,
I think you're right with that, thanks for your inputs! Let's see if we can make this work somehow 😅. |
It appears like this isn't possible for flashbangs, sorry. We can't create a new
The So I think for now there is no way to do this 🙁 . |
So all we know is that a player somehow accquired the second flashbang? That's a pity. |
You could try to use But I woudln't want to integrate this into the library, seems a bit too hacky to support officially. |
Yeah I agree. And also I forgot that we don't have information about each and every tick and there, as I have already mentioned above, might be a gap up to 13 ticks so the player can buy several items in between. |
right, good point as well. quite unfortunate. |
From what i understand the problem here is just for flash bangs in case a player already has one. Would it be possible to implement it for everything else? Either with a "yes, no, dont know" logic or as |
I agree with @JanEricNitschke if it works for everything except the flashbangs, then this is still a very useful tool. |
In my application I'm trying to track all player's purchases. For this purpose I use
ItemPickup
event, itsWeaponTraceable()
method and my own internal structure that maps every weapon's ID to its owner:This works perfectly for any weapon except flashbang. When a player buys a second flashbang, they already have this weapon and therefore
weaponOwner[weaponTraceable.UniqueID()]
stores a value for it. Currently I use a separate rule for second flashbang which looks like this:where
app.freezetime
is binded to"cs_gamerules_data.m_bFreezePeriod"
property of"CCSGameRulesProxy"
server class on entity creation,app.roundBeginTime
gets updated every time a freezetime ends andapp.buyTime
is accuired fromapp.parser.GameState().ConVars()["mp_buytime"]
.This seems to be working but still could possibly be the cause of some bugs later on. So my question is -- what is a proper way to determine if a player actually bought a second flashbang?
The text was updated successfully, but these errors were encountered: