Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Setting WCS to not target helos

 
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 >> Setting WCS to not target helos Page: [1]
Login
Message << Older Topic   Newer Topic >>
Setting WCS to not target helos - 3/3/2018 9:46:06 PM   
Lancair01

 

Posts: 3
Joined: 3/3/2018
Status: offline
I'm trying to set up a blockade-style scenario.

Initially, the blockaders (PLAN) are unfriendly, not hostile to the playable side (Aus/US) - the idea being that the PLAN should get the first drop on the player. To make this more interesting, I want to set it up so the PLAN doesn't just fire on the first Aus/US helicopter they see, and instead waits until they can get a shot at the Aus/US surface vessels.

I tried doing this by changing PLAN's WCS air to HOLD, but the problem with this is they then don't fire at the Aus/US guided missiles in self defense. Furthermore, I'd like to set it up so they start shooting at helos/aircraft once they have opened fire on the ships.

Essentially, the behavior I want is - hold fire until you see a ship, and then shoot everything Does anyone have any tips how to do this?
Post #: 1
RE: Setting WCS to not target helos - 3/3/2018 9:56:07 PM   
michaelm75au


Posts: 13089
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Quick thought.
WCS to HOLD
Set up an event that triggers on detection of ships within an area (not just a ship anywhere), and then change the WCS to FREE.
Possible add one for detection of missiles (I think that is there?) and make WCS air FREE.

_____________________________

Michael

(in reply to Lancair01)
Post #: 2
RE: Setting WCS to not target helos - 3/3/2018 10:01:27 PM   
Cik

 

Posts: 666
Joined: 10/5/2016
Status: offline
unit enters area triggered tied to ships (specific ship maybe) entering the zone tethered to a 1-line luascript editing the side posture to be hostile, while also setting unit doctrine to WCS air hold, then a second box inside the first that returns WCS air to tight?

may be a little inflexible (could tie it to a semi-random time trigger as well, depending) but it will probably do the job.

(in reply to Lancair01)
Post #: 3
RE: Setting WCS to not target helos - 3/3/2018 10:14:50 PM   
Lancair01

 

Posts: 3
Joined: 3/3/2018
Status: offline

quote:

ORIGINAL: Cik

unit enters area triggered tied to ships (specific ship maybe) entering the zone tethered to a 1-line luascript editing the side posture to be hostile, while also setting unit doctrine to WCS air hold, then a second box inside the first that returns WCS air to tight?

may be a little inflexible (could tie it to a semi-random time trigger as well, depending) but it will probably do the job.


Yeah, that was what I was thinking, except to make it straghtforward I think I'll do it through posture (unfriendly to hostile) rather than WCS. I was hoping there would be a simpler way than setting up areas tied to each of the units but it seems it's either that or just changing posture on detection of a surface ship - which doesn't fix the problem if the PLAN helos detect the Aus/US surface ships way out and then the PLAN smokes the Aus/US helos before the surface ships are in range.

What I really want is an event as follows:

Trigger: PLAN detects a Aus/US surface ship
Condition: Surface ship is within [x] nm of a PLAN surface ship/sub
Event: PLAN posture goes to hostile

Can that condition be done through Lua?

(in reply to Cik)
Post #: 4
RE: Setting WCS to not target helos - 3/3/2018 10:44:12 PM   
michaelm75au


Posts: 13089
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
This is something I have done in the past with an event condition; just make sure it returns true or false.
It might be useful.
Once detected, you could go thru all the units on PLAN side to see if detected unit is in range.
----
local x,y
local answer = false
-- unit base range on
local u = ScenEdit_GetUnit({name='Group_2612', guid='cd015e09-d208-4e67-9af0-3e8e0412209c'})
if u == nil then
return answer
end
-- unit that triggered event
local contact = ScenEdit_UnitX()
-- this unit seen as a contact by others
local con = contact.ascontact
-- not generated as a contact yet
if #con ~= 0 then
-- listed as a contact by some side
-- what is the side id for the base unit
local side = ScenEdit_GetSideOptions({side=u.side}).guid
-- find the side's entry in the triggering unit's contact list
for x = 1, #con do
if con[x].side == side then
-- contact on my side
local mycontact = con[x].guid
-- distance between my base unit and the contact
local dist = u:rangetotarget( mycontact)
if dist < 10 then
print('target in range (' .. dist ..'NM)')
ScenEdit_SetSidePosture( ScenEdit_GetSideOptions({side=contact.side}).guid, side ,'H')
answer=true
else
print('target not in range (' .. dist ..'NM)')
end
end
end
end
return answer

_____________________________

Michael

(in reply to Lancair01)
Post #: 5
RE: Setting WCS to not target helos - 3/3/2018 11:46:55 PM   
michaelm75au


Posts: 13089
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
This isn't working as expected as a Condition now. Will need to have a closer look.
Okay. I think the issue has come about with the off-the-grid contacts.

Use the actual unit instead of the contact.
local x,y
local answer = false
local sidename = 'PLAN'

-- unit that triggered event
local contact = ScenEdit_UnitX()
--contact = ScenEdit_GetUnit({name='FFH 150 Anzac', guid='04b98bf1-2a6e-45d5-9a2a-5bd00a0e4cbe'})

local side = VP_GetSide( { side = sidename })
local rangeFrom = side.units
for i = 1, #rangeFrom do
    -- unit base range on
    local u = ScenEdit_GetUnit({ guid= rangeFrom[i].guid })
    if u == nil then
    return answer
    end
            -- distance between my base unit and the contact
            local dist = u:rangetotarget( contact.guid)
            if dist < 100 then
                print('target in range (' .. dist ..'NM)')
                --ScenEdit_SetSidePosture( ScenEdit_GetSideOptions({side=contact.side}).guid, side ,'H')
                answer=true
            else
                print('target not in range (' .. dist ..'NM)')
            end
end
return answer


< Message edited by michaelm75au -- 3/4/2018 12:29:38 AM >


_____________________________

Michael

(in reply to michaelm75au)
Post #: 6
RE: Setting WCS to not target helos - 3/4/2018 8:37:15 AM   
Lancair01

 

Posts: 3
Joined: 3/3/2018
Status: offline
That looks like it's worked. Thanks!

(in reply to michaelm75au)
Post #: 7
RE: Setting WCS to not target helos - 3/4/2018 12:58:26 PM   
AlexGGGG

 

Posts: 685
Joined: 9/25/2014
Status: offline
You can adjust WRA for specific weapon type not to shoot at helos, or not to shoot at helos unless helo is at 2NM or closer (in which case it is pretty much a guaranteed kill).

(in reply to Lancair01)
Post #: 8
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Setting WCS to not target helos 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.125