[PRPL] Omnis API

Started by Praetonus, October 01, 2016, 07:59:35 PM

Previous topic - Next topic

Praetonus

Is it possible to handle omnis in PRPL? Namely, I'm looking for

  • get list of built omnis
  • get position
  • get/set health

planetfall

#1
For the first, you can do something like:


CreateList ->omnis
0 0 999 1 GetAllUnitsInRange ->units
<-units GetListCount 0 do
<-units[I] GetUnitType "Omni" eq if
  <-omnis <-units[I] AppendToList
endif
loop


For all units, you can use GetUnitCoordX GetUnitCoordY GetUnitPixelCoordX GetUnitPixelCoordY GetUnitHealth and the 'set' equivalents.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Praetonus


Praetonus

SetUnitHealth on an omni seems to work only when the omni is on ground. Is this intended?