Cycle in Python

Dniwe

Chieftain
Joined
Mar 19, 2015
Messages
7
How to make cycle for the spawning units in python? For example I'm interested 3x3 plot.
 
Could you perhaps tell us a lot more about just what it is you want to do? As in, go into detail.
 
If you want to loop all plots around you, I think the answer lies in CyGameCoreUtilsInterface.cpp
python::def("plotDirection", cyPlotDirection, python::return_value_policy<python::manage_new_object>(), "CyPlot* (int iX, int iY, DirectionTypes eDirection)");

Code:
DIRECTION_NORTH,
DIRECTION_NORTHEAST,
DIRECTION_EAST,
DIRECTION_SOUTHEAST,
DIRECTION_SOUTH,
DIRECTION_SOUTHWEST,
DIRECTION_WEST,
DIRECTION_NORTHWEST,
or in a more human readable way
Code:
7 0 1
6 X 2
5 4 3
However I don't know how to call this from python. It doesn't look like vanilla is using it and I haven't tried using GameCoreUtils from python. Presumably for performance reasons, such checks are all done in the DLL and that's where I would put it too. Mac support would be the only reason I can think of where it makes sense to do something like this in python.


Because the question is rather open on what you want, I don't know if I answered what you asked for. If not, then write a longer question to explain what you want to do.
 
Back
Top Bottom