Page 1 of 1

[Python] FindDistance

Posted: 08.01.2013 1:18
by Penny
Seems like I cannot access the FindDistance variable:

Code: Select all

print(FindDistance)
produces this error:
NameError: name 'FindDistance' is not defined.

Am I doing this wrong or is it not yet implemented in Python? Works on Pascal. Using the latest version of stealth. Or is there a way to work around it (searching items more than 2 tiles away).

Re: [Python] FindDistance

Posted: 08.01.2013 2:59
by Penny
Figured it out.

Need to use function SetFindDistance(5) to change it. (Just randomly tested it).

Re: [Python] FindDistance

Posted: 08.01.2013 4:11
by nah nah
next time use

Code: Select all

import stealth
print(dir(stealth))
:wink:

Re: [Python] FindDistance

Posted: 19.02.2013 13:10
by Boydon
Penny wrote:Seems like I cannot access the FindDistance variable:

Code: Select all

print(FindDistance)
produces this error:
NameError: name 'FindDistance' is not defined.
Correct version is:

Code: Select all

print(FindDistance())
Function calls in Python need parentheses. :)