Jump to content

[MOOSE] RAT - Random Air Traffic


Recommended Posts

On 4/3/2021 at 9:09 AM, Rudel_chw said:

I use these kind of options on my missions, and the rat aircrafts then fly only between same coalition airbaseses:

 

local c17=RAT:New("RAT-C17")
c17:SetCoalitionAircraft("blue")
c17:SetCoalition("sameonly")
c17:SetTakeoff("cold")
c17:ExcludedAirports("Batumi")
c17:Spawn(2)

 

 

Thank you Rudel, It never occurred to me to assign coalition to both color and sameonly.

Apparently Excluded Airports isn't needed. It seems to be working so far. Saves me a lot of typing.

 

Any ideas yet on setting speed and altitude? I know I must be doing something wrong.

🇺🇦  SLAVA UKRAINI  🇺🇦

MoBo - ASUS 990FX R2 Sabertooth,     CPU - AMD FX 9590 @4.7Gb. No OC
RAM - GSkill RipJaws DDR3 32 Gb @2133 MHZ,   GPU - EVGA GeForce GTX 1660Ti 6Gb DDR5 OC'd, Core 180MHz, Memory 800MHz
Game drive - Samsung 980 M.2 EVO 1Tb SSD,    OS Drive - 860 EVO 500Gb SATA SSD, Win10 Pro 22H2

Controls - Thrustmaster T-Flight HOTAS X,   Monitor - LG 32" 1920 X 1080,   PSU - Prestige ATX-PR800W PSU

Link to comment
Share on other sites

43 minutes ago, rayrayblues said:

Any ideas yet on setting speed and altitude? I know I must be doing something wrong.


no, sorry, I never use those options as I use RAT mostly to add ambiance to the airbases .. their in-flight is not a concern to me 🙂

 

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

On 4/5/2021 at 11:46 AM, Rudel_chw said:


no, sorry, I never use those options as I use RAT mostly to add ambiance to the airbases .. their in-flight is not a concern to me 🙂

The reason I ask is, I am still not very good at shooting, so I have set up several "Target Practice" missions using RAT.

The advantage is that they don't shoot back or evade. They are sitting (flying) ducks and I still can't take them down reliably.

Usually they are too low and just a little too fast to catch up to. If I could get them up higher where I can see them and slow them down

just a little so I can catch up to them it would help.

🇺🇦  SLAVA UKRAINI  🇺🇦

MoBo - ASUS 990FX R2 Sabertooth,     CPU - AMD FX 9590 @4.7Gb. No OC
RAM - GSkill RipJaws DDR3 32 Gb @2133 MHZ,   GPU - EVGA GeForce GTX 1660Ti 6Gb DDR5 OC'd, Core 180MHz, Memory 800MHz
Game drive - Samsung 980 M.2 EVO 1Tb SSD,    OS Drive - 860 EVO 500Gb SATA SSD, Win10 Pro 22H2

Controls - Thrustmaster T-Flight HOTAS X,   Monitor - LG 32" 1920 X 1080,   PSU - Prestige ATX-PR800W PSU

Link to comment
Share on other sites

22 hours ago, rayrayblues said:

The reason I ask is, I am still not very good at shooting, so I have set up several "Target Practice" missions using RAT.

The advantage is that they don't shoot back or evade. They are sitting (flying) ducks and I still can't take them down reliably.

Usually they are too low and just a little too fast to catch up to. If I could get them up higher where I can see them and slow them down

just a little so I can catch up to them it would help.

I've done the exact same thing and had fun setting up the mission and leveraging the RAT functionality (thanks @funkyfranky)  One bookmark I use quite a bit is this one for MOOSE.  The documentation is outstanding.  https://flightcontrol-master.github.io/MOOSE_DOCS/

 

To answer your question, yes, you can establish the altitude for the spawned unit.

 

Here's the documentation for RAT - https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Rat.html

 

I wrote a small script to spawn a random number of units at random altitudes across different zones.  I pass this script the unit name and the rest of the magic happens automatically.  Below is the code I wrote and you can see where I establish the altitude of the spawn.  If you want to make it fixed, just replace with a value instead of a random number.  Hope this helps!

 

