Jump to content

[MOOSE] RAT - Random Air Traffic


Recommended Posts

Is there a way to not make RAT aircraft despawn immediately when they die?

It is a bit weird, when you shoot one down, and it just vanishes in thin air.

In fact, it happens so fast, you dont even get credited in the log, or scoreboard.

"Your pumping days are over, Megatron!" -Optimus Prime

"This calls for a very special blend of psychology and extreme violence" -Vyvian

Link to comment
Share on other sites

Is there a way to not make RAT aircraft despawn immediately when they die?

It is a bit weird, when you shoot one down, and it just vanishes in thin air.

In fact, it happens so fast, you dont even get credited in the log, or scoreboard.

I thought this happened to me as well but in my case I shot a RAT aircraft at exactly the same time that it entered its destination zone and that was the reason it despawned. To make sure this was the case I spawned multiple other RAT aircraft away from their destination and successfully shot them into pieces. Are you sure you’re not having the same issue as I did?

Link to comment
Share on other sites

Yeah. I'm sure.

I shot one down over the mountains, for example, on its rout between Mozdok and Tibilisi.

 

Another one between Sochi and Kutaisi.

Just vanishes.

 

At one single occation was there an entry in the log, and that was when one was shot down by a SA-6 Kub.

 

I figured it instantly died, before it could despawn.

"Your pumping days are over, Megatron!" -Optimus Prime

"This calls for a very special blend of psychology and extreme violence" -Vyvian

Link to comment
Share on other sites

Hmm, there is a function in RAT that despawnes RAT aircraft when they suffered a certain amount of damage. But this function is called only every 30 seconds or so.

 

So its very unlikely that they that they get despawned the very moment you hit them.

 

Anyway, I will check by shooting them down myself. They make some easy pray :)

 

I'll get back to you guys!

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

Hmm, there is a function in RAT that despawnes RAT aircraft when they suffered a certain amount of damage. But this function is called only every 30 seconds or so.

 

So its very unlikely that they that they get despawned the very moment you hit them.

 

Anyway, I will check by shooting them down myself. They make some easy pray :)

 

I'll get back to you guys!

 

I looked into the issue a bit. There seem to be two issues:

- The RAT _OnEngineShutdown handler despawns planes even when they get shutdown in the air, which it shouldn't.

- The RAT _OnDead or _OnCrash events don't get called, the respawning should happen there.

 

I made some fixes:

- Check that the unit is not airborne before despawning in _OnEngineShutdown

- Merged _OnDead and _OnCrash handlers into a shared _OnDeadOrCrash handler as is done in the base SPAWN object.

- Respawned dead or crashed objects in the new _OnDeadOrCrash handler.

- Added a RAT:SetRespawnDelay to set respawn_delay, to allow customizing time before re-spawning dead/crashed units.

 

Attached my customized Moose.lua based on funkyfranky's version linked in #121.

 

Hope this helps, would love to see these changes integrated in the "official" version.

Moose_crashed_unit_fixes.zip

Link to comment
Share on other sites

PM Flight Control/Franky about your fixes, I am pretty sure FC is quite happy to allow you to create a fork and then all being well it will get merged back into the next release and you'd get credit for the changes. While FC does co-ordinate things Moose is definitely a community project and the more helpers the better is the attitude as far as I know.

 

 

...

Attached my customized Moose.lua based on funkyfranky's version linked in #121.

 

Hope this helps, would love to see these changes integrated in the "official" version.

Link to comment
Share on other sites

I looked into the issue a bit. There seem to be two issues:

- The RAT _OnEngineShutdown handler despawns planes even when they get shutdown in the air, which it shouldn't.

Hi tensa_yun, look like you had a close look at the code. That's great :)

 

I agree, despawning on the event EngineShutdown is not ideal. However, there was a reason why I did this. Problem is that the despawn routine triggers a MOOSE routine group: Destroy(). That itself creates a CRASH event. Therefore, calling the despawn function inside the _OnDeadOrCrash function would cause a nasty loop of spawning/despawning.

 

- Check that the unit is not airborne before despawning in _OnEngineShutdown

That's a very good check. I'll add that :)

- Merged _OnDead and _OnCrash handlers into a shared _OnDeadOrCrash handler as is done in the base SPAWN object.

Yeah, the event function must be exactly the same as in the SPAWN class. Otherwise it is not called but the corresponding SPAWN event handler functions.

 

- Respawned dead or crashed objects in the new _OnDeadOrCrash handler.

Hmm, I have not tried your version but here is where I see a problem. Since you are despawning and respawning in _OnEngineShutdown and despawning triggers a crash event, which in turn calls _OnDeadOrCrash, you should ultimately respawn the same flight twice. Have you checked that?

I mean, it would work if you shoot down planes, but if they finish their flight normally and shut down their engines at the airport, you should get that problem.

- Added a RAT:SetRespawnDelay to set respawn_delay, to allow customizing time before re-spawning dead/crashed units.

I will add that. The respawn delay was only used for the case when you enable respawn at landing. But it can be generalized.

 

