SE_SetUnitDamage()

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

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

SE_SetUnitDamage()

Post by vettim89 »

Good Morning,

For the function SE_SetUnitDamage() there is a 'level' option. The documentation gives an example of 'none' means unit is repaired and 'destroyed' means the unit is destroyed. Is there gradients between those two? If so, is it a percentage of total dp or is it a severity level like 'minor' or 'major'?
"We have met the enemy and they are ours" - Commodore O.H. Perry
User avatar
vettim89
Posts: 3724
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

Re: SE_SetUnitDamage()

Post by vettim89 »

I think I figured this out - please ignore
"We have met the enemy and they are ours" - Commodore O.H. Perry
User avatar
kevinkins
Posts: 2465
Joined: Wed Mar 08, 2006 11:54 am

Re: SE_SetUnitDamage()

Post by kevinkins »

Hi ... trying to understand this function today. If available, please post some example script. I am trying to temporarily disable systems on artillery and other units depending on how the scenario unfolds. Thanks.

Kevin
“The study of history lies at the foundation of all sound military conclusions and practice.”
Alfred Thayer Mahan
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: SE_SetUnitDamage()

Post by KnightHawk75 »

kevinkins wrote: Sat Jun 18, 2022 3:08 pm Hi ... trying to understand this function today. If available, please post some example script. I am trying to temporarily disable systems on artillery and other units depending on how the scenario unfolds. Thanks.

Kevin
I think I have in response to your other post (https://www.matrixgames.com/forums/view ... 4#p5006714). I think also in that response it answers vettim89's question in the comments of the script code but I'll do it here are well as maybe it'll come up in future searches by people better.

Keyword | Operational status ( DamageSeverityFactor ) | Color
  • 'destroyed' = Destroyed red
  • 'none' = Operational normal\white
  • 'light' or 0 = Damaged (light) yellow
  • 'medium' or 1 = Damaged (medium) orange
  • 'heavy' or 2 = Damaged (heavy) red-orange
If so, is it a percentage of total dp or is it a severity level like 'minor' or 'major'?
% displayed is going to depend on what type of unit it is (assuming you're not screwing with the DP number themselves), and how things are flagged in the database ie treat each mount as DP or not, I don't think there is a universal answer for that. For example a artillery piece is probably going to be flagged 'mounts as DP' and 'destroying' 6 of 6 mounts will show 100% (but not kill it as command center component and mk1 eyeball typically still exist). The way you can sometimes spot this in the DB is when a unit has DP=0 or 1.0 vs a non 0/1 number like say 75 or 600 etc, things with 0/1 _tend_ to be flagged use mounts as dp (ie 100%/6 mounts = % of unit per mount destroyed 1 destroyed = 16.7% shown for unit damge), the more mounts you put on the "stronger" the unit gets. Where as those with a real number for DP is % of raw DP number, so a unit with 600 dp, takes hit of 100dp current dp = 500 or 100/600 = 16.7%. This why you'll see in estimated munitions for say sam sites differ, as often it's using mount count for estimates, or why adding say a sam mounts to a water tower does make the water tower show a defense count even if you have eyes on it, cause it's normal and not flagged use mounts as dp flagged.

Anyway all that applied to 1147.xx , though I don't think anything has drastically changed in the new 12xx betas but idk.
Post Reply

Return to “Lua Legion”