You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to check if Medivac could use their boost, I tried checking if the medivac was actually boosted, checking its buffs. I've found the Medivacspeedboost buff in the list, but when a medivac is boosted, it doesn't have any buffs.
my code reads as follow but doesn't work (as medivac.buffs is always empty) :
if (notmedivac.has_buff(BuffId.MEDIVACSPEEDBOOST)):
medivac(AbilityId.EFFECT_MEDIVACIGNITEAFTERBURNERS)
The Unit object don't update themselves. My guess is that you don't refresh the Unit object via
medivac=self.units(UnitTypeId.MEDIVAC)[0]
You can verify this by checking if medivac.position is the same - then you are using an outdated Unit object.
The unit.tag is unique so you can find the medivac in the next frame/iteration (assuming it was not destroyed) via
# Do not use the following as it is slower because it first loops over all units to filter out if they are queens and loops over those again to check if their tags are in the list/set
Activity
BurnySc2 commentedon Dec 6, 2024
The
Unitobject don't update themselves. My guess is that you don't refresh the Unit object viaYou can verify this by checking if
medivac.positionis the same - then you are using an outdated Unit object.The
unit.tagis unique so you can find the medivac in the next frame/iteration (assuming it was not destroyed) viapython-sc2/sc2/units.py
Lines 506 to 518 in aa247cc
WickedFridge commentedon Jan 3, 2025
Actually the medivac I use is different in each iteration, so I don't have an explanation as to why that is