weapons lib - heads up

All other Source.Python topics and issues.
Tuck
Global Moderator
Posts: 205
Joined: Sat Jul 14, 2012 9:35 pm
Location: Copenhagen

weapons lib - heads up

Postby Tuck » Fri May 09, 2014 7:32 pm

Syntax: Select all

[SP]  Caught an Exception:
Traceback (most recent call last):
File '../addons/source-python/packages/source-python/events/listener.py', line 84, in fire_game_event
callback(game_event)
File '../addons/source-python/plugins/tuck/tuck.py', line 456, in player_death
clip = attacker.get_primary_clip()
File '../addons/source-python/packages/source-python/players/weapons.py', line 114, in get_primary_clip
return self._get_weapon_clip(is_filters='primary')
File '../addons/source-python/packages/source-python/players/weapons.py', line 127, in _get_weapon_clip
index = self.get_weapon_index(classname, is_filters, not_filters)
File '../addons/source-python/packages/source-python/players/weapons.py', line 335, in get_weapon_index
for index in self.weapon_indexes(classname, is_filters, not_filters):
File '../addons/source-python/packages/source-python/players/weapons.py', line 357, in weapon_indexes
handle = self.GetPropInt(WeaponManager.myweapons + '%03i' % offset)
File '../addons/source-python/packages/source-python/entities/entity.py', line 116, in __getattr__
raise AttributeError('Attribute '{0}' not found'.format(attr))

AttributeError: Attribute 'GetPropInt' not found


edit: fixing locally however heads up for devs or other users until next release. Fix get_prop_int

for further small mistakes in libs should it be posted in issues list?
-Tuck
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri May 09, 2014 7:36 pm

I have been slowly working on this in another branch. Once I get it completed, I will merge it into the master branch.
Tuck
Global Moderator
Posts: 205
Joined: Sat Jul 14, 2012 9:35 pm
Location: Copenhagen

Postby Tuck » Fri May 09, 2014 7:38 pm

Okay did you notice after the "fix" i though would fix it

Code: Select all

[SP]  Caught an Exception:
Traceback (most recent call last):
  File '../addons/source-python/packages/source-python/events/listener.py', line 84, in fire_game_event
    callback(game_event)
  File '../addons/source-python/plugins/tuck/tuck.py', line 454, in player_death
    clip = attacker.get_secondary_clip()
  File '../addons/source-python/packages/source-python/players/weapons.py', line 120, in get_secondary_clip
    return self._get_weapon_clip(is_filters='secondary')
  File '../addons/source-python/packages/source-python/players/weapons.py', line 127, in _get_weapon_clip
    index = self.get_weapon_index(classname, is_filters, not_filters)
  File '../addons/source-python/packages/source-python/players/weapons.py', line 335, in get_weapon_index
    for index in self.weapon_indexes(classname, is_filters, not_filters):
  File '../addons/source-python/packages/source-python/players/weapons.py', line 375, in weapon_indexes
    edict = Edict(index)

Boost.Python.ArgumentError: Python argument types in
    Edict.__init__(Edict, int)
did not match C++ signature:
    __init__(_object*)
-Tuck
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri May 09, 2014 7:41 pm

You cannot instantiate an Edict instance. We replaced that functionality in favor of the conversions functions. For that one, use:

Syntax: Select all

from entities.helpers import edict_from_index
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri May 09, 2014 8:09 pm

If you look at the other branch, you will see I have already made these fixes:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/weapons/addons/source-python/packages/source-python/players/weapons/__init__.py#L347

I will work on this a bit today and tomorrow to see if I can get the functionality finished and merge. No guarantees, though.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 141 guests