Is it possible to change an entity collision group?
Entity(index).get_property_float('m_CollisionGroup')
This doesn't work
Changing entity collision group?
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Changing entity collision group?
This is not a float. That being said, that property is aliased: CBaseEntity.ini#L76
Syntax: Select all
Entity(index).collision_group
Re: Changing entity collision group?
How would I set the collision group? If I print that it just says NONE
Re: Changing entity collision group?
NONE is from CollisionGroup.NONE:
https://github.com/Source-Python-Dev-Te ... p.cpp#L357
To set it, just use the CollisionGroup enum:
https://github.com/Source-Python-Dev-Te ... p.cpp#L357
To set it, just use the CollisionGroup enum:
Syntax: Select all
from entities.constants import CollisionGroup
Entity(index).collision_group = CollisionGroup.PLAYER
Re: Changing entity collision group?
I just want to clarify that collision_group is under BaseEntity and not Entity so it is confusing in the documentation. Just to be clear all of BaseEntity functionality works with Entity?
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Changing entity collision group?
Entity inherits from BaseEntity: _base.py#L73. So yes, everything available in BaseEntity is available for Entity but not the other way around (see Entity as being an extended version of BaseEntity).
Re: Changing entity collision group?
Notice that the second line under a class declaration in the documentation lists the "Bases" (or inherited classes) of that class.
http://wiki.sourcepython.com/developing ... ity.Entity
The documentation would grow exponentially if we listed all functionality under each class that it inherits from another.
http://wiki.sourcepython.com/developing ... ity.Entity
The documentation would grow exponentially if we listed all functionality under each class that it inherits from another.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 92 guests