Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Checking for minefields and sub depths in Lua

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Checking for minefields and sub depths in Lua Page: [1]
Login
Message << Older Topic   Newer Topic >>
Checking for minefields and sub depths in Lua - 6/9/2017 1:22:40 PM   
jmax

 

Posts: 59
Joined: 12/5/2016
Status: offline
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?
Post #: 1
RE: Checking for minefields and sub depths in Lua - 6/9/2017 1:56:42 PM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
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

_____________________________

Michael

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

 

Posts: 59
Joined: 12/5/2016
Status: offline
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?

(in reply to michaelm75au)
Post #: 3
RE: Checking for minefields and sub depths in Lua - 6/9/2017 2:58:14 PM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Currently, there does not seem to be a solution. Mines is one of things that is on my 'to-do' Lua list.

_____________________________

Michael

(in reply to jmax)
Post #: 4
RE: Checking for minefields and sub depths in Lua - 6/9/2017 7:35:28 PM   
jmax

 

Posts: 59
Joined: 12/5/2016
Status: offline
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" ?

(in reply to michaelm75au)
Post #: 5
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Checking for minefields and sub depths in Lua Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.855