Jump to content

[MOOSE] RAT - Random Air Traffic


Recommended Posts

You shouldn't have to delete the trigger and re-create it. If you edit a .lua file that is called as a "DO SCRIPT FILE" action, browse to the file and select it like you did when originally creating the trigger, then save the mission. It should work as expected now.

 

 

In a nutshell; go back and re-select the file called in the trigger if you make a change.

Win 10 | i7 4770 @ 3.5GHz | 32GB DDR3 | 6 GB GTX1060

Link to comment
Share on other sites

You shouldn't have to delete the trigger and re-create it. If you edit a .lua file that is called as a "DO SCRIPT FILE" action, browse to the file and select it like you did when originally creating the trigger, then save the mission. It should work as expected now.

 

 

In a nutshell; go back and re-select the file called in the trigger if you make a change.

 

:doh: Why solve it easy, if there's a complicated way:D

Wouldn't have guessed that would help, too. Is this documented or explained somewhere?

Link to comment
Share on other sites

Is this documented or explained somewhere?

Maybe, but usually that's a DCS "feature" we all have to learn the hard way ;)

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Guys,

i have tried the RAT script, did it as described, but the AI doesn´t spawn. I´ll enclose my files, maybe someone can have a look and find the issue... I´d really appreciate that. ;-)

MIG-29G Multirole Training.miz

RAT_MIG-21.lua

X-56 HOTAS, TFRP Pedals

Modules: F-5E, FC3, F/A-18C, Mirage 2000 C, AV-8BNA, FW-190 A-8, F-16C Viper

SystemSpecs: AMD A8-6600K (4x3,9GHz), 16 GB RAM, NVidia GeForce GTX1070 8GB, WIN10 64bit

Link to comment
Share on other sites

Guys,

i have tried the RAT script, did it as described, but the AI doesn´t spawn. I´ll enclose my files, maybe someone can have a look and find the issue... I´d really appreciate that. ;-)

Just had a quick glance at your code, Ragnar. But there is one problem in your script

local MIG[b][color="Red"]-[/color][/b]21=RAT:New[b][color="Red"] ([/color][/b]"RAT_MIG-21")
MIG[b][color="red"]-[/color][/b]21:Spawn[b][color="Red"] ([/color][/b]2)

The hyphen (Bindestrich) is a "magic" character in scripting since it denotes a minus sign. So for the script you deduce 21 from MIG, which is not defined and causes an error. Also there is a space between "New " and the opening "(" and "Spawn " and "(". This is also not valid in scripting.

 

Try

local MIG21=RAT:New("RAT_MIG-21")
MIG21:Spawn(2)

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Thanx, funkyfranky, didn´t realize that the Bindestrich isn´t allowed in scripting... I´ll give that a try immediately.

X-56 HOTAS, TFRP Pedals

Modules: F-5E, FC3, F/A-18C, Mirage 2000 C, AV-8BNA, FW-190 A-8, F-16C Viper

SystemSpecs: AMD A8-6600K (4x3,9GHz), 16 GB RAM, NVidia GeForce GTX1070 8GB, WIN10 64bit

Link to comment
Share on other sites

nope, doesn´t work... edited the file, buit the Mig21 doesn´t spawn... They are neither anywhere in the air nor on any runway... Could you please have a look at th mission? I reckon there´s some subtle issue anywhere...

MIG-29G Multirole Training.miz

X-56 HOTAS, TFRP Pedals

Modules: F-5E, FC3, F/A-18C, Mirage 2000 C, AV-8BNA, FW-190 A-8, F-16C Viper

SystemSpecs: AMD A8-6600K (4x3,9GHz), 16 GB RAM, NVidia GeForce GTX1070 8GB, WIN10 64bit

Link to comment
Share on other sites

nope, doesn´t work... edited the file, buit the Mig21 doesn´t spawn... They are neither anywhere in the air nor on any runway... Could you please have a look at th mission? I reckon there´s some subtle issue anywhere...

local MIG21=RAT:New("RAT_MIG21")
MIG[b][color="Red"]-[/color][/b]21:Spawn(2)

There is still a minus sign in the script.

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Unfortunately not, here´s the actual wording:

local MIG21=RAT:New("RAT_MIG21")

MIG21:Spawn(2)

 

Can it be that the MIGs spawn later? I expect them being on a runway right at the beginning of the mission, but maybe they appear later?

 

 

EDIT: got it! found this sentence on one of the older posts:

 

