Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LAU Question Automatic Evasion as a LAU Script

 
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 >> Lua Legion >> LAU Question Automatic Evasion as a LAU Script Page: [1]
Login
Message << Older Topic   Newer Topic >>
LAU Question Automatic Evasion as a LAU Script - 7/27/2017 9:33:37 AM   
butch4343

 

Posts: 327
Joined: 3/26/2015
Status: offline
Folks,

I was wondering, is it possible to create (or does one exist?) a LAU Script that switches a units automatic evasion setting to off, but only within a certain area?

The reason I ask is, CMANO has a very good evasion model, however its either an on or off setting, so I have my flight of SU-24s/F111s ect running in at low level on a supply dump defended by guns, obviously in the low level penetration to the IP am happy for them to evade pop-up threats, but from the IP to post weapon release, most aircrew would fly straight and level as fast as possible in order to deliver the weapons and hope their speed and surprise keeps them safe. In CMNAO this doesnt happen unless the evasion is set to off.

If anyone has created such a script, would they share?

Regards

Butch
Post #: 1
RE: LAU Question Automatic Evasion as a LAU Script - 7/27/2017 12:20:49 PM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
Totally possible and also not particularly hard; however it would be done in the editor with an area so it's not something most players could do on the fly.

If you post a scen file and some details of what you want I'd be happy to try to work something out for you.

(in reply to butch4343)
Post #: 2
RE: LAU Question Automatic Evasion as a LAU Script - 7/28/2017 7:35:05 AM   
butch4343

 

Posts: 327
Joined: 3/26/2015
Status: offline
That would be fantastic mate ,I appreciate the help, heres the attachment.

Ive stripped out most of the scenario in order to focus on the scripting. The premise is I have an RAF Tornado that needs to fly east and drop munitions on the enemy airfield. I dont want the Tornado to auto evade from the point it penetrates the 4 Reference Points Around the airfield if possible.

I have added a trigger in there , that is set for Battleaxe 1 to enter the Area around the enemy airfield, although in fact I wouldnt mind if it could be set the other way around so that any NATO aircraft entering that area would go auto evasion "OFF" but Im not sure I can see that being scriptable, so I might need to designate the units in the scenario I have in mind for each individual airfield, which isnt a major drama.

Is it possible to set the script up so that as the aircraft leaves the area, the auto evasion would then move to the "ON"?
Im not really great with LUA scripting as youll see from my post, so where would we start?

Regards

Butch

Attachment (1)

< Message edited by butch4343 -- 7/28/2017 12:08:55 PM >

(in reply to Rory Noonan)
Post #: 3
RE: LAU Question Automatic Evasion as a LAU Script - 7/29/2017 8:12:33 AM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
No problem I'll get into this in the next few days.

(in reply to butch4343)
Post #: 4
RE: LAU Question Automatic Evasion as a LAU Script - 7/31/2017 5:13:42 AM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
Ok so the code is:

unit = ScenEdit_UnitX()
ScenEdit_SetDoctrine({side=unit.side, unitname=unit.name}, {automatic_evasion=false})

What this does is retrieves the details of the unit that activated the trigger, then uses those details to set the doctrine. It's very simple as you can see.

For the moment it just turns off the evasion, and that's it. With some simple extension you could have a seperate event that turns evasion back on once the unit leaves the area.

Everything is set up for you in the attached scenario file.

Hope this helps!

(in reply to Rory Noonan)
Post #: 5
RE: LAU Question Automatic Evasion as a LAU Script - 8/3/2017 8:46:18 AM   
butch4343

 

Posts: 327
Joined: 3/26/2015
Status: offline
Apache85

Mate, I tried it out this morning, works like a charm, thanks so much I cant swear here but its S*** hot!

I have a couple of questions and this is just me being dumb,

Firstly the auto evasion, Im thinking that to switch it back on, I should create a zone covering the whole of say Germany and put an even in that called "auto evasion on" the trigger is RAF Aircraft Tornados entering the area, and its a repeateable trigger. I then create an area around each airfield and set up an event for each , Ie "auto evasion off Zerbst/Finnow/Damgarten ect" and if my thinking is right, the Tornados will fly into Germany, trigger auto evasion on, fly over the airfields, trigger auto evasion off, then when they leave the area, they should trigger the auto evasion back on as they are re-entering the area of Germany?

