Jump to content

Random Airtraffic Script (with MIST2.0)


SNAFU

Recommended Posts

Check in the script that the AF1-3 where they are called in later functions have 'quotes' surrounding them e.g. ('AF1') as I remember fixing up a couple of things in one of the versions.

 

We ran a modded version of this script for just US aircraft in a mission for over 2 hours without any problems on our dedicated server this evening.


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

hey,

 

thanks for the reply!!

 

so change this:

AF1IDname = Airbase.getByName(AF1)
AF1ID = AF1IDname:getID()
AF2IDname = Airbase.getByName(AF2)
AF2ID = AF2IDname:getID()
AF3IDname = Airbase.getByName(AF3)
AF3ID = AF3IDname:getID()

 

To:

AF1IDname = Airbase.getByName('AF1')
AF1ID = AF1IDname:getID()
AF2IDname = Airbase.getByName('AF2')
AF2ID = AF2IDname:getID()
AF3IDname = Airbase.getByName('AF3')
AF3ID = AF3IDname:getID()

and other areas such as the trigger.mics.getZone(AF3) functions??

 

also, just double checking, the series of trigger zones in the ME need to be airfield1, airfield2, airfield3 and airlanehub1??

 

Thanks again!!

Link to comment
Share on other sites

hey,

 

thanks for the reply!!

 

so change this:

AF1IDname = Airbase.getByName(AF1)
AF1ID = AF1IDname:getID()
AF2IDname = Airbase.getByName(AF2)
AF2ID = AF2IDname:getID()
AF3IDname = Airbase.getByName(AF3)
AF3ID = AF3IDname:getID()

 

To:

AF1IDname = Airbase.getByName('AF1')
AF1ID = AF1IDname:getID()
AF2IDname = Airbase.getByName('AF2')
AF2ID = AF2IDname:getID()
AF3IDname = Airbase.getByName('AF3')
AF3ID = AF3IDname:getID()

and other areas such as the trigger.mics.getZone(AF3) functions??

 

also, just double checking, the series of trigger zones in the ME need to be airfield1, airfield2, airfield3 and airlanehub1??

 

Thanks again!!

 

 

 

dont change those ones...scroll further down and change the random departure and random destination point....change from AF1 to 'AF1'

 

 

also name trigger zones AF1, AF2, and AF3

 

 

here is a working version that spawns yak40 and An-26b for georgia (civilian traffic)....this works with mist3.2....just place zones AF1, AF2, AF3 and airlanehub1, then enter the airbase names into the script if you dont use the three bases I did...

 

MIST2_0-RandAT3AF_v5.lua

 

 

I'm now going to try and change the spawn point names to be able to load this script more then once...one Georgian civilian traffic...one Russian civian traffic...then military traffic....hopefully this works....

 

 

Edit....changing to AF4, AF5, AF6 and airlanehub2 worked....with the ablility to choose which aircraft spawn the possibilities are pretty endless with this script....you can make one that spawn red air power, then make one that spawns blue air power...put airlanehub1 and airlanehub2 at the same area to force a conflict.....add two more of the same script that spawn a red civilian and blue civilian air and you have a pretty populated map with running four layers of the same script


Edited by Davis0079

It only takes two things to fly, Airspeed and Money.

Link to comment
Share on other sites

HI,

 

thanks for the reply!

 

I tried running the script you attached, thanks!, only I'm getting a an error :cry: see the attached pic it happens as soon as the sim loads, thats with the updated script file and running MIST3.2 from the init script line.

 

any pointers will be greatly appreciated!!

 

this always seems to happen!

 

thanks again

 

EDIT Scrap that! I rewrote the mission :doh: and it now works beautifully! thanks for your help!! just need to work out how to select the aircraft that are spawned, set frequency, move away from just civs and add in more layers I think.... is there and aircraft list anywhere??

 

Thanks :)

1722538598_strangeerror.PNG.263bb71e199837cd959992b2b36257df.PNG


Edited by fenderplayer946
Link to comment
Share on other sites

I rewrote the mission :doh: and it now works beautifully!

 