"So when you make changes to the script, e.g. correct errors add stuff and so on, you need to go back to the trigger section in the ME and reopen the script file and save the mission again.

Otherwise the changes are not taken over."

 

This was the issue... I didn´t reload the script after editing it...

 

Thanks again for your immediate replies!


Edited by Ragnar65

X-56 HOTAS, TFRP Pedals

Modules: F-5E, FC3, F/A-18C, Mirage 2000 C, AV-8BNA, FW-190 A-8, F-16C Viper

SystemSpecs: AMD A8-6600K (4x3,9GHz), 16 GB RAM, NVidia GeForce GTX1070 8GB, WIN10 64bit

Link to comment
Share on other sites

Radom spawntime?

 

Hi,

 

 

is there any possibility to let the AI-planes spawn at random times? Let´s say, one group spawns at the mission start, another randomly and for me surprisingly?

I´d like to build some CAP missions and want to get a picture or bogey-dope from the E3 or E2 without knowing when the bogeys spawn...

Currently I know the time the bogeys spawn ´cos i have built the mission... ;-)

X-56 HOTAS, TFRP Pedals

Modules: F-5E, FC3, F/A-18C, Mirage 2000 C, AV-8BNA, FW-190 A-8, F-16C Viper

SystemSpecs: AMD A8-6600K (4x3,9GHz), 16 GB RAM, NVidia GeForce GTX1070 8GB, WIN10 64bit

Link to comment
Share on other sites

Hi, I just created my first F18 training mission with elements from Moose and RAT to get some random elements. I used some civil outbound traffic from Dubai, some planes traveling between two zones and the new script for the later activation.

Maybe you can help me to get further by answering my questions.

 

1. I thought I should be able to see contrails from the heavies during the mission. Is there a Altitude in DCS which gives you contrails for planes like 757. I can see those when switching the camera to them but not from ground or from my plane.

 

2. The script for the later activation will let these planes takeoff,fly to a random airfield, Land there and gets deactivated afterwards. After that it may become active again and the process restarts. I ran in trouble because jets crashed by trying to land at a short runway. After that the jet respawned on that airfield and wasn’t able to start without crashing which ends in a loop.

Any ideas to restrict airfields from the random script?

 

I used the following script with F18s and A10s

-- Skins
local cessnaskins={"Blank", "D-EKVW", "HellenicAF", "Muster", "N9672H", "SEagle_blue", "SEagle_red", "USAF-Academy", "V5-BUG", "VH-JGA"}

local cessna=RAT:New("RAT_CESSNA", "Cessna Henderson")
cessna:SetDeparture("Henderson Executive Airport")
cessna:Livery(cessnaskins)
cessna:SetSpawnDelay(30)
cessna:SetSpawnInterval(0.5)
cessna:Uncontrolled()
cessna:ActivateUncontrolled(30, 120, 120, 0.5)
cessna:ContinueJourney()
cessna:Spawn(44)

 

Greetings from Germany

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

... I ran in trouble because jets crashed by trying to land at a short runway. After that the jet respawned on that airfield and wasn’t able to start without crashing which ends in a loop.

Any ideas to restrict airfields from the random script?

 

Yes, I use the SetDeparture & SetDestination options to restrict the traffic, like this:

 

local a320=RAT:New("RAT-A320")
a320:Livery(a320skins)
a320:SetCoalitionAircraft("neutral")
a320:SetCountry(country.id.SWITZERLAND)
a320:SetDeparture({"Al Dhafra AB", "Al Maktoum Intl", "Dubai Intl", "Sharjah Intl", "Fujairah Intl", "Bandar Abbas Intl", "Shiraz International Airport", "Kerman Airport", "To Asia", "To Europe"}) 
a320:SetDestination({"Al Dhafra AB", "Al Maktoum Intl", "Dubai Intl", "Sharjah Intl", "Fujairah Intl", "Bandar Abbas Intl", "Shiraz International Airport", "Kerman Airport", "To Asia", "To Europe"}) 
a320:Spawn(7)

 

"To Asia" and "To Europe" are two big (+150 km) trigger zones that I put en the East & West border of the Map, to have longer range traffic.

 

Best regards

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Can someone tell me why this is ignoring the departure and destination areas?

Also is there a way that i can get aircraft to ignonre coilations all together and just fly between the specified ariports?

 

local b737=RAT:New("RAT_737")

b737:SetFLmin(300)

