We apologize for the slowness. I've uploaded the latest build of Source Python for both Windows and Linux.
You can grab that here.
Please note that this build is for CSGO only at the moment.
What this build contains:
This is the first build of Source Python on the source-python-2 branch, our core restructuring. Due to that, the "changelist" is essentially what you see on our Wiki. We have made a policy internally to always ensure our documentation stays in sync with our feature set, so everything in the binaries is on various wiki pages.
Short list of features:
- Much more robust core interface.
- Entity send prop support.
- Better entity manipulation functions.
- Changed module naming convention.
Cool stuff you can do:
We now have a CEdict class. This allows us to provide extremely useful wrappers around entity retrieval. Currently, you can retrieve entities in two ways. Here is how you can get an entity by index:
Syntax: Select all
#
# Imports
#
from Source import entity_C
#
# Functions
#
def some_function():
worldspawn = entity_C.CEdict(0)
print(worldspawn.get_class_name())
Here is how you can achieve the same result via entity name:
Syntax: Select all
#
# Imports
#
from Source import entity_C
#
# Functions
#
def some_function():
worldspawn = entity_C.CEdict("worldspawn")
print(worldspawn.get_index())
Note that in either case, you can call .get_index() to retrieve the index of that entity.
We also have the ability to do partial name matching. The default is to do an exact match, but if you pass in False as the second parameter to the CEdict constructor, it will return the first partial match:
Syntax: Select all
#
# Imports
#
from Source import entity_C
#
# Functions
#
def some_function():
worldspawn = entity_C.CEdict("worldsp", False)
print(worldspawn.get_index())
This version of Source.Python also adds in the ability to set entity send prop data. Currently, this is limited to strings, floats, and integers, but the next release will support all send property types. Here's how to set the health of a player. In the interest of getting people acquainted quickly, the following code assumes that you are alone on the server with no bots:
Syntax: Select all
#
# Imports
#
from Source import entity_C
#
# Functions
#
def some_function():
Player = entity_C.CEdict("player")
Health_Prop = Player.get_prop("m_iHealth")
Health_Prop.set_int(15)
We will be providing wrapper classes around the entity props so don't be too concerned about .set_<type>.