I am nowhere near talented enough to "rewrite script," but since you are making progress, can you and whoever else understands this stuff please keep working on this somewhere and post workable updates? I am one of what I'm sure is a decent crowd of people who would LOVE to see a downloadable, working script to add to missions for random ai traffic.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Huh, I didn´t update this script here for a long time. Didn´t know, anybody uses it.

 

I was working on the part of script, which shall clean up the apron, once the AI planes landed. Now the script is modified in a way it removes all landed AI aircraft more reliablely. But it does not consider taxiing accidents anymore. When I have time I also include taxiing accidents and traffic jams in the routine check.

 

Please describe your specific problems, then I try to help. So far the script ran without problems beside the increased mission load.

 

If you are looking for a more intelligent script, which defines an airspace to each coalition, keeps a defined amount of random CAP fighters in defined triggerzones and task the AI CAP to intercept intruders detected by friendly EWR radar, if no CAP is on station spawns random intercept flights on defined airfields and task them to intercept the intruder, then I can give you another script, which is as good as finished and so far stable on my test server for at least 4 hours (at least the script does not hang anymore for as long as I could test on my computer).

 

PS:Update in first post. Please report back if you´re facing issues or problems with this.


Edited by SNAFU
  • Like 1

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

I have a problem.....when I create a second script and make a AF4, AF5, AF6 and airlanehub2....adjust one script for red and one for blue....put airlanehub1 and 2 in the same spot...,,,

 

up to this point everything sounds cool right....I launch the mission...watch the map...I have the spawn timer set to 30, 60....everything runs fine.....just one problem...the spawned aircraft dont attack anything or really defend themselves......

 

....can you help me add the OPEN FIRE/FIRE AT WILL command...maybe one of the defend options (3,3)

 

[1] =

{

["number"] = 1,

["auto"] = false,

["id"] = "WrappedAction",

["enabled"] = true,

["params"] =

{

["action"] =

{

["id"] = "Option",

["params"] =

{

["name"] = 3,

["value"] = 3,

}, -- end of ["params"]

}, -- end of ["action"]

}, -- end of ["params"]

}, -- end of [1]

[2] =