--
--    Random Aircraft Spawn from Mission (RASM)
--    
--    Intent here is to allow the user, from a radio button, to pass in a mission created late activated aircraft and spawn it randomly into the mission
--    This code contains a function accepting the unit name from the mission
--    
--    This function uses the RAT (Random Air Traffic) element from MOOSE.  MOOSE must be loaded before this script in the mission.
--
--    

rasm = {}

function rasm.spawn(_UnitID)

local alt = math.random(5,350) -- setting a random altitude for the spawn(s) between 500-35,000 feet. 
local _numUnits = math.random(1,4) -- setting number of units to spawn between 1 and 4
local newunit=RAT:New(_UnitID) -- creating a new object to spawn into the mission using RAT (_UnitID is the name of unit from mission editor)
newunit:SetTakeoff("air")      -- spawning in the air
newunit:SetDeparture({"Spawn Zone1", "Spawn Zone2", "Spawn Zone3", "Spawn Zone4"})  -- Using trigger zones in the mission editor, the spawn can be in one of 4 zones
newunit:SetFLcruise(alt)       -- use the random altitude established
newunit:Spawn(_numUnits)       -- spawn a random number of units

end -- end rasm.spawn

 

 

  • Thanks 3

System Specs:

Spoiler

 💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, Thrustmaster TWCS (modified), Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

Thrustmaster TWCS Mod

 

Link to comment
Share on other sites

@Mistermann Thank you sir, this will be very helpful.

  • Like 1

🇺🇦  SLAVA UKRAINI  🇺🇦

MoBo - ASUS 990FX R2 Sabertooth,     CPU - AMD FX 9590 @4.7Gb. No OC
RAM - GSkill RipJaws DDR3 32 Gb @2133 MHZ,   GPU - EVGA GeForce GTX 1660Ti 6Gb DDR5 OC'd, Core 180MHz, Memory 800MHz
Game drive - Samsung 980 M.2 EVO 1Tb SSD,    OS Drive - 860 EVO 500Gb SATA SSD, Win10 Pro 22H2

Controls - Thrustmaster T-Flight HOTAS X,   Monitor - LG 32" 1920 X 1080,   PSU - Prestige ATX-PR800W PSU

Link to comment
Share on other sites

  • 4 weeks later...

Hi there, I have a question around the following commands-

 

Set rules of engagement (ROE).

RAT:SetROE(roe)  

 

and

Set reaction to threat (ROT).
RAT:SetROT(rot)  

 

What should I add to the brackets?

 

Should it be something like this?-

setROE ("free")
setROT ("passive")

 

----

 

On 4/5/2021 at 8:01 PM, rayrayblues said:

Any ideas yet on setting speed and altitude? I know I must be doing something wrong.

 

Have a look at this file, it has a lot of examples you can use-

C:\Users\yourusername\Saved Games\DCS.openbeta\Mods\Aircraft\Civil Aircraft Mod\Missions\QuickStart\RAT Script_Caucasus.lua


Edited by BRAVO_16

Maintain thy airspeed lest the ground rise up and smite thee!

YiizHx5.gif

Link to comment
Share on other sites

3 hours ago, BRAVO_16 said:

Should it be something like this?-

setROE ("free")
setROT ("passive")

 

Got it working, now the aircraft engage Red coalition aircraft.

this is what it looks like-

P51:SetROE ("free")
P51:SetROT ("passive")

  • Thanks 1

Maintain thy airspeed lest the ground rise up and smite thee!

YiizHx5.gif

Link to comment
Share on other sites

7 hours ago, BRAVO_16 said:

Have a look at this file, it has a lot of examples you can use-

C:\Users\yourusername\Saved Games\DCS.openbeta\Mods\Aircraft\Civil Aircraft Mod\Missions\QuickStart\RAT Script_Caucasus.lua

 

Most helpful, thanks.   HVYapur.png     I couldn't help but notice that there are no entries for The Channel, or Syria, but

all of them are the same anyway.

🇺🇦  SLAVA UKRAINI  🇺🇦

