If "A" happens, the "B" happens

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
AdmiralSteve
Posts: 288
Joined: Mon Mar 28, 2011 2:32 pm
Location: Red Bluff, CA

If "A" happens, the "B" happens

Post by AdmiralSteve »

Hello All,
I'm looking for a way to create a special action where a neutral submarine is on a patrol and is ordered by the player to strike hostile targets with TLAM's and then to return to the patrol. Here's where I'm at with it;

ScenEdit_SetSidePosture('USN Submarine', 'PLAN PLAAF', 'H')

ScenEdit_AssignUnitToMission('USS John Warner SSN785', 'Palawan Strike')

ScenEdit_SetUnit({name='USS John Warner SSN785', guid='924f266e-24e2-436c-b473-5d504ea796c2', depth= '130 FT', moveto=true})

The problem with putting in a 4th line of code with a ScenEdit_AssignUnitToMission script is that the sub surfaces to -130 ft and then immediately returns to the patrol depth. Is their a way to delay the the sub in returning back to the patrol so as to give time for the TLAM's to fire?

Thanks, Steve
“There are no extraordinary men...just extraordinary circumstances that ordinary men are forced to deal with.”
Admiral William Frederick Halsey Jr. 1882-1959

Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

RE: If "A" happens, the "B" happens

Post by Whicker »

I think you may need to uncheck the manual depth that you have it set to - since you have the depth set already on the mission you don't need it. I think I may have done that when I was working on it.
Post Reply

Return to “Lua Legion”