[MOOSE] RAT - Random Air Traffic - Page 3 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 10-15-2017, 05:17 PM   #21
Ignition
Junior Member
 
Join Date: Feb 2016
Location: Argentina
Posts: 83
Reputation power: 2
Ignition is on a distinguished road
Default

Im using RAT and is very easy to use and fast to set up.

Awesome.
Ignition is offline   Reply With Quote
Old 10-17-2017, 01:11 PM   #22
Looney
Member
 
Looney's Avatar
 
Join Date: Mar 2011
Posts: 776
Reputation power: 10
Looney is a jewel in the roughLooney is a jewel in the roughLooney is a jewel in the roughLooney is a jewel in the roughLooney is a jewel in the roughLooney is a jewel in the rough
Default

Would it be possible to randomly select from a number of different aircrafts before spawning?

That would be great to randomize type and traffic using this: https://forums.eagle.ru/showpost.php...6&postcount=89
__________________
Looney is online now   Reply With Quote
Old 10-17-2017, 04:08 PM   #23
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Trymheim, Asgård
Posts: 1,169
Reputation power: 19
funkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of light
Default

Quote:
Originally Posted by Looney View Post
Would it be possible to randomly select from a number of different aircrafts before spawning?

That would be great to randomize type and traffic using this: https://forums.eagle.ru/showpost.php...6&postcount=89
Ah, the Mod is out. Great

Regarding the spawning of random groups. It's not possible out-of-the-box. But you can script that.
Just to check that I understood you correctly. You want to spawn let's say 10 aircraft and it should be a random number of type X, a random number of type Y and a random number of type Z which add up to 10?

If so this would be the pseudo code:
Code:
b737=RAT:New("B_737")
b747=RAT:New("B_747")
b757=RAT:New("B_757")

--math.randomseed(os.time())
local nX=math.random(1, 8)    --spawn at least one and at most eight (leaving two for the other types)
local nY=math.random(1, 9-nX) --spawn at least one but at most eight (leaving at least one for the last type)
local nZ=10-nX-nY             --spawn what is left but at least 1.