MoBo - ASUS 990FX R2 Sabertooth,     CPU - AMD FX 9590 @4.7Gb. No OC
RAM - GSkill RipJaws DDR3 32 Gb @2133 MHZ,   GPU - EVGA GeForce GTX 1660Ti 6Gb DDR5 OC'd, Core 180MHz, Memory 800MHz
Game drive - Samsung 980 M.2 EVO 1Tb SSD,    OS Drive - 860 EVO 500Gb SATA SSD, Win10 Pro 22H2

Controls - Thrustmaster T-Flight HOTAS X,   Monitor - LG 32" 1920 X 1080,   PSU - Prestige ATX-PR800W PSU

Link to comment
Share on other sites

  • 2 months later...

Just have a random question. I have my script setup just how I want it barring one thing, choppers seem to spawn on and take off from the stennis and the supercarrier (blocking the takeoff from the regular carrier planes/and clients.

 

Is there a simple way to tell them to take off from any airbase except carriers???

 

I tried to use, :

 

Local bshark=RAT:New("bshark")

bshark:SetTerminalType(AIRBASE.TerminalType.Helicopteronly)

 

But it seems to ignore the above line and spawn them on the carrier anyway.

 

Thanks in advance.

Managed to figure out the above but now some of my client f18's appear to be spawning in the middle of the carrier. Also how would I enable the f10 menu debug menu so i can show the RAT traffics waypoints etc.

Thanks


Edited by Badass1982
Link to comment
Share on other sites

  • 4 weeks later...

@Badass1982

Have you tried?

Local bshark=RAT:New("bshark")

bshark:ExcludedAirports("Name Of Carrier")

 


Edited by rayrayblues

🇺🇦  SLAVA UKRAINI  🇺🇦

MoBo - ASUS 990FX R2 Sabertooth,     CPU - AMD FX 9590 @4.7Gb. No OC
RAM - GSkill RipJaws DDR3 32 Gb @2133 MHZ,   GPU - EVGA GeForce GTX 1660Ti 6Gb DDR5 OC'd, Core 180MHz, Memory 800MHz
Game drive - Samsung 980 M.2 EVO 1Tb SSD,    OS Drive - 860 EVO 500Gb SATA SSD, Win10 Pro 22H2

Controls - Thrustmaster T-Flight HOTAS X,   Monitor - LG 32" 1920 X 1080,   PSU - Prestige ATX-PR800W PSU

Link to comment
Share on other sites

  • 3 weeks later...

May I ask, If for specific instance of RAT I'll specify in SetDeparture as the list of zones and airports without specyfying the SetTakeoff, by default planes departing from zones will be spawned in the air and the ones departing from airport will be spawned somewhere on the ground (the parking place prefferably)?


Edited by Pipok

Natural Born Kamikaze

-------------------------

AMD Ryzen 5 3600, AMD Fatal1ty B450 Gaming K4, AMD Radeon RX 5700 XT, 32 GB RAM Corsair Vengeance LPX, PSU Modecom Volcano 750W, Logitech G940 HOTAS, Turtle Beach VelocityOne Rudder.

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,

 

thanks for RAT. I just have some trouble setting it up. I am getting this error:

 

2021-08-28 16:21:45.443 INFO    SCRIPTING:  15960( 15065)/I:                      DATABASE00003._RegisterAirbases(Register Airdrome: Ras Al Khaimah Intl (ID=28 UID=28), parking=20 [244=0 68=0 40=0 216=0 176=0 104=18 16=2 72=0 ])
2021-08-28 16:21:45.447 INFO    SCRIPTING:  15960( 15065)/I:                      DATABASE00003._RegisterAirbases(Register Airdrome: Liwa AFB (ID=29 UID=29), parking=67 [244=0 68=0 40=0 216=0 176=0 104=14 16=2 72=51 ])
2021-08-28 16:21:45.447 INFO    SCRIPTING: 163497(    -1)/I:                          BASE00000.function(Checking de-sanitization of os, io and lfs:)
2021-08-28 16:21:45.447 INFO    SCRIPTING: 163502(    -1)/I:                          BASE00000.function(- os NOT available! Some functions may not work.)
2021-08-28 16:21:45.447 INFO    SCRIPTING: 163508(    -1)/I:                          BASE00000.function(- io NOT available! Some functions may not work.)
2021-08-28 16:21:45.447 INFO    SCRIPTING: 163514(    -1)/I:                          BASE00000.function(- lfs NOT available! Some functions may not work.)
2021-08-28 16:21:45.447 INFO    SCRIPTING: 163518(    -1)/I:                          BASE00000.function(Check <DCS install folder>/Scripts/MissionScripting.lua and comment out the lines with sanitizeModule(''). Use at your own risk!))
2021-08-28 16:21:45.448 INFO    SCRIPTING:   7013(163520)/I:                          BASE00000.?(Tracing in MOOSE is OFF)
2021-08-28 16:21:45.448 INFO    SCRIPTING: *** MOOSE INCLUDE END *** 
2021-08-28 16:21:45.449 INFO    SCRIPTING: RAT | Version 2.3.9
2021-08-28 16:21:45.449 ERROR   SCRIPTING: Mission script error: [string "C:\Users\peter\AppData\Local\Temp\DCS.openbeta\/~mis00003CFD.lua"]:63444: attempt to call method 'F2' (a nil value)
stack traceback:
	[C]: in function 'F2'
	[string "C:\Users\peter\AppData\Local\Temp\DCS.openbeta\/~mis00003CFD.lua"]:63444: in function 'SetDeparture'
	[string "C:\Users\peter\AppData\Local\Temp\DCS.openbeta\/~mis00004C97.lua"]:18: in main chunk

 