{

["number"] = 2,

["auto"] = false,

["id"] = "WrappedAction",

["enabled"] = true,

["params"] =

{

["action"] =

{

["id"] = "Option",

["params"] =

{

["name"] = 0,

["value"] = 1,

 

 

 

I cant get this working.....i think there is an easier way by using the ( Group.getByName(groupName):getController():setOpti on(0, 1)).... but I cant seem to get either of this working in this script......this script is the first DCS script I've messed with....this thing is badass...I just got to get the aircraft attacking....

 

 

If they are spawning in as CAS...will this make the fighters not target any other fighters....maybe changing the planes to CAP will get then in the fight.....

 

...you said something about another better script you have for CAP.....i can go back to using this for civil traffic.....

 

....either way....glad you got around to putting up a recent post so I can rep you....running 2-3 layers of this script has filled my single player missions I run for fun.....

 

 

edit...heres my trial track...Random traffic trial.miz


Edited by Davis0079

It only takes two things to fly, Airspeed and Money.

Link to comment
Share on other sites

My intention was actually only to create a little ambient life in DCS similar to the civillian traffic on the roads.

 

You could see what happens if you simply replace the mission task "CAS" with "CAP" and edit the table ["task"] in line 2614:

 

["task"] = 
                                   {
                                   ["id"] = "ComboTask",
                                       ["params"] = 
                                           {
                                           ["tasks"] = 
                                               {
                                                      
                                               }, -- end of ["tasks"]
                                           }, -- end of ["params"]
                                   }, -- end of ["task"]


For example you create a MIZ file with a group of the mission "CAP", give it distinctive name, a waypoint with the actions you want it to perform in advance waypoint menu (f.e. "CAP"), save the MIZ, open it with 7z, open the file "mission" in the *.miz folder (is actually just an compressed file, you can extract with 7z) with notepad (or notepad++), look for the groupname (ctrl+f), scroll a little up and look for the table inside the ["route"] table, under ["points"] and copy you designed conten of ["task"] into the script. Note that you cannot use "engage Group" or something with such variables, without knowing the GroupID of the Group the CAP shall engage...

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

Hi,

 

SNAFU, that combined script sounds awesome!! would make training/practise missions a whole lot more interesting!!

 

Is there anywhere that lists the IDs to allow specific/range of A/C to be spawned??

 

and thanks for the update!! :thumbup:

 

EDIT - cant seem to get the updated script to run :S similar error to last time

regards


Edited by fenderplayer946
Link to comment
Share on other sites

Ah, sorry my fault...

 

Yesterday I just modified a function slightly and copied it from a newer version.

 

Didn´t have the time to test the one I uploaded here.

 

Since I am currently away from my Home PC, I cannot test the script, so I just uploaded it, but I overlooked the line etcher just pointed out:

 

Delete the complete line

 

world.addEventHandler(ClearApronRAT)

 

at the end, that was a left over from the former version...

 

 

PS: I delteted the uploaded version here in this thread. I will upload the latest version, as soon as I have sufficient time to deal with it.


Edited by SNAFU

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

... will upload the latest one, when I have time and access on my home PC.

 

Excellent, and yes, thanks for the hard work. Demand seems to be building for this outstanding idea. I know it's going to be great! Can't wait.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Uploaded my recent version of script with an exmample miz file in 1st post.

 

The script works so far, if you face any bugs and errors, please report back, testing is the most time consuming part of all missions and time is something I always lack... ;)

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

Fantastic SNAFU! when I get on later I'll give it a crack! :D

 

Just a thought I had the other day after leaving the script running for an hour or so...... It's spawned a rediculous amount or.aircraft, is it possible to use a loop?? (Sorry not the familier with lua code:confused:) to limit it somehow??

 

Thanks again!

Link to comment
Share on other sites

That should be easy...

 

Modify the if block in line 2553 and add groupcounter < [choose your maximumg number, here 10] behind the 2 if-checks as condition as following:

 

   if (LogisticOrHeliOrFighter == 1 or LogisticOrHeliOrFighter == 3) and groupcounter < 10 --your maximum number   
       then
       coalition.addGroup(_country, Group.Category.AIRPLANE, _airplanedata)
   elseif (LogisticOrHeliOrFighter == 2) and groupcounter < 10--your maximum number
       then
       coalition.addGroup(_country, Group.Category.HELICOPTER, _airplanedata)
   end

And you have to modify line 2743 and add groupcounter = groupcounter -1:

                           shutdowngroup:destroy()
                           groupcounter = groupcounter - 1

 

Note that I didn´t test this modification... anything might happen, that`s the fun with scripting... ;)

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

hmmh it worked fine, when I tested yesterday evening. Please try the example miz file and cross check, that`s what I would say. Remember that the other script is also active in the example file.

 

If you have time, you can sent me your mission and I take a look, but that won´t be before someday next week.


Edited by SNAFU

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

FYI a couple of Airdrome names have changed

 

This should be the airdrome IDs:

 

0 Airdrome_0

1 Khersones

2 Saki

3 Simpheropol

4 Razdolnoe

5 Dzhankoy

6 Kirovskoe

7 Kerch

8 Belbek

9 Krasnogvardeyskoye

10 Octyabrskoe

11 Gvardeyskoe

12 Anapa

13 Krasnodar

14 Novorossiysk

15 Krymsk

16 Maykop

17 Gelendzhik

18 Sochi

19 Krasnodar_P

20 Sukhumi

21 Gudauta

22 Batumi

23 Tskhakaya

24 Kobuleti

25 Kutaisi

26 MinVody

27 Nalchik

28 Mozdok

29 Tbilisi-Lochini

30 Soganlug

31 Vaziani

32 Beslan

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 the info, HighwayEd :thumbup:

 

hmmm this is strange :S, the example miz works, it runs and spawns aircraft no problem...... I've added it to this post, I'm probably missing something really obvious lol

 

Thanks again!

 

I had chance to check your mission. It should work when you rename the triggerzones over the airfields and give them the same name they have script, in this case "Batumi", "Kobuleti" and "Kutaisi".

 

This is the only and esiest way I found to get the Airfield ID right, which is need to let the AI spawn on the right airfields. You could also use the table posted above, but I thought editing the airfield name in the script and in the ME is easier.

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

  • Recently Browsing   0 members

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