Entity set_color method

Please post any questions about developing your plugin here. Please use the search function before posting!
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Entity set_color method

Postby arawra » Wed Dec 31, 2014 12:59 am

Whenever I try calling the set_color method, I keep getting a conversion error (Python int too large for C long).

Syntax: Select all

PlayerEntity(playerIndex).set_color((255,255,255,15))
User avatar
satoon101
Project Leader
Posts: 2703
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Dec 31, 2014 1:26 am

That has been fixed in the entity_changes/entity_update branches. I think we are very close to merging those into master.

Also, I mentioned this in another thread, but it isn't fully relevant to your question. In the future, instead of passing 3/4 integer values directly, you will pass a Color instance:
http://wiki.sourcepython.com/pages/basetypes#Color

There is also a colors module which provides base colors:
http://wiki.sourcepython.com/pages/colors

To get a new alpha value for any of the base colors, use their with_alpha method:
http://wiki.sourcepython.com/pages/basetypes#with_alpha
Image

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 104 guests