Source-Python-Dev-Team / Source.Python

This plugin aims to use boost::python and create an easily accessible wrapper around the Source Engine API for scripter use.
http://forums.sourcepython.com
GNU General Public License v3.0
164 stars 32 forks source link

rendermode - int or str? #29

Closed ThaPwned closed 9 years ago

ThaPwned commented 9 years ago

[SP] Caught an Exception: Traceback (most recent call last): File "..\addons\source-python\packages\custom\rpgz\listenersinit.py", line 36, in call callback(*args) File "..\addons\source-python\plugins\rpg\skills\Stealth.py", line 82, in up playerentity.color = r, g, b, a File "..\addons\source-python\packages\source-python\entities\entity.py", line 241, in setattr super(BaseEntity, self).setattr(attr, value) File "..\addons\source-python\packages\source-python\entities\entity.py", line 312, in set_color self.rendermode = self.rendermode | 1 File "..\addons\source-python\packages\source-python\entities\entity.py", line 235, in setattr self.datamaps[attr]._set_value(value) File "..\addons\source-python\packages\source-python\entities\datamaps.py", line 368, in _set_value getattr(self.current_pointer, self.set_attr)(value, self.offset)

Boost.Python.ArgumentError: Python argument types in Pointer.set_char(Pointer, int, int) did not match C++ signature: set_char(class CPointer {lvalue}, char, int offset=0)

satoon101 commented 9 years ago

That will be changing very soon. The update for get/set_color is already implemented in the entities_changes branch. In the new version, you pass a Color instance to set_color, and get_color returns a Color instance.

https://github.com/Source-Python-Dev-Team/Source.Python/blob/entities_changes/addons/source-python/packages/source-python/entities/entity.py#L270

ThaPwned commented 9 years ago

Wow, that was one fast response! Nice to hear about that. Do you have any ETA on when there'll be a new release available for download?

satoon101 commented 9 years ago

There is no time table. It just depends on when I can finish up the entities_changes.

satoon101 commented 9 years ago

When you get a chance, could you verify that this is fixed in the newest version? Don't forget that when setting the color, you need to pass a Color instance and when getting the color a Color instance is returned.

ThaPwned commented 9 years ago

Yes, it's fixed. Thank you! Sorry for the delay as I didn't have time to test it until now.

satoon101 commented 9 years ago

Thank you for verifying.