Using Conditions

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
vettim89
Posts: 3723
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

Using Conditions

Post by vettim89 »

I can find very little documentation on using conditions. I will get to the point:

I am working on a scenario that is playable from three sides. All three sides are going after the same targets. The non-player sides will be AI controlled.

I want to add a condition to the scoring events so if the human player's units damage an enemy ship then points will be awarded but if one of the AI units damages a ship no points will be awarded.

This is a Norwegian Sea scenario with the RN, RNN (Norwegian), and the USN all having submarines in the area of interest. IF a Soviet CVHG gets hit by the player's weapons points should be scored. However, if the CVHG is hit by an AI controlled unit, no points should be scored.

The event trigger is Soviet CVHG damaged level 50%
The event action is add 200 points to the player's total

Is there a way to set a condition to have the console detect whose weapon did the damage?

Thanks as always for the help
"We have met the enemy and they are ours" - Commodore O.H. Perry
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Using Conditions

Post by michaelm75au »

Not currently. Might be able to get UnitY() to point to the unit doing the damage. Only problem will be that the 'unit' might die before the Lua condition/action triggers.
Will look at possibility.
Michael
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

RE: Using Conditions

Post by kevinkins »

Interesting question. By setting up the scoring event for all three allied sides, the player will only see the points they deserve. The points awarded to the other two AI sides will be irrelevant from a victory POV i.e. I think victory thresholds are applied to the side that is being played. I will have to check that out.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
Post Reply

Return to “Lua Legion”