Unit Damage to Trigger Action

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
gpotter511
Posts: 52
Joined: Wed Oct 04, 2017 12:55 pm

Unit Damage to Trigger Action

Post by gpotter511 »

Afternoon all -

I'd like to create a Lua script-based Condition to determine whether a message-based Action will fire. The Condition should check to see whether an aircraft has received any damage. If it hasn't, the Action should not fire. If it has, it should fire.

Can you suggest the best path to proceed with for these purposes? Thanks!
gpotter511
Posts: 52
Joined: Wed Oct 04, 2017 12:55 pm

RE: Unit Damage to Trigger Action

Post by gpotter511 »

In rereading this post, I realized it probably sounded like I was missing the fact that there's a trigger already in existence for Unit Damage. I do, in fact, know this.

What I'm trying to have happen is for points to be awarded to the player is an aircraft lands undamaged. So, the Action would actually be triggered by time at a moment when the aircraft has returned to its hanger. Condition, not the Trigger, would check damage. Does that make sense? Thanks!
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

RE: Unit Damage to Trigger Action

Post by Whicker »

not 100% sure I understand, but what if the trigger is `unit remains in area` - the base - and then the action is lua which checks if the unit is damaged, then awards points/sends message if it is not. Not sure you would need a condition.

Is it just one particular unit you are tracking? or more than one?
gpotter511
Posts: 52
Joined: Wed Oct 04, 2017 12:55 pm

RE: Unit Damage to Trigger Action

Post by gpotter511 »

Thanks much Whicker - yes, it is just a single unit.

I was hoping to use a condition so that I could limit the need for laying out the Reference Points. But this may be the simpler option.
Post Reply

Return to “Lua Legion”