
Get the current map?
Get the current map?
Hi, quick question, can we get the current map yet with the September 7 release? 

That was already possible in previous releases 
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/globals/globals_wrap_python.cpp#L142

https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/globals/globals_wrap_python.cpp#L142
Woah! I didn't know 'globals' existed. How to import it? like that? =) Okay, got it:Or is it just like a python property?
Syntax: Select all
from globals import global_vars
Syntax: Select all
from core import global_vars
# usage
global_vars.mapname() # right?
Yes, it is now global_vars.map_name. All singletons exposed from C++ and objects that are the one and only instance of a class were renamed from CamelCaps to lower_with_underscores a few weeks ago.
If you look at the link Ayuto provided, you should notice that anything that is defined by .add_property is a retrievable property value. Anything defined by .def_readwrite is a readable/writable attribute. And, anything defined by .def is a member function.
Also, anything that has NOT_IMPLEMENTED in front of it, is defined on an engine-by-engine basis.
One more thing, while the wiki is still a work in progress, the core package has been documented for some time:
http://wiki.sourcepython.com/index.php/core
http://wiki.sourcepython.com/index.php/core#global_vars
http://wiki.sourcepython.com/index.php/core#map_name
If you look at the link Ayuto provided, you should notice that anything that is defined by .add_property is a retrievable property value. Anything defined by .def_readwrite is a readable/writable attribute. And, anything defined by .def is a member function.
Also, anything that has NOT_IMPLEMENTED in front of it, is defined on an engine-by-engine basis.
One more thing, while the wiki is still a work in progress, the core package has been documented for some time:
http://wiki.sourcepython.com/index.php/core
http://wiki.sourcepython.com/index.php/core#global_vars
http://wiki.sourcepython.com/index.php/core#map_name
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 122 guests