b737:SetDeparture({"RAT Zone A", "RAT Zone B", "RAT Zone C", "Kerman-Airport", "Shiraz-International-Airport", "Bandar-Abbas-Intl", "Sharjah-Intl", "Dubai-Intl", "Al-Maktoum-Intl", "Fujairah-Intl"})

b737:SetDestination({"Kerman-Airport", "Shiraz-International-Airport", "Bandar-Abbas-Intl", "Sharjah-Intl", "Dubai-Intl", "Al-Maktoum-Intl", "Fujairah-Intl"})

b737:Spawn(5)

ASUS ROG Strix X570-E MB | Ryzen 9 5950x | ASUS Tuf RTX 4080 | 64 GB G.Skill TridentZ 3600 MHz DDR4 | Samsung 970 Evo 1TB m.2 Nvme | TM Warthog HOTAS | MFG Crosswind | Track IR 5 | Gigabyte M27Q-P 1440p 165hz |

Link to comment
Share on other sites

b737:SetDeparture({"RAT Zone A", "RAT Zone B", "RAT Zone C", "Kerman-Airport", "Shiraz-International-Airport", "Bandar-Abbas-Intl", "Sharjah-Intl", "Dubai-Intl", "Al-Maktoum-Intl", "Fujairah-Intl"})

b737:SetDestination({"Kerman-Airport", "Shiraz-International-Airport", "Bandar-Abbas-Intl", "Sharjah-Intl", "Dubai-Intl", "Al-Maktoum-Intl", "Fujairah-Intl"})

You need to use the correct airport names, i.e. exactly as spelled in the mission editor. E.g. "Kerman-Airport" does not exist since it is not spelled with a hyphen in the game.

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

@FunkyFranky .. I'm trying to use RAT to have a bit of helicopter air traffic between Gas & Oil Rigs on the sea of the Persian Gulf map, but cant make it work.

 

I'm using this script:

 

local uh1=RAT:New("RAT-uh1", "UH-1 Civil")

uh1:SetTakeoff("cold")

uh1:SetDeparture({"Fateh Oilfield Gas Platform 1"})

uh1:SetDestination({"Fateh Oilfield Gas Platform 6"})

uh1:Spawn(1)

 

but it gives the following error:

 

2018-10-24 19:25:40.695 INFO SCRIPTING: RAT | Version 2.2.1

2018-10-24 19:25:45.789 INFO SCRIPTING: 45329( 44710)/E: RAT00113._PickDestination(RAT | ERROR! No destination airport or zone found.)

2018-10-24 19:25:45.789 INFO SCRIPTING: 44717( 44209)/E: RAT00113._SetRoute(RAT | ERROR: No valid destination airport could be found for UH-1 Civil!)

 

Please, can you take a look at my mission to see were I went wrong?

Test Templates.miz

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Are the platform objects even considered landing zones? Can you get an AI to land on it through the normal waypoints?

 

Generally, the new rigs should behave like FARPS

 

 

Interesting...


Edited by Shadow.D.
Link to comment
Share on other sites

@FunkyFranky .. I'm trying to use RAT to have a bit of helicopter air traffic between Gas & Oil Rigs on the sea of the Persian Gulf map, but cant make it work.

Please, can you take a look at my mission to see were I went wrong?

Sure, I can take a look tomorrow. Generally, the new rigs should behave like FARPS and register as airbases.

 

Maybe it is required to set a code name (like Berlin, London, Paris etc.) in the mission editor for that to work?

I have only played around with it a bit but I vaguely recall that there was something I had to do so they are registered as airbases in the game (am not a my gaming PC right now).

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

uh1:SetDeparture({"Fateh Oilfield Gas Platform 1"})

uh1:SetDestination({"Fateh Oilfield Gas Platform 6"})

uh1:Spawn(1)

Oh, of course, now I see. You need to use the code name of the rig (Paris, Berlin, London, Dallas) which you assigned as departure and destination and not the name of the static elements.

 

So something like this

uh1:SetDeparture({"Berlin"}) 
uh1:SetDestination({"London"}) 

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Oh, of course, now I see. You need to use the code name of the rig (Paris, Berlin, London, Dallas) which you assigned as departure and destination and not the name of the static elements.

 

So something like this

uh1:SetDeparture({"Berlin"}) 
uh1:SetDestination({"London"}) 

 

 

Thanks a lot, will try it today :)

 

 

I'd like to use the option SetDeparturesFromZone, so that there is no need to specify each Oil Rig individually if they are close to each other, but dont know how to specify a Moose Zone ... can you please give us an example of such definition?

 

 

