I’m fairly new to Terminal and as such i’m still learning all the functions and stuff.
I got my algo to detect where all my destructors are placed but my main issue right now is determining the health of those units. How could I go about reading their health?
@kkroep Thank You so Much!!! I have a questions though… what does the [0] signify?
Also how would I go about debugging things like determining values and printing them out to the console?
You get a list of all units on that square. For example you could get a list of 10 different pings. You already check if there exists a stationary unit, at which point there will be only one unit, but still it returns a list with one unit, not the unit itself. By picking the first element of that list you get the unit you want. Actually the code is pretty well documented. Look in the game_map.py file for the function used, and it will make more sense.
Debugging can be done with:
if game_state.contains_stationary_unit([27,13]):
unit = game_state.game_map[27,13][0]
stability = unit.stability
gamelib.debug_write('stability of corner unit is {}'.format(stability))
If that is not enough info to find out things yourself, maybe it is a good idea to look up some python tutorials. My recommendation for a quick lookup would be learnxinyminutes.com