Looking at the python api for BtS1.71
The info base classes when called return nothing or zero
That is because they are just constructors.
However, something like
test = gc.getTerrainInfo(int TerrainType).getAIWeightPercent(int YieldType)
Returns a value one would expect the AI to be placing on a given plot
if the TerrainType is found by aplot.getTerrainType() and YieldType is zero for food
The issue however, is the value returned isn't the weight the AI placing on that given plot, but the weight the AI places on that type of plot, ie grass as a whole
The other issue is many of the python methods(attributes) that the api gives that appear to be useful are unusable, in that the self of that python method that referrences some c++ function in the corresponding .cpp, when passed along to the c function, is expecting an lvalue, that is the long int address which will contain the address of the object. python is passing along a long int that is the address of the self object, which in naturally does not contain a memory address, it is the memory address of the object.
This leaves me to believe, that many of these useful python methods, such as plot.getNaturalYield
have to be looked at in the corresponding .cpp to see what algorthim is executed and replicated in python using what methods InfoBase type classes make aviable, to come up with a psusdo AI weight that the core dllAI maybe working with to decide where to build, a farm for example.
Tomorrow, I am going to take one last shot at getting at these python api functions that when used throw a python exception no lvalue passed, by importing the ctype module in to my python class and going after these functions in dll directly.
The info base classes when called return nothing or zero
That is because they are just constructors.
However, something like
test = gc.getTerrainInfo(int TerrainType).getAIWeightPercent(int YieldType)
Returns a value one would expect the AI to be placing on a given plot
if the TerrainType is found by aplot.getTerrainType() and YieldType is zero for food
The issue however, is the value returned isn't the weight the AI placing on that given plot, but the weight the AI places on that type of plot, ie grass as a whole
The other issue is many of the python methods(attributes) that the api gives that appear to be useful are unusable, in that the self of that python method that referrences some c++ function in the corresponding .cpp, when passed along to the c function, is expecting an lvalue, that is the long int address which will contain the address of the object. python is passing along a long int that is the address of the self object, which in naturally does not contain a memory address, it is the memory address of the object.
This leaves me to believe, that many of these useful python methods, such as plot.getNaturalYield
have to be looked at in the corresponding .cpp to see what algorthim is executed and replicated in python using what methods InfoBase type classes make aviable, to come up with a psusdo AI weight that the core dllAI maybe working with to decide where to build, a farm for example.
Tomorrow, I am going to take one last shot at getting at these python api functions that when used throw a python exception no lvalue passed, by importing the ctype module in to my python class and going after these functions in dll directly.