Hope this helps, would love to see these changes integrated in the "official" version.

Definetly. But probably a bit adjusted. Are you on Discord https://discord.gg/AeYAkHP

It's a bit better for discussions. Thanks for your suggestions. That triggered some good ideas :)

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've now got around and did some more testing. a lot more testing, in fact (still not the modified version, mentioned above)

 

RAT aircraft despawn every time I shoot them down. Always. There is no mention in the log, and you do not get credited for the kill. They just disappear.

The exeption seemes to be *sometimes* when RAT aicraft gets shot down by SAM units.

 

Also.

After a couple of hours in game, the traffic significantly decreases.

And the reason for this seemes to be twofold.

 

1. Appearantly some RAT aicraft - possibly mainly helicopters - crash randomly into mountains - and appearantly this does not cause them to respawn?

 

2. A lot of aircraft gets stuck inside eachother, at the runway threshold on the Novorossysk airfield. there are possibly more troublesome airfields, but this is the one ive identified.

For some reason, they do not get despawned/respawned, but are just jumbled togeather in a huge bounch.

 

Sometimes ive had to manually despawn five or six aicraft, stuck inside eachother in a huge ball.

"Your pumping days are over, Megatron!" -Optimus Prime

"This calls for a very special blend of psychology and extreme violence" -Vyvian

Link to comment
Share on other sites

RAT aircraft despawn every time I shoot them down. Always. There is no mention in the log, and you do not get credited for the kill. They just disappear.

The exeption seemes to be *sometimes* when RAT aicraft gets shot down by SAM units.

Yes, it's because when you shoot them down, that creates an event that the engines are shut down. Same as when they shut down their engines normally after arriving at the airport.

When that event happens, they get despawned in either case.

I have a better solution meanwhile due to the suggestion of tensa_yun above. So you will be able to shoot them down and they will not despawn.

 

 

After a couple of hours in game, the traffic significantly decreases.

And the reason for this seemes to be twofold.

 

1. Appearantly some RAT aicraft - possibly mainly helicopters - crash randomly into mountains - and appearantly this does not cause them to respawn?

Yes, crash events don't trigger a respawn (yet!). Reason is partly the problem you describe in point 2. But this also means that you can loose RAT aircraft over time. Several solutions are in progress ;)

 

2. A lot of aircraft gets stuck inside eachother, at the runway threshold on the Novorossysk airfield. there are possibly more troublesome airfields, but this is the one ive identified.

For some reason, they do not get despawned/respawned, but are just jumbled togeather in a huge bounch.

Sometimes ive had to manually despawn five or six aicraft, stuck inside eachother in a huge ball.

Yes, that is a DCS bug I reported here https://forums.eagle.ru/showthread.php?t=203429

It's reported by now and will hopefully get fixed soon.

 

Meanwhile, I'm working on a method to circumvent this. But it's a little tricky :)

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 would like to disable the ATC messages but I can't get this function to work.

 

RAT:ATC_Messages(disable)

 

I just put that directly into my script, but when I do that, RAT stops working. Am I using it wrong?

You have to change the syntax. I give you an example:

yak=RAT:New("RAT_YAK")  -- This makes a RAT object "yak"
yak:ATC_Messages(false)   -- This disables the ATC messages. Not only for this RAT object but for all!
<more code>
yak:Spawn(5)

 

Hope this helps :)

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

This is my code. It all works fine, but as soon as I add yak1:ATC_Messages(false), it stops working. Does not spawn any planes anymore.

 

local yak1=RAT:New("Georgia_Air")
local yak2=RAT:New("Georgia_Air2")
local yak3=RAT:New("Russia_Air")
local yak4=RAT:New("Russia_Air2")
local yak5=RAT:New("Alg_Air")
local yak6=RAT:New("Alg_Air2")



yak1:SetCoalition("sameonly")
yak2:SetCoalition("sameonly")
yak3:SetCoalition("sameonly")
yak4:SetCoalition("sameonly")
yak5:SetCoalition("sameonly")
yak6:SetCoalition("sameonly")


yak1:ContinueJourney()
yak2:ContinueJourney()
yak3:ContinueJourney()
yak4:ContinueJourney()
yak5:ContinueJourney()
yak6:ContinueJourney()

yak5:SetDeparture("Tbilisi-Lochini")

yak2:ATC_Messages(false)


yak1:Spawn(5)
yak2:Spawn(1)
yak3:Spawn(4)
yak4:Spawn(1)
yak5:Spawn(1)
yak6:Spawn(1)

Link to comment
Share on other sites

This is my code. It all works fine, but as soon as I add yak1:ATC_Messages(false), it stops working. Does not spawn any planes anymore.

Silvern, the code looks fine. Could you provide the mission file please?

Also, do you use a RAT version which already has this feature? This would be the one included here https://forums.eagle.ru/showpost.php?p=3393258&postcount=121

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

were you guys (whoever created this script) able to solve the issue when aircraft would get spawned on a runway?

Now that you mention it ;)

 

 

