Full API reference for Python


#1

Specifically, I’m looking for information about what members are present on what objects. I didn’t know until late in the forest that the result returned by self.findNearestEnemy has a “pos” property. I tried:

self.say(dir(enemy))

But the interpreter choked on it. I was hoping for some sort of “id” field, so I can determine when self.findNearestEnemy is returning a new enemy, or other ways to determine when I’ve killed my previous target.


#2

enemy.health <= 0

is what I use (Well, actually the opposite, alive is: enemy.health > 0)


#3

Here are the one’s that I know of.

Enemy:
.id
.health
.pos
.team
.type
.maxHealth

Item:
.type
.bountyGold
.pos


[searching] Complete List of options
#4

Standard enemies also have a target property and the distanceTo, hasEffect, and findNearest methods.

At some point we’ll be able to show you those API properties by either clicking on the unit you want to know about, or hovering over it using the hover debugger, but I haven’t gotten any good UI ideas for the first one, and I haven’t fixed the remaining bugs to re-enable the second one yet.


#6

@coder0xff

you can see in detail all propieties in :


select a enemy
and pick the properties tab

:smile:

newfound!
Or all list in:


documentation tab

<3


#8

@codehimn
Thanks for posting this. I’ve been trying to find a reference list for all the properties that can be accessed so I can make smarter AI code for my hero in the brawl mission. Still trying to puzzle out how to generate random numbers via LUA too in this interface since any attempt that uses default LUA syntax that I’ve tried so far has only errored out. I’ll figure it out eventually.