Page 1 of 1

SP's update changes

Posted: Sat May 19, 2018 6:30 pm
by Speed0x
e.g. does ".angles =" only accept QAngle now? It used to accept Vectors too... ( not sure, shouldn't the function read both the same ? )

Code: Select all

Boost.Python.ArgumentError: Python argument types in
    None.None(Entity, Vector)
did not match C++ signature:
    None(class CBaseEntityWrapper {lvalue}, class QAngle {lvalue})


thanks, if someone could clear this for me. i couldn't find this change in the update news...

is there any way i can view all changes in SP for x time? because i haven't updated SP for a while... and may need to update code... without trial and error... thanks again

Re: SP's update changes

Posted: Sat May 19, 2018 8:54 pm
by decompile
Im not exactly sure, but I remember that I've always had to convert the Vector into a QAngle with:

Syntax: Select all

angles = Vector(0, 0, 0)
new_angles = QAngle(*angles)

Re: SP's update changes

Posted: Sat May 19, 2018 9:42 pm
by VinciT
Speed0x wrote:is there any way i can view all changes in SP for x time? because i haven't updated SP for a while... and may need to update code... without trial and error... thanks again
I guess you could go through the commits on github?

Re: SP's update changes

Posted: Sat May 19, 2018 10:09 pm
by satoon101
We do give monthly updates:

viewforum.php?f=40

Each update also includes a link that shows all commits made during that month.

Re: SP's update changes

Posted: Sun May 20, 2018 12:47 am
by Speed0x
so DID ".angles" change in the past ~6 months to accept QAngle only? ( my main question )

about github commits or forums updates: there are a lot of updates, that are enhancements, bug fixes, additions etc.
but as explained, i am looking for a clean overview on crucial changes that need rework more than revision. api def/syntax related changes etc...

and: i am not the keenest fisherman.

thanks

Re: SP's update changes

Posted: Sun May 20, 2018 12:54 am
by satoon101
Yes.

https://github.com/Source-Python-Dev-Te ... n/pull/235

Prior to that pull request, that functionality was primary handled by Python. We moved most of the CBaseEntity properties to C++ for performance reasons. Due to those changes, angles now must explicitly use QAngle and not Vector.

Re: SP's update changes

Posted: Sun May 20, 2018 1:40 am
by Speed0x
thanks i found the issue is with the C++ signature definition of BoostPython..

i think this boost python automatically translates the assertions from its the predefined functions.. and the CBaseEntityWrapper uses QAngle as the input for setangles, so that sp runtime will think vector is a wrong argument when called... although for the actual engine it would work the same way... (matrices/float memory section)...

https://github.com/ValveSoftware/source ... se.cpp#L45#L46

but.. i guess it's nicer to not confuse the 2 and to strictly handle them with their proper nominations.


thanks for the help :)

Re: SP's update changes

Posted: Sun May 20, 2018 6:18 am
by Ayuto
No, there is no issue. Everything works as intended. Even in C++ it would lead to an error when compiling your code if you pass a Vector instance to a function that requires a QAngle instance. You would need to type cast the Vector instance to QAngle before doing that.

Re: SP's update changes

Posted: Sun May 20, 2018 6:25 pm
by Speed0x
okay whatever...