Page 1 of 1

BaseEntity(index).owner error

Posted: Wed Jan 28, 2015 1:01 am
by BackRaw
Hi,

I'm getting this error

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File '../addons/source-python/packages/source-python/events/listener.py', line 90, in fire_game_event
    callback(game_event)
  File '../addons/source-python/plugins/simpledm/simpledm.py', line 193, in player_death
    for idle in filter(lambda x: x.owner == -1, entityiter_idle):
  File '../addons/source-python/plugins/simpledm/simpledm.py', line 193, in <lambda>
    for idle in filter(lambda x: x.owner == -1, entityiter_idle):
  File '../addons/source-python/packages/source-python/entities/entity.py', line 83, in __getattr__
    raise AttributeError('Attribute '{0}' not found'.format(attr))
 
AttributeError: Attribute 'owner' not found
everytime I try this:

Syntax: Select all

from filters.entities import EntityIter
from entities.helpers import remove_entity
from events import Event

# generator for idle weapons
entityiter_idle = EntityIter("weapon_", False, "entity")


@Event
def player_death(game_event):

for idle in filter(lambda x: x.owner == -1, entityiter_idle):
remove_entity(idle.index)
What's wrong here?

EDIT: Using the January 17 release

Posted: Wed Jan 28, 2015 1:52 am
by satoon101
Which game is this for? If it is for CS:S, make sure when you updated SP last that you also updated the ../addons/source-python/data/source-python/entities/ directory. If it is for CS:GO, then the 'owner' property was not added until after the latest release.

Posted: Wed Jan 28, 2015 5:13 pm
by BackRaw
It's for CS:S. Okay I'll check :)

Posted: Thu Jan 29, 2015 12:28 am
by BackRaw
Works now. :D