Quote:
Originally Posted by Potato Uno
Or we can use Friagram's extension which works entirely in sourcepawn.
|
Frigram's extension uses the web api which goes down as much as steamcommunity.com. Not something you want to rely on.
As proven by TF2ItemsInfo, parsing the VDF in sourcepawn is going to take 10x longer than doing it in Python.
Quote:
Originally Posted by Potato Uno
Or we can not use tf2itemsinfo and write our own parser (since items_game.txt is ultimately a keyvalue file). In the case of TF2 BWR (Michal's, Leornado's, Benoist's plugin), they don't need all the offerings of TF2ItemsInfo. They only need it to get the weapon class of an item (e.g. "tf_weapon_minigun"), which can also be obtained directly from items_game.txt itself (and parsed into an adt_trie). They don't need any data on hats or cosmetics (bar gatebot hats). So purposely ignore the thousands of miscs Valve has put in the game, and suddenly the data needed from items_game.txt is much smaller. This also applies for the give weapon plugin.
Take only what you need, not what you don't need. (Inspired from asherkin from here.)
There are other alternatives. [For once I agree with Michal.]
|
And what happens when one day you need the slot of an item or an attribute? Are you going to end up duplicating tf2itemsinfo? What happens when you need another plugin that requires the same thing? Are you going to have 3 different plugins parsing items_game.txt? Things like this belong in a single plugin.
__________________