Full API reference for Python

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.

1 Like

enemy.health <= 0

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

1 Like

Here are the one’s that I know of.

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

Item:
.type
.bountyGold
.pos

2 Likes

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.

@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

1 Like

Hi, I think this topic is still actual. Don’t you plan to realize the things you suggested?

Or, wouldn’t it suffice just to give a short paragraph listing at least all the basic properties of enemies and items somewhere? I think this would help the learners to focus more on the coding itself, spending less time Googling for aspects of the game itself.

Hi there, thanks for this tip! Yet, it took me some time to really get to the properties. So here is an example screenshot of how you can get to them on a selected object:

Maybe someone will find this useful. :slight_smile: