Jump to content

[MOOSE] RAT - Random Air Traffic


Recommended Posts

funkyfranky, I just stumbled across RAT+CAM+MOOSE today, and I've been looking for something like this in DCS for quite awhile! I didn't know it was possible to have AI traffic! I am so glad to have found this thread.

 

I have a few requests, will you add more aircrafts such as the Boeing 777, 787, and Airbus A321, A321, A330, A350 and more liveries as well?

 

For some reason I cannot get it to spawn the AI planes from the Civilian Aircraft Mod. I'm in the mission editor, added a new flight group, and on the drop down list I selected USA and cannot see any B_737, B_747, etc entries at all. I know I installed the CAM mod successfully because it shows up under Modules.

 

Is RAT included in the latest Moose.lua now?

 

At the moment could you or someone here help me populate an airport? I have the Civilian Airplane Mod installed, and also Moose 2.3.0. How would I create a LUA script so that it will spawn random civilian AI planes at Batumi Airport on the Caucasus map? I'm not a scriptor so I'm not sure what I'm suppose to do. I'd appreciate it if somebody can walk me through this.

 

Thanks!


Edited by maverick90
Link to comment
Share on other sites

Also I have this script, its 50% working. The C130 spawns, but the F16's don't and I'm not sure why:

 

local c130=RAT:New("RAT_C130")
local f16=RAT:New("RAT_F16")

-- Set destination airport.
c130:SetDeparture("Kobuleti")
f16:SetDeparture("Batumi")

-- Spawn Aircrafts
f16:Spawn(4)
c130:Spawn(5)

Link to comment
Share on other sites

Hi maverick, code looks fine and should work. Can you check the name of the template group of the F-16 and that it is late activated. If it does not work, attach the mission file please. Then I have a look :)

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

Hi FunkyFranky,

 

I just started playing with MOOSE and RAT today. I can't get RAT to work. Please let me know what I did wrong.

Hi pmiceli, good that you attached the miz file straight away. Lua is case sensitive - and in your RAT lua file you have

--RAT EMS
local RAT1=RAT:new("RAT1")
RAT1:spawn(3)
--B747
local B747=RAT:new("B747")
B747:spawn(3)

You need to capitalize the ":New" and ":Spawn" commands, i.e.

--RAT EMS
local RAT1=RAT:[b]N[/b]ew("RAT1")
RAT1:[b]S[/b]pawn(3)
--B747
local B747=RAT:[b]N[/b]ew("B747")
B747:[b]S[/b]pawn(3)

Then it should work :) If not, let me know...

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

Just a great "THANK YOU" for this awesome mod !!

It give life on the entire maps and it's easy to use !

 

Just a question, where can I find the "lua's name" of all airports to adjust setting ?

 

Thanks !


Edited by paradox64

 

 

ROG Maximus XI Hero / i9-9900k @5Ghz / 32Gb DDR4 @3200Mhz / Samsung 960 Pro M.2 / RTX2080ti / Vive Pro / ROG 3440x1440

 

Link to comment
Share on other sites

Hi pmiceli, good that you attached the miz file straight away. Lua is case sensitive - and in your RAT lua file you have

--RAT EMS
local RAT1=RAT:new("RAT1")
RAT1:spawn(3)
--B747
local B747=RAT:new("B747")
B747:spawn(3)

You need to capitalize the ":New" and ":Spawn" commands, i.e.

--RAT EMS
local RAT1=RAT:[b]N[/b]ew("RAT1")
RAT1:[b]S[/b]pawn(3)
--B747
local B747=RAT:[b]N[/b]ew("B747")
B747:[b]S[/b]pawn(3)

Then it should work :) If not, let me know...

 

I corrected the capitalization and reloaded everything but it is not functioning. I will start over this weekend and see what happens.

 

 

 

 

EDsignaturefleet.jpg

Link to comment
Share on other sites

Just a great "THANK YOU" for this awesome mod !!

It give life on the entire maps and it's easy to use !

 

Just a question, where can I find the "lua's name" of all airports to adjust setting ?

 

Thanks !

 

Caucasus

cessna:SetDeparture({"Anapa-Vityazevo","Krymsk","Krasnodar-Center","Krasnodar-Pashkovsky","Novorossiysk",
"Gelendzhik","Maykop-Khanskaya","Sochi-Adler","Gudauta","Sukhumi-Babushara","Mineralnye Vody","Nalchik",
"Mozdok","Beslan","Tiblisi-Lochini","Soganlug","kutaisi","Senaki-Kolkhi","kobuleti","Batumi"})

Nevada

cessna:SetDeparture({"Beatty Airport","Boulder City Airport","Creech AFB","Echo Bay","groom Lake AFB","Henderson Executive Airport","Jean Airport","Laughlin Airport","Lincoln County","McCarran International Airport","Mesquite","Nellis AFB","North Las Vegas","Pahute Mesa Airstrip","Tonopah Airport","Tonopah test Range Airfield"})

