Baldry,
I have a fully working .py class, so I know the issue isn't
my class define and such
I written a test method called doTest
def doTest(self, iX, iY, count):
if (count == 2):
# M = 5x5 matrix seeded with values
# I truncated it here
M = [[[-2, -2],...,[2, -2]],...,[[-2, 2],...,[2, 2]]]
else:
M = [[[-1,-1],[0,-1],[1,-1]],[[-1,0],[0,0],[1,0]],[[-1,1],[0,1],[1,1]]]
for j in range(count*2+1):
for I in range(count*2+1):
M[j][0] = iX+M[j][0]
M[j][1] = iY+M[j][1]
pInterface.addInstantMessage(str(M), "")
Then in someother method I call the doTest method
self.doTest(22, 35, 2)
Works I like a charm
When change the count var to one
it fails
If I restart the game up, count still equal to one
Works like a charm
I can even step up count to two
Still works
However if change count in self.doTest back to one
It fails again
What gives here?
I thinking it has something to do with this M array.
However should not M be private to doTest.
I copied the function and made the changes needed
to make two doTest's
One called doTest5x5 and other called doTest3x3
The script now works like a charm
When I test count in my calling method by
if (count == 2):
self.doTest5x5(22, 35, 2)
else:
self.doTest3x3(22,35,1)
Not my preferred solution, but one I can live with.
Do you have any insight with what is going on here.
I even tried
del M in the last line of orginal doTest method
thinking it is some garbage collection issue.
Thanks for your time
I have a fully working .py class, so I know the issue isn't
my class define and such
I written a test method called doTest
def doTest(self, iX, iY, count):
if (count == 2):
# M = 5x5 matrix seeded with values
# I truncated it here
M = [[[-2, -2],...,[2, -2]],...,[[-2, 2],...,[2, 2]]]
else:
M = [[[-1,-1],[0,-1],[1,-1]],[[-1,0],[0,0],[1,0]],[[-1,1],[0,1],[1,1]]]
for j in range(count*2+1):
for I in range(count*2+1):
M[j][0] = iX+M[j][0]
M[j][1] = iY+M[j][1]
pInterface.addInstantMessage(str(M), "")
Then in someother method I call the doTest method
self.doTest(22, 35, 2)
Works I like a charm
When change the count var to one
it fails
If I restart the game up, count still equal to one
Works like a charm
I can even step up count to two
Still works
However if change count in self.doTest back to one
It fails again
What gives here?
I thinking it has something to do with this M array.
However should not M be private to doTest.
I copied the function and made the changes needed
to make two doTest's
One called doTest5x5 and other called doTest3x3
The script now works like a charm
When I test count in my calling method by
if (count == 2):
self.doTest5x5(22, 35, 2)
else:
self.doTest3x3(22,35,1)
Not my preferred solution, but one I can live with.
Do you have any insight with what is going on here.
I even tried
del M in the last line of orginal doTest method
thinking it is some garbage collection issue.
Thanks for your time