Not solved (that's on ED) but circumvented I'd say. We are working on the next stable MOOSE version that will contain RAT 2.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

This looks awesome. Thanks for your work!!

 

I am just trying this for the first time and it worked with 1 flight template. So, I added one more and it stopped working. After a while I just restarted DCS and started all over. And it worked again.

 

So, I added one more template and it will only start the first template of 5 spawns. The other template of 15 does not occur. Am I missing something?

 

local c17=RAT:New("RAT_C17")
c17:Spawn(5)

local c130=RAT:New("RAT_C130")
c130:Spawn(15)

 

Both templates are named correctly and are Late Activation. Other than that, I don't know what could be wrong. I downloaded your Moose.lua from the Github link in your first post. It said it was v2.2. Is there a newer version?

 

EDIT:

Just a question...

 

Should I remake my Trigger for the Mission Script file every time I make a change to it? ie. does it use my changes to that lua file if I don't delete the trigger and re-add the trigger? (I think I read somewhere that someone asked if it was imbedded when the trigger was added. Or did it point to that lua file..)


Edited by Snacko

Intel I9-10850K (OC @ 5.0ghz) │ Asus Maximus XII Hero │ G.Skill Ripjaws 64GB (4x16GB) DDR4 3200 │ Thermaltake Water 360mm
Gigabyte RTX 4090 Gaming OC 24gb │ 2TB M.2 EVO Pro; 1T M.2 EVO; Sandisk SSD Drives │ 49" Samsung Curved Widescreen │ 28" Touchscreen

- ҉ - Blackshark Cockpit Trainer - ҉ -    Thread   | Download

Link to comment
Share on other sites

This looks awesome. Thanks for your work!!

Hi Snacko and thanks :)

 

Your code looks absolutely fine. And if you get one group working, you've already mastered the most difficult part :thumbup:

 

Please attach the mission (and if possible DCS log) file(s) you're using. Then I can figure out where things go wrong.

(Having multiple groups should be no problem per se. I do this all the time.)

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

EDIT:

Just a question...

Should I remake my Trigger for the Mission Script file every time I make a change to it? ie. does it use my changes to that lua file if I don't delete the trigger and re-add the trigger? (I think I read somewhere that someone asked if it was imbedded when the trigger was added. Or did it point to that lua file..)

Good question. You don't have to delete and remake the whole trigger. But you need to open and reload the script file (right hand side). And then save the mission again(!) each time you make changes to your mission script file.

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

Also, in your script from the above video(McCarran High Frequency Outbound Traffic) available to download? That also looks great!!

 

Thanks again for this mod. I can't believe i just found it today. Both this and CAM are awesome and so easy to use! :thumbsup:


Edited by Snacko

Intel I9-10850K (OC @ 5.0ghz) │ Asus Maximus XII Hero │ G.Skill Ripjaws 64GB (4x16GB) DDR4 3200 │ Thermaltake Water 360mm
Gigabyte RTX 4090 Gaming OC 24gb │ 2TB M.2 EVO Pro; 1T M.2 EVO; Sandisk SSD Drives │ 49" Samsung Curved Widescreen │ 28" Touchscreen

- ҉ - Blackshark Cockpit Trainer - ҉ -    Thread   | Download

Link to comment
Share on other sites

Also, in your script from the above video(McCarran High Frequency Outbound Traffic) available to download? That also looks great!!

Not yet. It's basically finished. I just need to polishing and test a few things before the "official" release :)

 

Thanks again for this mod. I can't believe i just found it today. Both this and CAM are awesome and so easy to use! :thumbsup:

Yeah, CAM is stunning! And RAT and CAM mix really well :D

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

Now that you mention it ;)

 

Not solved (that's on ED) but circumvented I'd say. We are working on the next stable MOOSE version that will contain RAT 2.2 :)

 

Good. I was going to suggest the below:

 

if event.id == world.event.S_EVENT_BIRTH then
     if event.subPlace == world.BirthPlace.wsBirthPlace_RunWay then
          -- re-spawn

i5-9600K@4.8GHz 32Gb DDR4 Asus TUF rtx3080 OC Quest Pro Warthog on Virpil base

Link to comment
Share on other sites

I am having HUGE issues with RAT now.

I created templates for Yak-40's, AN-26B's and IL76's

All of which works just fine.

 

So then I expande by adding some AN-30M's and Mi-27V's

 

Theese last two groups only works in *one* single mission Ive created.

In other missions, only the original three aircraft types will spawn.

Even though i use the exakt sam script file!

 

I have done and re-done the mission and I can't get it to work. It only works in one mission.

Its so illogical and strange I am pulling the few last short strands of hairout of my head!

"Your pumping days are over, Megatron!" -Optimus Prime

"This calls for a very special blend of psychology and extreme violence" -Vyvian

Link to comment
Share on other sites

I have done and re-done the mission and I can't get it to work. It only works in one mission.

Its so illogical and strange I am pulling the few last short strands of hairout of my head!

Grodlund, sometimes it is just a small thing. Send me the mission which does not work and I'll 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

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