Does that sound viable?

Regards

Butch

< Message edited by butch4343 -- 8/3/2017 8:47:11 AM >

(in reply to Rory Noonan)
Post #: 6
RE: LAU Question Automatic Evasion as a LAU Script - 8/11/2017 6:31:50 AM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
That should work and is probably the simplest way to do it.

(in reply to butch4343)
Post #: 7
RE: LAU Question Automatic Evasion as a LAU Script - 11/1/2017 1:05:17 PM   
butch4343

 

Posts: 327
Joined: 3/26/2015
Status: offline
Apache85

Your code worked brilliantly, I have used it several times, thanks.

I wondered if I could again call on your advice?

I am looking to do something similar, for the same kind of scenario, I am wanting to have a strike aircraft go to full power on the bomb run automatically, so I had a think and came up with this..

unit = ScenEdit_UnitX()
ScenEdit_SetUnit({side=unit.side, unitname=unit.name}, {throttle='afterburner'})

Except it doesnt work lol, I wondered if you could see where I have gone wrong. I effectively just want an aircraft entering the area to go to max speed military or afterburner as approprite.

Your advice is gratefully recieved.

Regards

Butch

(in reply to Rory Noonan)
Post #: 8
RE: LAU Question Automatic Evasion as a LAU Script - 11/1/2017 2:33:32 PM   
somi83


Posts: 59
Joined: 2/6/2016
From: Novi Sad, Serbia
Status: offline
Hi,

Use this code:
unit = ScenEdit_UnitX()
ScenEdit_SetUnit({
side = unit.side, 
name = unit.name, 
throttle = 'Flank' --Name of the throttle:Loiter, Cruise, Full (Military), Flank(Afterburner)
})



(in reply to butch4343)
Post #: 9
RE: LAU Question Automatic Evasion as a LAU Script - 11/2/2017 9:23:19 PM   
butch4343

 

Posts: 327
Joined: 3/26/2015
Status: offline
Somi83

That is genius mate , thanks so much

Regards

Butch

(in reply to butch4343)
Post #: 10
RE: LAU Question Automatic Evasion as a LAU Script - 11/3/2017 9:44:45 AM   
butch4343

 

Posts: 327
Joined: 3/26/2015
Status: offline
Folks,

Its time for me to be a pain again, I was wondering Somi83s code which is fantastic BTW, could it be modified to affect an aircrafts height?

So example, I have my F111Fs zooming along on their attack run at as low to the ground as possible. Their paveway3s need a release height of 2000ft, so would it be possible to create a script that will set the aircrafts altitude to 2000ft?

My second question is how does AGL vs ASL affect this? do you need to specify that in the script or would CMNAO take it as AGL? If am over the alps at 150000ft and I tell the script to set 2000ft and the alps are already 5000ft then potentially the aircraft will bury itself in a mountain side.

Is the script likely to be as simple as simply taking out the throttle and swapping it for altitude?


unit = ScenEdit_UnitX()

ScenEdit_SetUnit({side = unit.side, name = unit.name, alt = '2000agl'})

Or would it need something like the AGL set to true, as per the auto evasion script?

unit = ScenEdit_UnitX()

ScenEdit_SetUnit({side = unit.side, name = unit.name, alt = '2000', AGL= 'true'})


Any advice would be gratefully recieved folks, for you guys are truly LUA Wizards

Regards

Butch

(in reply to butch4343)
Post #: 11
RE: LAU Question Automatic Evasion as a LAU Script - 11/3/2017 12:21:32 PM   
somi83


Posts: 59
Joined: 2/6/2016
From: Novi Sad, Serbia
Status: offline
Use this:
unit = ScenEdit_UnitX() 

ScenEdit_SetUnit({
side = unit.side, 
name = unit.name, 
moveto = true,--this must be always set to true, if not unit will jump instantly to altitude or depth it will not descend or ascend. 
altitude = '5000 ft'-- Set a desired alt/depth, for depth use negative number.
})

And for ASL/AGL, I haven't found anything regarding that option in Command lua documentation. Or I am missing something

(in reply to butch4343)
Post #: 12
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> LAU Question Automatic Evasion as a LAU Script 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

1.031