I load Moose.lua (static) on Missionstart and my mission script right after it. As it is in a sample Mission.

 

Can tell me what might be the issue?

 

thanks

Peter

Link to comment
Share on other sites

  • 2 weeks later...

If you attach your mission, the experts can take a look and find the error.

[Modules] A-10C, A-10C II, AH-64D, F-14A/B, F-16C, F/A-18C, FC3, Ka-50, P-51D, UH-1H, CA, SC
[Maps] PG, NTTR, Normandy, Sinai, Syria, TC

[OS] Windows 11 Pro
[PC] MSI Pro Z790-A, i9-13900K, 64 GB DDR5-5200, RTX 4090 24 GB GDDR6X, 2 x SSD 990 PRO 2 TB (M.2), Corsair 5000D Airflow, HX1500i, H150i RGB Elite, Acer X28, TM HOTAS Warthog (Grip@WarBRD Base), MS SW FFB2, Thrustmaster TFRP, TrackIR 5 & TrackClip Pro
[Checklists] A-10C, F-16C, F/A-18C, AH-64D, Ka-50, UH-1H

Link to comment
Share on other sites

  • 2 months later...

Looking forward to spawning several uncontrolled groups at Nellis, then activating several to simulate launches.
that´s the code so far:

Quote

local Nellis=AIRBASE:FindByName("Nellis AFB")
Nellis:MarkParkingSpots()
Nellis:SetParkingSpotBlacklist({234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246})

-- Skins
local f14skins={"VX-9", "VF-102 OEF 115", "VF-102 OEF 100", "VF-102 OEF 105", "NSAWC 20"}

local f14=RAT:New("RAT_F14")
f14:SetDeparture("Nellis AFB")
f14:SetDestination({"RAT Zone North", "RAT Zone West"})
f14:Livery(f14skins)
f14:SetSpawnDelay(30)
f14:SetSpawnInterval(0.5)
f14:Uncontrolled()
f14:ActivateUncontrolled(2, 60, 120, 0.5)
f14:Spawn(8)

local a10=RAT:New("RAT_A10C")
a10:SetDeparture("Nellis AFB")
a10:SetDestination({"RAT Zone North", "RAT Zone West"})
--f14:Livery(f14skins)
a10:SetSpawnDelay(5)
a10:SetSpawnInterval(0.5)
a10:Uncontrolled()
a10:ActivateUncontrolled(4, 60, 120, 0.5)
a10:Spawn(6)

local f15=RAT:New("RAT_F15C")
f15:SetDeparture("Nellis AFB")
f15:SetDestination({"RAT Zone North", "RAT Zone West"})
--f14:Livery(f14skins)
f15:SetSpawnDelay(5)
f15:SetSpawnInterval(0.5)
f15:Uncontrolled()
f15:ActivateUncontrolled(4, 60, 120, 0.5)
f15:Spawn(6)

