Mining as a Victory Condition (Full Version)

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



Message


SeaQueen -> Mining as a Victory Condition (9/15/2018 2:24:33 AM)

Sea mining is often as important for its ability to deter or constrain a given course of action, as it is for its ability to actually destroy ships. If someone knows there's sea mines somewhere, they generally just won't go there unless they have no other choice. Because of their ability to influence an enemy on levels beyond the purely tactical consideration of destroying ships, mines have operational (e.g. constraining maneuver) and strategic implications (e.g. legal considerations, treaty considerations), which suggests that sometimes just placing or clearing them is a win. A great historical example would be the mining of Haiphong Harbor with B-52s during the Vietnam War. They didn't lay the mines to destroy ships. They laid the mines so that they wouldn't have to (they'd just stay bottled up in port and not leave). Just seeding the minefield was a win. Similarly, during Operation Earnest Will, US minesweeping helicopters and minesweepers worked to keep the sea lanes opened to commerce, and minimize the impact on the global economy. Successfully clearing the mines was a victory which was frustrated by Iranian minesweepers, aircraft, CDCMs, etc.

How would one implement the successful placement or removal of sea mines as a victory condition?




BeirutDude -> RE: Mining as a Victory Condition (9/15/2018 3:53:26 AM)

I don't think the mine counts as a unit so the only thing I can think of is if the mine layer is in the area for a certain length of time the mines likely would have been laid. I was working on a straits of Hormuz and modified some Iranian Amphibs to lay mines and that was what I was working on for the mines.




SeaQueen -> RE: Mining as a Victory Condition (9/15/2018 2:36:15 PM)

It sounds like there needs to be some sort of LUA function that tests if there's mines in a designated area, so we could write a condition to test for it.




[BSM]Roby7979 -> RE: Mining as a Victory Condition (9/15/2018 2:44:21 PM)


quote:

ORIGINAL: SeaQueen

It sounds like there needs to be some sort of LUA function that tests if there's mines in a designated area, so we could write a condition to test for it.



It's a great idea, there would be a lot of very interesting hypothetical scenarios




SeaQueen -> RE: Mining as a Victory Condition (9/15/2018 2:57:35 PM)

It'd be nice if we could do something like return the number of mines in a given area, and then write a LUA condition which looked something like:

local minesCleared = false
local nmines = ScenEdit_MinesInArea(<reference points>)

if (nmines <= victoryConditions.fracCleared * scenarioParameters.n0mines) then
minesCleared = true
else
minesCleared = false
end

returned minesCleared





BeirutDude -> RE: Mining as a Victory Condition (9/15/2018 6:52:04 PM)

That sounds like the route to go, but way beyond my skills




Gunner98 -> RE: Mining as a Victory Condition (9/15/2018 7:22:41 PM)

You are on to something I think.

Currently I do as BeirutDude suggests: If a minelayer is in an area for XXX amount of time - objective achieved

On the other foot, for clearing mines, you can put an enter area trigger beyond the minefield. If the unit gets there you can assume that there is a channel in the minefield - objective achieved.

Not slick but it works.

B




Cik -> RE: Mining as a Victory Condition (9/16/2018 12:23:31 AM)

it might be neat to have a more generalized "measure thing in this box" function. i'm thinking that not only could you use such a thing for mines, but it could also be used for measuring air/sea control.

"if you can keep more than 4 ships of type FFG, DDG, SSN in this box for 4 hours, you win"

or

"keep more than 8 fighters armed with the following weapons on station in this box" etc.

i've never managed to figure out a way of iterating through assets in a particular geographical area though, and checking conditions against them.. is such a thing possible?




SeaQueen -> RE: Mining as a Victory Condition (9/16/2018 1:52:50 AM)

You can already check to see if any units are in an area using triggers. Mines on the other hand are special for some reason.

I don't believe that if you use the GetUnit() command with just a side it'll return all the units on that side, sadly. Such a functionality definitely could be useful.

Instead I'll do things like create tables of guids for unit types I'm interested in (e.g. SAMs, CDCMs, surface ships, etc.) and iterate through them. On a practical level that seems to work well enough, although sometimes it gets time consuming to build the table.




apache85 -> RE: Mining as a Victory Condition (9/26/2018 8:25:48 AM)

quote:

ORIGINAL: SeaQueen

You can already check to see if any units are in an area using triggers. Mines on the other hand are special for some reason.

I don't believe that if you use the GetUnit() command with just a side it'll return all the units on that side, sadly. Such a functionality definitely could be useful.

Instead I'll do things like create tables of guids for unit types I'm interested in (e.g. SAMs, CDCMs, surface ships, etc.) and iterate through them. On a practical level that seems to work well enough, although sometimes it gets time consuming to build the table.


To get a list of units on a side:

quote:

local sideUnits = VP_GetSide({side='SideName'}).units
print (sideUnits)


That will give you a list of the GUID and name if I recall correctly. If you want to expand the data in the table you can tack on the following:

quote:

local unitTable = {}
for k,v in ipairs (sideUnits) do
local unit = ScenEdit_GetUnit({guid=v.guif})
table.insert(unitTable,unit)
end
print (unitTable) --warning, that's going to be a wall of data


Hope that helps!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.542969E-02