Jump to content

Recommended Posts

Posted

Since the trigger condition does not have a condition that a unit is of perfect health, so I am looking at the use of LUA predicate:

I am thinking about using (Unit.Life == Unit.Life0), but how do I specify which Unit I am specifying?

Of course, if the above predicate is wrong, please kindly let me know.

Thank you.

I Fly, Therefore I Am.

One cannot go around not saying "Thank you" every time these days, can't you?

YouTube: https://www.youtube.com/channel/UCc9BDi-STaqgWsjNiHbW0fA

Posted (edited)

If you know the unit's name, it should be straightforward:

return Unit.getByName("aUnitName"):getLife() == Unit.getByName("aUnitName"):getLife0()

Note that the accessor functions are named getLife() and getLife0(). "aUnitName" is the name of the unit that is being looked at.

A slightly more readable version:

local theUnit = Unit.getByName("aUnitName")
return theUnit:getLife() == theUnit:getLife0()

 

Edited by cfrag
  • Thanks 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...