Changes to the engine?
Posted: Sat Jun 18, 2016 5:12 pm
Hey there,
I've noticed that some previously working code started throwing exceptions and I'm not sure if there were changes made to the engine (Counter-Strike: Source) or these changes are SP-related
For example,
now raises the following exception
Okay, it got replaced with
though I don't know what old '512' even meant, I couldn't find in LifeState enum.
Then,
suprisingly fails with the following exception:

I believe type_name contains something invalid and raises when getting concatenated to 'get_'.
Then,
fails similarly to the m_lifeState:
Note that I can't use player.team because despite being defined in data files for CBaseEntity, for player entities it gets overridden by property(get_team, set_team):
And playerinfo's team is a different thing. I need to be able to switch player without him dying and without class selection screen.
Any news? What had happened? These are 3 bits I've discovered, but the plugin doesn't work at all, so I guess fixing these will get me to new bugs.
I've noticed that some previously working code started throwing exceptions and I'm not sure if there were changes made to the engine (Counter-Strike: Source) or these changes are SP-related
For example,
Syntax: Select all
player.set_property_int('m_lifeState', 512) # Part of the old respawning code
now raises the following exception
TypeError: Property 'm_lifeState' is of type uchar not int
Okay, it got replaced with
Syntax: Select all
player.life_state = LifeState.ALIVE
though I don't know what old '512' even meant, I couldn't find in LifeState enum.
Then,
Syntax: Select all
weapon.ammoprop
suprisingly fails with the following exception:

I believe type_name contains something invalid and raises when getting concatenated to 'get_'.
Then,
Syntax: Select all
player.set_property_int('m_iTeamNum', 2)
fails similarly to the m_lifeState:
TypeError: Property 'm_iTeamNum' is of type char not int
Note that I can't use player.team because despite being defined in data files for CBaseEntity, for player entities it gets overridden by property(get_team, set_team):
Syntax: Select all
def get_team(self):
"""Return the player's team.
:rtype: int
"""
return self.playerinfo.team
def set_team(self, value):
"""Set the players team."""
self.playerinfo.team = value
team = property(get_team, set_team)
And playerinfo's team is a different thing. I need to be able to switch player without him dying and without class selection screen.
Any news? What had happened? These are 3 bits I've discovered, but the plugin doesn't work at all, so I guess fixing these will get me to new bugs.