Hi,
I want to get the current level's boundaries, I assume I have two choices:
I can either use get_datamap_property_vector() with "m_WorldMaxs" and "m_WorldMins" OR entity.mins and entity.maxs
I know the world's entity inthandle is 0, but it's not like I can do 0.get_datamap_property_vector(...), I have to get the actual entity "variable"
Question is, how to get the entity from its ID/inthandle as you guys call it ?
How to get map info
Re: How to get map info
The Entity class requires an index (not an inthandle), which as you already know is 0 for the world entity:
Syntax: Select all
from entities.entity import Entity
world_entity = Entity(0)
Re: How to get map info
Ah thanks, I didn't know Entity also was a function, that's what I was looking for.
Thanks o/
Thanks o/
Re: How to get map info
Actually, it's not a function, it's a class:
https://docs.python.org/3/tutorial/classes.html
https://docs.python.org/3/tutorial/classes.html
Re: How to get map info
Isn't it.. both? I mean sure Entity is a class but you used the Entity(int i) method above, so.. function too heh
Re: How to get map info
No, it's a class and by doing Entity(<index>) you call the constructor of the Entity class to create an instance of it.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: How to get map info
You can also use the WORLD_ENTITY_INDEX constant, and the world_mins/world_maxs properties:
Syntax: Select all
from entities.constants import WORLD_ENTITY_INDEX
from entities.entity import Entity
world_entity = Entity(WORLD_ENTITY_INDEX)
mins = world_entity.world_mins
maxs = world_entity.world_maxs
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 80 guests