-
Notifications
You must be signed in to change notification settings - Fork 31
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
Improved WeaponClass, WeaponID, WeaponType, and WeaponSlot for CS:GO/CS:S. #478
base: master
Are you sure you want to change the base?
Conversation
Added WeaponType to CS:GO.
Changed WeaponClass.slot to return WeaponSlot. Changed WeaponClass to be able to reference parent_class. Added missing WeaponClass data for CS:GO.
Why is #459 not merged? |
I have not looked much into it but at first glance, I'm wondering if there is any specific reason for triplicating the data? |
What exactly are you referring to? I added WeaponID to csgo.ini, cstrike.ini first because it is easier to look up, and also because there is no item_definition_index in cstrike. |
Wouldn't it be better for For example: [[awp]]
id = AWP
type = SNIPERRIFLE
slot = PRIMARY
maxammo = 30
ammoprop = 6
clip = 10
cost = 4750
tags = "all,primary,rifle,sniper" |
Are you saying that item_definition_index should be deprecated?
Only CS:GO/CS:S are going to be handled like that? It seems that games other than TF2 don't have ID, Type, Slot constants in the first place. |
We can keep the property itself for backward compatibility, but I don't think duplicating the value for each section in the data file is necessary when both can point to the
I think they all do, but we simply don't have data for them. Perhaps a simple |
Agreed.
The item_definition_index is used in CS:GO to sort out duplicate weapon classes, in CS:GO the item_definition_index and WeaponID are identical, but in TF2 there seems to be no relationship between the item_definition_index and WeaponID as far as I looked in items_game.txt. If TF2 doesn't have the problem of duplicate weapon classes, or if we don't plan to specifically reference item_definition_index in the future, we could reference it from WeaponID only. Is that all right then? |
…nts' name. Added sniperrifle, assaultrifle, submachinegun, mg tags to CS:GO/CS:S weapon data. Added cant_create, cant_find, and parent tags to CS:GO weapon data. Changed Entity.create, Entity.find, and Weapon.weapon_name in CS:GO to use new added tags with WeaponClassIter.
All changes have been completed. |
I guess that is something that can be addressed if data for this game is ever added.
../instance.py#192 will produce a |
I guess I didn't test with data that included digits, my bad. |
Some WeaponID and WeaponType names were changed to match the names used internally in CS:GO/CS:S.
This will allow you to get the ID by weapon class name or pass an argument with WeaponType.name to an in-game function that takes the name of the WeaponType.