VR Flight Guy in PJ Pants Posted March 7, 2023 Share 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. VR Flight Guy in PJ Pants -- this is how I fly. We do not fly at treetop height, we fly between trees(TM) YouTube: https://www.youtube.com/channel/UCc9BDi-STaqgWsjNiHbW0fA My simple missions: https://forum.dcs.world/topic/284071-vr-flight-guy-in-pj-pants-simple-missions/ NSRI - National Strategy Research Institution, a fictional organisation based on wordplay of Strategic Naval Research Institution (SNRI), a fictional institution appears in Mobile Suit Gundam UC timeline. Link to comment Share on other sites More sharing options...
cfrag Posted March 7, 2023 Share 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 Link to comment Share on other sites More sharing options...
VR Flight Guy in PJ Pants Posted March 7, 2023 Author Share Posted March 7, 2023 Thanks big time. Lua is no Perl, so the first one is fine. Thanks. VR Flight Guy in PJ Pants -- this is how I fly. We do not fly at treetop height, we fly between trees(TM) YouTube: https://www.youtube.com/channel/UCc9BDi-STaqgWsjNiHbW0fA My simple missions: https://forum.dcs.world/topic/284071-vr-flight-guy-in-pj-pants-simple-missions/ NSRI - National Strategy Research Institution, a fictional organisation based on wordplay of Strategic Naval Research Institution (SNRI), a fictional institution appears in Mobile Suit Gundam UC timeline. Link to comment Share on other sites More sharing options...
Recommended Posts