Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Access all object's properties with phyton

Hi, i wish to know if there is some kind of function, method or command that lets you get/view/list all properties of an objetc, like the health of an enemy or it’s position.

You can find the entities position and health by clicking on the entity. Image shown below.

img1

To add to what Ufy said, if you want to access these properties in code, you could create a list of their properties using unit.health, unit.maxHealth, unit.pos, unit.target.
Danny

1 Like

what i want is to be able lo view/list all properties of an objetc, even unknowing wichs ones it has, something like dir() function.

I’m still not sure exactly what you mean. As far as I know there isn’t anything like that in CodeCombat.
What kind of output would you be looking for?

1 Like

These might not be implemented in this “game”, is a function, something like getmembers() phyton function, i want to be able to list all methods/properties of a phyton object, to be able to invoke them by watching a list, this allows you as ex: to store all available methods of an objetc in an array, by names, as strings, even if you dont know the methods name.