Link to comment
Share on other sites

Or conveniently

RAT:AddFriendlyAirportsToDepartures()
RAT:AddFriendlyAirportsToDestinations()

would at all friendly airports for either departure or destination.

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

I corrected the capitalization and reloaded everything but it is not functioning. I will start over this weekend and see what happens.

Let me know how it goes. And if it still does not work, attach the miz file so I can have a look :)

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

Is there some sort of list for all the valid RAT lua codes and functions that we can use somewhere? Would make scripting a bit easier if we had that information up front.

 

and also any news of the Las Vegas AI traffic LUA to be released? I'm referring to the youtube demo video you had. Looks awesome and would be great if we can use it as a template.

Link to comment
Share on other sites

Is there some sort of list for all the valid RAT lua codes and functions that we can use somewhere? Would make scripting a bit easier if we had that information up front.

You can find every function of RAT here https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Rat.html

 

However, these are really all functions, i.e. also the ones which are used internally in the code. But the internal functions usually (but not always :music_whistling:) start with an underscore.

 

and also any news of the Las Vegas AI traffic LUA to be released? I'm referring to the youtube demo video you had. Looks awesome and would be great if we can use it as a template.

I'll try to find it :)

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

-- Redacted --


Edited by Highwayman-Ed

Intel i9-9900KF @5.2GHz

MSI Z390 Gaming Pro Carbon

32GB G.Skill Trident Z DDR3200 RAM

MSI RTX 2080 Ti Gaming X Trio

40" Panasonic TH-40DX600U @ 4K

Pimax Vision 8K Plus / Oculus Rift CV1 / HTC Vive

Gametrix JetSeat with SimShaker

Windows 10 64 Bit Home Edition

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Just a heads up for the masses about an issue I found when using the Civil Aircraft Mod 737 with RAT in 2.5. For some reason if your 737 in the ME has the American Airlines Retro skin set, it caused the 737s to stop spawning entirely for me. Changing the skin to anything else fixed it. To go along with that, I can’t get RAT generated aircraft to spawn with that skin either.

Hey, Highwayman. I just tried it with the Retro skin. But the 737 was spawning fine for me. Can you attach the mission please?

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

RAT v2.2 Showcases

 

High Frequency Outbound Traffic At McCarran International

 

 

Seven aircraft are spawned at McCarran and begin their journey. Each time an aircraft takes off, a new aircraft is spawned at McCarran. This generates a lot of outbound traffic.

The aircraft will fly to a zone at Lake Mead and will be despawned there.

 

MOOSE RAT script:

-- Liveries
local b737skins={"Air Algerie", "Air Berlin", "Air France", "airBaltic", "Airzena", "AM", "American_Airlines", "British Airways", "C40s", "Clean", "Disney", "EA", "easyjet", "FINNAIR", "HARIBO", "JA", "Jet2", "kulula", "LH", "Lufthansa BA", "Lufthansa KR", "OLD_BA", "OMAN AIR", "PAN AM", "Polskie Linie Lotnicze LOT", "QANTAS", "RYANAIR", "SouthWest Lone Star", "ThomsonFly", "TNT",  "Ukraine Airlines", "UPS"}

local b737=RAT:New("RAT_B737", "B737 Outbound")
b737:SetDeparture("McCarran International Airport")
b737:SetDestination("RAT Zone")
b737:Livery(b737skins)
b737:SetMaxRespawnTriedWhenSpawnedOnRunway(0)
b737:StatusReports(false)
b737:SetSpawnDelay(60)
b737:SetSpawnInterval(10)
b737:SetTakeoff("cold")
b737:RespawnInAirNotAllowed()
b737:RespawnAfterTakeoff()
b737:Spawn(7)

 

Activate Uncontrolled Aircraft

 

 

44 aircraft are spawned at Henderson Executive Airport in uncontrolled state. Only 30 are activated and begin their mission. They will be respawned (again in uncontrolled state) at the airport they arrived and continue from there once they get activated.

 

During the mission only 30 aircraft will be active. The aircraft that get activated are selected randomly from the pool of uncontrolled aircraft.

 

MOOSE RAT script:

-- 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)

McCarran_Outbound.miz

Uncontrolled_Demo.miz


Edited by funkyfranky

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

Hey, Highwayman. I just tried it with the Retro skin. But the 737 was spawning fine for me. Can you attach the mission please?

 

Thanks for your help Franky. My problem seems to be an issue with the name of the skin in the script...

 

With CAM 0.77, in game the skin for me is called "American Airlines Retro" the folder in the mod is "American_Airlines" and if I use either of those names in my RAT script, it fails.

 

--Declare local Variables
local b737=RAT:New("RAT_B737")
local b737skins={"Aero Mexico","American_Airlines","SouthWest Lone Star","UPS"}

