use LUA code to add a container to an unmanned surface vessel

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
hanzawa1991
Posts: 71
Joined: Tue Apr 05, 2022 9:05 am

use LUA code to add a container to an unmanned surface vessel

Post by hanzawa1991 »

Hello, I want to use LUA code to add a container to an unmanned surface vessel, and the container has anti-ship SM-6 missiles. How can I do that? I manually added various models of MK vertical launchers, but I still can’t launch missiles, and even the launchable list doesn’t have SM-6. I don’t know why.
User avatar
lumiere
Posts: 267
Joined: Tue Mar 19, 2019 10:38 am

Re: use LUA code to add a container to an unmanned surface vessel

Post by lumiere »

Adding Mk41 (I used that of Japanese DDG Maya - #3211) using Lua is not so difficult.

Code: Select all

local guid= '87YZY5-0HMPP8EUB5UM0'
local dbid = 3211
local arc_mount = {"SMF2", "SMF1", "SMA2", "SMA1", "PMF2", "PMF1", "PMA2", "PMA1"}
for i = 1, 2 do --how many mounts you add
    ScenEdit_UpdateUnit({guid=guid, mode="add_mount", dbid=dbid, arc_mount=arc_mount})
    i = i+1
end
This is point: Although SM-6 is CEC-capable missile, it still requires AEGIS missile datalink to fire.
Add this datalink (AEGIS missile datalink [Two-Way] - Comm device #291) to ship, and prepare some spotter like E-2D to fire SM-6.

Code: Select all

local guid= '87YZY5-0HMPP8EUB5UM0'
local mode = "add_comms"
local dbid = 291
ScenEdit_UpdateUnit({guid=guid, mode=mode, dbid=dbid})
Give it a try
"How Do You Stay Calm With A 7,000 Ton Nuclear Predator Listening For Your Heartbeat?"
Post Reply

Return to “Lua Legion”