local f16=RAT:New("RAT_F16")
f16:SetDeparture("Nellis AFB")
f16:SetDestination({"RAT Zone North", "RAT Zone West"})
--f14:Livery(f14skins)
f16:SetSpawnDelay(5)
f16:SetSpawnInterval(0.5)
f16:Uncontrolled()
f16:ActivateUncontrolled(4, 60, 120, 0.5)
f16:Spawn(6)

How could assing certain spots for every group?
 

i5 8400 | 32 Gb RAM | RTX 2080Ti | Virpil Mongoose T-50 base w/ Warthog & Hornet sticks | Warthog throttle | Cougar throttle USB | DIY Collective | Virpil desk mount | VKB T-Rudder Mk IV | Oculus Rift S | Buddy-Fox A-10 UFC | 3x TM MFDs | 2x bass shakers pedal plate| SIMple SIMpit chair | WinWing TakeOff panel | PointCTRL v2 | Andre JetSeat | Winwing Hornet UFC | Winwing Viper ICP

FC3 - Warthog - F-5E - Harrier - NTTR - Hornet - Tomcat - Huey - Viper - C-101 - PG - Hip - SuperCarrier - Syria - Warthog II - Hind - South Atlantic - Sinai - Strike Eagle

Link to comment
Share on other sites

  • 1 month later...

Hi.

 

ED touch NTTR map module in the patch of 2.7.9.17830 Open Beta (and also composed in 2.7.9.18080 stable) as

Quote
  • The names of airfields no longer contain the words "airfield", "airbase", "AFB", etc.

 

That changes cause Moose RAT script for NTTR map trouble that aircrafts cannot spawn or cannot fly because of many airports / air force bases become missing from RAT.

We have to edit the RAT script SetDeparture() and SetDestination() lines  to fit the new names.

  • Like 1

Modules: A-10C/II, F-5E, F-14A/B, F-15E, F-16C, F/A-18C, AV-8B, FC3, Ka-50-2/3, UH-1H, Mi-8MTV2, SA342, Mi-24P, AH-64D, P-51D
Maps: Nevada, PG, Syria, SA, Sinai, Channel, Normandy2.0      Assets etc.: CA, Sc, WW2AP
Mods and Skins in User Files: files/filter/user-is-western0221/ 

 Screen_221018_005618c.jpg

Link to comment
Share on other sites

49 minutes ago, jsr9597 said:

I've been able to clear the error message (my typo) but still can't get anything to spawn.

 

Hi, 

The problem is that you have the triggers tied to an Event (ON MISSION START) ... dont do that, change it to "NO EVENT" (for both triggers) and it will work.

  • Thanks 1

 

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

  • 3 months later...
1 hour ago, The_Jab said:

I would just like to know how to make planes respawn on specific parking lots?

 

I don't know how to do that, as I prefer to have my background air traffic random, and having a specific parking place kind of detracts from that.

In any case, here is the RAT documentation, in case you'd like to research if there is a way to get RAT to do what you want:

https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Rat.html

 

 

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

1 hour ago, Rudel_chw said:

 

I don't know how to do that, as I prefer to have my background air traffic random, and having a specific parking place kind of detracts from that.

In any case, here is the RAT documentation, in case you'd like to research if there is a way to get RAT to do what you want:

https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Rat.html

 

Hi, thank you for your reply. I'll keep to looking for.

Nice evening.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Anyone tried RAT with the South Atlantic map?

Thank you in advance.

 - "Don't be John Wayne in the Break if you´re going to be Jerry Lewis on the Ball".

About carrier ops: "The younger pilots are still quite capable of holding their heads forward against the forces. The older ones have been doing this too long and know better; sore necks make for poor sleep.'

 

PC: I7 4790K 4.6ghz | 32GB RAM | Zotac GTX 1080Ti 11Gb DDR5x | Water cooler NZXT AIO Kraken x53 | 3.5TB (x4 SSD´s) | Valve Index| Andre´s JeatSeat.

Link to comment
Share on other sites

5 minutes ago, fagulha said:

Anyone tried RAT with the South Atlantic map?

 

I tried it today .. works fine, but you have to be careful with big aircrafts as there are not many parking spots for them.

 

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