VR Flight Guy in PJ Pants Posted March 7, 2023 Posted March 7, 2023 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
cfrag Posted March 7, 2023 Posted March 7, 2023 (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 March 7, 2023 by cfrag 1
VR Flight Guy in PJ Pants Posted March 7, 2023 Author Posted March 7, 2023 Thanks big time. Lua is no Perl, so the first one is fine. Thanks. 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
Recommended Posts