-- Set Departure Airfields
b737:SetDeparture({"Henderson Executive Airport", "Laughlin Airport", "McCarran International Airport","Tonopah Airport"})

-- Set Destinations
b737:SetDestination({"RAT_AIRLINER_EAST","RAT_AIRLINER_WEST","Henderson Executive Airport", "Laughlin Airport", "McCarran International Airport","Tonopah Airport"})

-- Set Skins
b737:Livery(b737skins)

-- Spawn Aircraft
b737:Spawn(math.random(4, 8))

-- Set Commands
RAT.ATC.messages=false
b737:SetClimbRate(1000)
b737:SetDescentAngle(0.6)

RAT Test.miz


Edited by Highwayman-Ed

Intel i9-9900KF @5.2GHz

MSI Z390 Gaming Pro Carbon

32GB G.Skill Trident Z DDR3200 RAM

MSI RTX 2080 Ti Gaming X Trio

40" Panasonic TH-40DX600U @ 4K

Pimax Vision 8K Plus / Oculus Rift CV1 / HTC Vive

Gametrix JetSeat with SimShaker

Windows 10 64 Bit Home Edition

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Thanks for your help Franky. My problem seems to be an issue with the name of the skin in the script...

With CAM 0.77, in game the skin for me is called "American Airlines Retro" the folder in the

This is very strange! I had a look at your script and the mission. Looks fine to me. But somehow, the RAT script was not loading at Mission start. Finally, I deleted the condition "TIME MORE" and it worked. Please try that :)

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

funkyfrank thanks for sharing your AI traffic script. I have a question though. For the line that says:

 

b737:SetDestination("RAT Zone")

 

How do I define this in the Mission Editor? Is there anything I need to do? Or does your script just automatically work? I know I have to create the 2 plane groups named RAT_B737 and B737 Outbound, but other than that, is there anything else?

Link to comment
Share on other sites

“RAT Zone” is the name of a trigger zone defined in the mission editor. That’s where the planes will fly and despawn. I put it rather close to McCarran because you create a lot of new planes in this example. If the old ones are alive for too long the performance drop. So you have to find a good balance.

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

  • 2 weeks later...

Hi

where can i find démo .MIZ file and mod file ?

thanks

System specs: Win10 x64 | i7-9700KF / i9-12900KF | 48/64 GB | GTX 1080 Ti 11 GB / RTX 3090TI 24GB | *NvME PRO 2To | HOTAS Warthog/Virpil | MFG Crosswind Pedals | Button Box

Link to comment
Share on other sites

funkyfrank, now that the Persian Gulf map is out. I would like to use your Vegas script and apply it to Dubai International Airport. I have it working, however I would like to tweak it to make it better. Right now I see planes parking at the gate reversed, how can I fix their position? Also, how can I add inbound AI traffic to Dubai International airport? I already have outgoing, but I would also like to add incoming flights as well.

 

-- Liveries
local b737skins={"Air Algerie", "Air Berlin", "Air France", "airBaltic", "Airzena", "AM", "American_Airlines", "British Airways", "C40s", "Clean", "Disney", "EA", "easyjet", "FINNAIR", "HARIBO", "JA", "Jet2", "kulula", "LH", "Lufthansa BA", "Lufthansa KR", "OLD_BA", "OMAN AIR", "PAN AM", "Polskie Linie Lotnicze LOT", "QANTAS", "RYANAIR", "SouthWest Lone Star", "ThomsonFly", "TNT",  "Ukraine Airlines", "UPS"}
local b747skins={"KLM", "AI", "CP", "IM", "LH", "NW", "PA", "QA", "TA"}
local a380 skins={"Air France", "BA", "China Southern", "Clean", "Emirates", "KA", "LH", "LHF", "Qantas Airways", "QTR", "SA", "TA"}

local b737=RAT:New("RAT_B737", "B737 Outbound")
b737:SetDeparture("Dubai Intl")
b737:SetDestination("RAT Zone")
b737:Livery(b737skins)
b737:SetMaxRespawnTriedWhenSpawnedOnRunway(0)
b737:StatusReports(false)
b737:SetSpawnDelay(60)
b737:SetSpawnInterval(10)
b737:SetTakeoff("cold")
b737:RespawnInAirNotAllowed()
b737:RespawnAfterTakeoff()
b737:Spawn(7)

local b747=RAT:New("RAT_B747", "B747 Outbound")
b747:SetDeparture("Dubai Intl")
b747:SetDestination("RAT Zone")
b747:Livery(b747skins)
b747:SetMaxRespawnTriedWhenSpawnedOnRunway(0)
b747:StatusReports(false)
b747:SetSpawnDelay(60)
b747:SetSpawnInterval(10)
b747:SetTakeoff("cold")
b747:RespawnInAirNotAllowed()
b747:RespawnAfterTakeoff()
b747:Spawn(7)


Edited by maverick90
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...