Specific Unit Attacks Specific Unit

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
User avatar
Sybaris
Posts: 56
Joined: Sat Mar 14, 2015 10:15 am

Specific Unit Attacks Specific Unit

Post by Sybaris »

I'm trying to get a couple aircraft (Backfire B's w/ AS-4's) in a flight to attack a specific ship LCC-19 Blue Ridge and tried to use this:

ScenEdit_AttackContact('Flight 3079','336', {mode='1', mount=0, weapon=1820, qty=2})

Not working

Is it possible to do this and I'm just LUA ignorant?

Any help much appreciated
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Specific Unit Attacks Specific Unit

Post by KnightHawk75 »

Maybe don't include mount=0 if the weapon in question is on the aircraft loadout to be used.

from docs:
Note: The function will use the weapon from the aircraft loadout if applicable when no mount is supplied.

If that's not it, try using the unit guids for attacker and contact in case there is ambiguity in the names being used.
User avatar
Sybaris
Posts: 56
Joined: Sat Mar 14, 2015 10:15 am

RE: Specific Unit Attacks Specific Unit

Post by Sybaris »

ORIGINAL: KnightHawk75


If that's not it, try using the unit guids for attacker and contact in case there is ambiguity in the names being used.

That worked
Post Reply

Return to “Lua Legion”