Best regards

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Oh, of course, now I see. You need to use the code name of the rig (Paris, Berlin, London, Dallas) which you assigned as departure and destination and not the name of the static elements.

 

So something like this

uh1:SetDeparture({"Berlin"}) 
uh1:SetDestination({"London"}) 

 

 

 

Sadly, no, it didnt work:

 

 

3CGTXr3.jpg

 

 

On the Log it leaves these messages:

 

 

2018-10-25 12:54:42.727 INFO    SCRIPTING:  10307(  9709)/E:            DATABASE00003._RegisterAirbases({[1]=Register Airbase:,[2]=Rig1,})
2018-10-25 12:54:42.727 INFO    SCRIPTING:  10307(  9709)/E:            DATABASE00003._RegisterAirbases({[1]=Register Airbase:,[2]=Rig2,})
2018-10-25 12:54:42.727 INFO    SCRIPTING: *** MOOSE INCLUDE END *** 
2018-10-25 12:54:43.163 INFO    SCRIPTING: RAT | Version 2.2.1
2018-10-25 12:54:43.164 INFO    SCRIPTING:  43457(     3)/E:                 RAT00053.SetDeparture(RAT | ERROR: No departure airport or zone found with name London)
2018-10-25 12:54:43.164 INFO    SCRIPTING:  43495(     4)/E:                 RAT00053.SetDestination(RAT | ERROR: No destination airport or zone found with name Dallas)
2018-10-25 12:54:43.164 INFO    SCRIPTING:  43295( 43115)/E:                 RAT00053._CheckConsistency(RAT | ERROR: No airports or zones found given in SetDestination(). Enabling random destination airports!)
2018-10-25 12:54:48.256 INFO    SCRIPTING:  45204( 44597)/E:                 RAT00053._PickDeparture(RAT | ERROR! No departure airport or zone found for UH-1 Civil.)
2018-10-25 12:54:48.256 INFO    SCRIPTING:  44603( 44209)/E:                 RAT00053._SetRoute(RAT | ERROR! No valid departure airport could be found for UH-1 Civil.)

 

 

:(

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

2018-10-25 12:54:42.727 INFO    SCRIPTING:  10307(  9709)/E:            DATABASE00003._RegisterAirbases({[1]=Register Airbase:,[2]=[b]Rig1[/b],})
2018-10-25 12:54:42.727 INFO    SCRIPTING:  10307(  9709)/E:            DATABASE00003._RegisterAirbases({[1]=Register Airbase:,[2]=[b]Rig2[/b],})
2018-10-25 12:54:42.727 INFO    SCRIPTING: *** MOOSE INCLUDE END *** 

Well, luckily you pasted an important part of the log :) Try "Rig1" and "Rig2". You can see that these are the names of the airbases registered by MOOSE.

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Well, luckily you pasted an important part of the log :) Try "Rig1" and "Rig2".

 

 

That's where I was at the beginning .. the Oil Rigs Static object name .. I'm enclosing the Mission if you want to try it (and the lua script) .. the messages in the log are now:

 

 

2018-10-25 14:51:23.790 INFO    SCRIPTING:  10307(  9709)/E:            DATABASE00003._RegisterAirbases({[1]=Register Airbase:,[2]=Rig1,})
2018-10-25 14:51:23.791 INFO    SCRIPTING:  10307(  9709)/E:            DATABASE00003._RegisterAirbases({[1]=Register Airbase:,[2]=Rig2,})
2018-10-25 14:51:23.791 INFO    SCRIPTING: *** MOOSE INCLUDE END *** 
2018-10-25 14:51:24.230 INFO    SCRIPTING: RAT | Version 2.2.1
2018-10-25 14:51:29.334 INFO    SCRIPTING:  45329( 44710)/E:                 RAT00053._PickDestination(RAT | ERROR! No destination airport or zone found.)
2018-10-25 14:51:29.334 INFO    SCRIPTING:  44717( 44209)/E:                 RAT00053._SetRoute(RAT | ERROR: No valid destination airport could be found for UH-1 Civil!)

 

 

If I put the helo manually on one of the rigs, and a landing waypoint on the other Rig it works well .. but I would prefer to be able to use RAT since the manual way is useful for just a single flight.

 

 

Thanks a lot for all the help :)

RAT - Persian Gulf - Oil Platforms.lua

Test Oil RAT.miz

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...