b737:Spawn(nX)
b747:Spawn(nY)
b757:Spawn(nZ)
Or maybe this is more what you had in mind:
Code:
RATobjects={b737, b747, b757}
randomRAT=RATobjects[math.random(#RATobjects)]
randomRAT:Spawn()
There are many other ways to do this or something similar. But they all involve a little lua scripting.
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-4790K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 1866 MHz DDR-3| Win 10 64-bit | Asus Maximus Hero VII | Samung EVO 850 SSD | TM HOTAS Warthog | MFG Crosswind | TrackIR 5 | HTC Vive | CV1
funkyfranky is online now   Reply With Quote
Old 10-17-2017, 05:58 PM   #24
funkyfranky
Senior Member
 
funkyfranky's Avatar
 
Join Date: Sep 2015
Location: Trymheim, Asgård
Posts: 1,169
Reputation power: 19
funkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of lightfunkyfranky is a glorious beacon of light
Default

Btw, I have added a tips 'n' tricks section at the end of the second post how you can choose randomly from the CAM liveries. Hope I got all names right

Also, the only airports on the NTTR map, where 747, 757 and A380 have valid parking spots are Tonopah Test Range Airfield, Nellis AFB, McCarran International and Laughlin. A 737 has also parking space at Groom Lake AFB and Henderson Executive.
On all other airports the planes will get spawned on the runway (and might block it) and will get despawned right after the landing event.
__________________
Of all the things I've lost, I miss my mind the most. --- Mark Twain
i7-4790K | Asus GTX 1080 Ti Strix OC| 32 GB Ram 1866 MHz DDR-3| Win 10 64-bit | Asus Maximus Hero VII | Samung EVO 850 SSD | TM HOTAS Warthog | MFG Crosswind | TrackIR 5 | HTC Vive | CV1

Last edited by funkyfranky; 10-17-2017 at 06:53 PM.
funkyfranky is online now   Reply With Quote
Old 10-18-2017, 02:10 AM   #25
Gary
Member
 
Join Date: Oct 2008
Location: South East England
Posts: 421
Reputation power: 11
Gary has a spectacular aura aboutGary has a spectacular aura aboutGary has a spectacular aura aboutGary has a spectacular aura about
Default

Hi,

This is something that has really sparked my interest. For the first time ever in DCS I might even get to design some basic missions for myself (rather than just downloading missions others have done)

In order to do so however, I need to understand some very basics please.

Now this may be the dumbest question you will ever have seen but:

I downloaded the example mission 11 (carrier) and it works fine. What I don't quiet understand is that the Miz triggers call on two lua files. First the Moose.lua (which is on a seperate drive nowhere near my DCS installation) and the second RAT_011.lua which isnt even on my PC full stop?

In which case how is the Miz working just fine??

Regards,

Gary
__________________
I5 - 1TB SSHD, 256 SSD - Nvidia 1070 - 16gb ram - CV1
Gary is offline   Reply With Quote
Old 10-18-2017, 04:31 AM   #26
FlightControl
Senior Member
 
FlightControl's Avatar
 
Join Date: Mar 2012
Location: Antwerp, Belgium
Posts: 1,914
Reputation power: 15
FlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really niceFlightControl is just really nice
Default

Quote:
Originally Posted by Gary View Post
Hi,

This is something that has really sparked my interest. For the first time ever in DCS I might even get to design some basic missions for myself (rather than just downloading missions others have done)

In order to do so however, I need to understand some very basics please.

Now this may be the dumbest question you will ever have seen but:

I downloaded the example mission 11 (carrier) and it works fine. What I don't quiet understand is that the Miz triggers call on two lua files. First the Moose.lua (which is on a seperate drive nowhere near my DCS installation) and the second RAT_011.lua which isnt even on my PC full stop?

In which case how is the Miz working just fine??

Regards,

Gary
OK. This may need indeed a bit of explanation...

You may have been looking at missions and found a lot of triggers, correct?

MOOSE or other scripts use the "scripting engine" of DCS, also subnamed "SSE". This is a set of application program interfaces (APIs) that can be called using the lua language.

In other words, MOOSE is "skipping" the Graphical User Interface trigger mechanism embedded within missions, and is directly loading a "mission scripts", using the DO SCRIPT FILE mechanisms.

That is why you see only two triggers in the mission. The first trigger loads moose.lua, and the second the actual mission script, which is using the MOOSE classes to orchestrate the mission. Both Moose.lua and the other lua file are embedded in the .miz file! You can unzip the .miz file yourself using unzip of 7z or any other zip tool and check for yourself!

RAT is a class of MOOSE, but there are many other classes now that you can use to make missions, which are all included and defined within the moose.lua file.
Consider the moose.lua file as the "definition" of the moose framework, and after loading it in your mission, you can use any MOOSE class to do more advanced stuff.

The funny thing about mission design is that you can design a mission using a mixture of triggers and other DCS mission editor capabilities and scripts and even MOOSE framework classes or objects.

In other words, you don't have to have only 2 DO SCRIPT FILE triggers in the beginning of your missions, but you are free to use scripting within the mission editor as well! (Just note that lua predicates is bugged in DCS since release 1.5, which is a shame!!! bummer . Using lua predicates, you could still use the normal DCS mechanism, and check using scripting some conditions on the fly within your mission. It would make mission scripting much more acessible for people like yourself who are starting up. We have escalated this to ED a few times now, but they haven't fixed this since 2 years.


In short, if you wanna have a good intro about how to embed your scripts into your missions, maybe have a look at this video, that explains a bit this process:



FC

Last edited by FlightControl; 10-18-2017 at 04:35 AM.
FlightControl is offline   Reply With Quote
Old 10-18-2017, 08:52 AM   #27
Gary
Member
 
Join Date: Oct 2008
Location: South East England
Posts: 421
Reputation power: 11
Gary has a spectacular aura aboutGary has a spectacular aura aboutGary has a spectacular aura aboutGary has a spectacular aura about
Default

FC,

Thanks. I understand everything above right up to and including the fact that both Moose.lua and any other.lua are embedded. That now makes perfect sense. I did actually watch both Moose for dummies 0 & 1 vids last night but not knowing the lua's are embedded in the Miz made vid 1 confussing. Obviously I could see in the vid the part where you add the triggers and paths to the lua's but fundementaly not realising they were saved within the Miz was the missing part for me.

Thanks again. I'm looking forward to giving all the other Moose options a try out now too!

Regards,

Gary
__________________
I5 - 1TB SSHD, 256 SSD - Nvidia 1070 - 16gb ram - CV1
Gary is offline   Reply With Quote
Old 10-18-2017, 07:15 PM   #28
zhukov032186
Member
 
Join Date: Nov 2016
Location: Fort Worth, Tx
Posts: 279
Reputation power: 4
zhukov032186 is a jewel in the roughzhukov032186 is a jewel in the roughzhukov032186 is a jewel in the roughzhukov032186 is a jewel in the roughzhukov032186 is a jewel in the roughzhukov032186 is a jewel in the rough
Default

Also awesome project! I'll be incorporating this later
__________________
The battle against ignorance has turned into a war of attrition... and the idiots have numbers.
zhukov032186 is offline   Reply With Quote
Old 10-19-2017, 01:05 AM   #29
RyboPops
Member
 
RyboPops's Avatar
 
Join Date: Oct 2016
Location: Denver, CO
Posts: 259
Reputation power: 4
RyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the rough
Default

This couldn't have come at a better time! Winter is here in Colorado which means riding season is over and the CBR gets parked for a few months. I'm glad I'll have something to keep me busy until spring
__________________
We get it up faster, keep it up longer, and shoot comm all over the world!

USAF 460th SCS
RyboPops is offline   Reply With Quote
Old 10-19-2017, 07:26 AM   #30
RyboPops
Member
 
RyboPops's Avatar
 
Join Date: Oct 2016
Location: Denver, CO
Posts: 259
Reputation power: 4
RyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the roughRyboPops is a jewel in the rough
Default

I have a few questions after playing with RAT for a bit:

1) Let's say I want to use the same departure and destination airport. If I add a minimum distance, will RAT simply ignore it since the departure and destination are the same, or will it generate a random flight path to meet that minimum distance requirement?

2) What is the difference between SetClimbRate and Vclimb? The descriptions in the documentation are nearly the same, although I suspect SetClimbRate is supposed to be the climb rate, and Vclimb is supposed to be the climb speed. Are both of these functioning? If Vclimb works, I'm assuming the parameter it wants is desired airspeed in knots?

I'm sure I'll have more questions as I test more. Absolutely loving the possibilities so far though, this is going to be a game changer for mission developers.
__________________
We get it up faster, keep it up longer, and shoot comm all over the world!

USAF 460th SCS
RyboPops is offline   Reply With Quote
Reply

Tags
moose, random air traffic, rat

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:42 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.