Checking for minefields and sub depths in Lua (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


jmax -> Checking for minefields and sub depths in Lua (6/9/2017 1:22:40 PM)

I thought maybe mines would count as weapons so I tried a "unit remains in area" trigger to check for PLAN weapons within targeted areas, but it didn't work.

I'm also trying to trigger a posture change with shore stations conditional on submarines operating below a certain depth. I tried some variations on this, but honestly I have no idea what I'm doing:

VP_GetUnit ({Side='PLAN', guid='f9a3971f-b1d8-4764-9155-8d3407929c11', altitude})
if ({altitude <=-100}), then return true
else return false


Can anyone help with this or point me to a detailed tutorial?




michaelm75au -> RE: Checking for minefields and sub depths in Lua (6/9/2017 1:56:42 PM)

Mines are a special case. They don't show up as weapons.

Commands should be something like:
local unit = VP_GetUnit({ Side='PLAN', guid='f9a3971f-b1d8-4764-9155-8d3407929c11'})
if unit.altitude <= -100 then
return true
else
return false
end




jmax -> RE: Checking for minefields and sub depths in Lua (6/9/2017 2:32:57 PM)

Thanks michaelm, that appears to be working—sub is losing contact with surface forces when operating at depth and regaining contact when shallow. I imagine there must be a more elegant way, though—at the moment I'm just using a regular time trigger to check the conditions each minute. Is there a better option for this, like a trigger that fires when the sub passes above or below a certain depth?

As for the mines—if they don't show up as units or weapons, how would I go about checking to see if they've been placed in certain areas and not detected or cleared by MCM after a certain period of time?




michaelm75au -> RE: Checking for minefields and sub depths in Lua (6/9/2017 2:58:14 PM)

Currently, there does not seem to be a solution. Mines is one of things that is on my 'to-do' Lua list[:)].




jmax -> RE: Checking for minefields and sub depths in Lua (6/9/2017 7:35:28 PM)

Maybe a script could check for expended mine payloads within certain areas as a workaround? Something like "IF unit remains in area for T, AND unit's carried mines = 0, THEN score points for laying minefield" ?




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.59375