Page 1 of 1
Information lib with constants in it
Posted: Sun Sep 02, 2012 3:04 pm
by Absolute
It would be cool to have a library from which you can import constants from, to make the code more readable.
For example you could have
CS_TEAM_CT = 3, or you could have all the
flags in that lib.
Posted: Sun Sep 02, 2012 3:06 pm
by Mahi
Indeed, would make things a lot easier. Then again, you can write it in a simple .py file by yourself too. Also, there seems to be a small discussion about team's already, you should check the
page 2 atleast.
Posted: Sun Sep 02, 2012 4:39 pm
by Omega_K2
Mh, another approach is to do this with ini files. Though py should just work as well.
Though I think there should be more general constants like TEAM_UNASSIGNED TEAM_SPECTATOR TEAM_1 TEAM_2 or so to make things compatible. Actually something else to discuss is whether to make constants really constant, so you can't change their values (by accident/easily).
Posted: Mon Sep 03, 2012 1:05 am
by BackRaw
There actually is a .ini file for this... but IDK what it is being used for, or how you can use it
easily (without the need to ConfigObj it yourself) in scripts:
http://code.google.com/p/source-python/source/browse/addons/source-python/_libs/_data/players/teams/csgo.ini
Posted: Mon Sep 03, 2012 2:14 pm
by satoon101
Currently that file is only used for PlayerIter. It uses the game's .ini file to add the teams to the filter manager.
Satoon
Posted: Mon Sep 03, 2012 7:51 pm
by BackRaw
satoon101 wrote:Currently that file is only used for PlayerIter. It uses the game's .ini file to add the teams to the filter manager.
Satoon
So we can assume this file will be used later for the whole plugin? =)
Posted: Mon Sep 03, 2012 9:22 pm
by satoon101
It can be used by anyone for any purpose right now. I only said "currently" because we could end up using it for other functionality later in development.
Satoon
Posted: Mon Sep 03, 2012 10:36 pm
by BackRaw
satoon101 wrote:It can be used by anyone for any purpose right now. I only said "currently" because we could end up using it for other functionality later in development.
Satoon
Yeah, that's what I also meant =) you're doing great work with this!