Page 1 of 1

How to use SetPropVector?

Posted: Sat Sep 01, 2012 10:27 pm
by Kamiqawa
Hello,
I tried to figure out how this thing works, but didn't get it function properly.

So what type of argument should I use in setpropvector like this?

Syntax: Select all

player.SetPropVector


Here is what I thought it could be:

Syntax: Select all

player.SetPropVector('CBaseEntity.m_vecOrigin', ','.join(['0', '0', '0']))


As I think it was used that way back in the ES.PY. Correct me if I'm wrong.

It gives error like this:

Syntax: Select all

TypeError: Could not access the prop value in this type.


How would I use that thing properly? Is the SetPropVector even the right SetProp type for that? And I'm not even sure if that exact prop even exists, but there are also others with the same type of arguments required. Oh and could some one also tell me how to use that Entity.DumpServerClasses as I would like to get the list of those things (or could someone get and post them somewhere for us?).

Thank you.

Posted: Sat Sep 01, 2012 11:39 pm
by Omega_K2

Posted: Sun Sep 02, 2012 12:04 am
by satoon101
Yes, you cannot pass a vector string, you need to pass an actual vector.

Satoon

Posted: Sun Sep 02, 2012 4:14 am
by satoon101
Sorry, meant to post an example, but forgot:

Syntax: Select all

from Source import Shared

vector = Shared.Vector(22.33, 88.77, 99.11)
That is a vector instance. You can then use:

Syntax: Select all

vector.x = 44.22
to change the x value of the vector.

Do note that "currently" it is in the "Shared" module, so it will likely be moved at some point. We use the "Shared" module to store classes/functions that we do not know at the time where to put it. We will post when we move any Shared classes/functions to a different module.

Satoon

Posted: Sun Sep 02, 2012 9:56 am
by Kamiqawa
Thank you. That was exactly what I needed. Thanks for the example too. :)