How to use SetPropVector?

Please post any questions about developing your plugin here. Please use the search function before posting!
Kamiqawa
Junior Member
Posts: 6
Joined: Sat Sep 01, 2012 3:23 pm

How to use SetPropVector?

Postby Kamiqawa » Sat Sep 01, 2012 10:27 pm

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.
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Postby Omega_K2 » Sat Sep 01, 2012 11:39 pm

User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Sep 02, 2012 12:04 am

Yes, you cannot pass a vector string, you need to pass an actual vector.

Satoon
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Sep 02, 2012 4:14 am

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
Kamiqawa
Junior Member
Posts: 6
Joined: Sat Sep 01, 2012 3:23 pm

Postby Kamiqawa » Sun Sep 02, 2012 9:56 am

Thank you. That was exactly what I needed. Thanks for the example too. :)

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 21 guests