Jump to content

Training Range Script


Cougar

Recommended Posts

Hi guys,

 

First of all I would like to say thank you to everyone who posted snippets and answered question that I had in this section which helped me alot as Im no expert in lua scripting. The script is far from being complete IMO but wife isnt happy about it so that's why Im posting it and maybe someone can continue to work on it to give it more content faster than me ;)

 

Important note: I haven't tested it on multiplayer scale so there might be some bugs....crossing fingers there's none lol but just a note of caution ;)

 

So what the script is about? Training indeed :) and is based on the assets of the 476th vFG Air Weapons Range Objects

 

So far it's pretty much setup for gun strafing training for planes and helicopters but could be expanded for rockets and possibly a good mix with SNAFU's Bdu bomb pratice script.

 

This script is basicaly counting every hit you get with your gun rounds(for now) when you are lined up correctly with the target you intend to hit. To ensure people hitting the right target, I've setup zones before the targets and only when you're inside the hit will be counted. Important note here, the first unit inside a zone will be the only one to be able to make hits, if there's a second unit at the same time in the target zone, his hit wont be counted if he fires but as soon the unit leaves the second unit name will be entered in the list and only then his hit will count.

 

You can view your total hit count for each target with the F-10 comms menu which are specific to planes or helicopters. You can also reset all your hit counts also. I've thought about resetting the score of the plane once it get to a specific distance but I haven't had the time to make it happen though it might be better that way. The only options which might be good is to reset when players select another aircraft but it has to be implemented ;)

 

I've also added one IPplanes and one IPheli unit which can act as the tower through the F7 view to direct pilots in or to train them. These 2 units will receive message when units enter target zones with there Intended target, unit name(not player name) and hit count. New message will overwrite the initial message in the same format once hits are being made.

 

Anyways the best way to describe it is to let you guys have a go at it ;)

 

What You'll need:

- Mist 3.2 with small hot fix for mist.message.add attached in this post

- 476th vFG Air Weapons Range Objects

- attached files

 

I like the do script better then the do script file so I'll attach the revelant files here but everything is set in the ME trigger section.

 

Planes/Helicopters name

 

F-15C = Eagle1, Eagle2

A-10A = Hawg1, Hawg2

A-10C = Hawg3, Hawg4

P-51D = Mustang1, Mustang2

SU-25T = Frog1, Frog2

Mig-29 = Fulcrum1, Fulcrum2

SU-27 = Flanker1, Flanker2

SU-33 = Flanker3, Flanker4

UH-1H = Huey1, Huey2

MI-8 = Hip1, Hip2

KA-50 = Shark1, Shark2

 

Planes Targets name

 

Strafe Pit = StrafePit1,StrafePit2,StrafePit3,StrafePit4

Tac Strafe Soft = TacStrafeS1

Tac Strafe Hard = TacStrafeH1

 

Helicopters Targets name

 

Strafe Pit = HStrafePit1,HStrafePit2

Tac Strafe Soft = HTacStrafeS1, HTacStrafeS2

Tac Strafe Hard = HTacStrafeH1, HTacStrafeH2

Door Gunner = SG1, SG2, SG3, SG4, SG5, SG6

 

 

 

Planes Targets zone name

 

Strafe Pit = StrafePit1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14

StrafePit2: 21, 22, 23, 24, 25, 26, 27, 28, 29, 210, 211, 212, 213, 214

StrafePit3: 31, 32, 33, 34, 35, 36, 37, 38, 39, 310, 311, 312, 313, 314

StrafePit4: 41, 42, 43, 44, 45, 46, 47, 48, 49, 410, 411, 412, 413, 414

Tac Strafe Soft = TacStrafeS1: TS11, TS12, TS13, TS14, TS15, TS16, TS17

Tac Strafe Hard = TacStrafeH1:TH11, TH12, TH13, TH14, TH15, TH16, TH17

 

 

 

Helicopters Targets zone name

 

Strafe Pit = HStrafePit1: HSP11, HSP12, HSP13, HSP14, HSP15, HSP16, HSP17

HStrafePit2: HSP21, HSP22, HSP23, HSP24, HSP25, HSP26, HSP27

Tac Strafe Soft = HTacStrafeS1:HTS11, HTS12, HTS13, HTS14, HTS15, HTS16, HTS17

HTacStrafeS2:HTS21, HTS22, HTS23, HTS24, HTS25, HTS26, HTS27

Tac Strafe Hard = HTacStrafeH1:HTH11, HTH12, HTH13, HTH14, HTH15, HTH16, HTH17

HTacStrafeH2:HTH21, HTH22, HTH23, HTH24, HTH25, HTH26, HTH27

Door Gunner = HFoul1, HFoul2

 

I hope you guys find some potential in that script and any comments or hints is appreciated.

 

P.S.: I think I forgot to change the mission settings so sorry if that's the case...getting late here.

 

Cheers!

planerange.jpg.195418a30396ceea68e3a0ba2b97e8c5.jpg

Helicopter.thumb.jpg.3c23ec01dbd1dfb1da7f8e5e51f4e5d6.jpg

triggers.jpg.f179a7ee5456d8632754300e14d60244.jpg

Training Range Script.rar

Training_Range_Script.miz

Mistv3_2.lua


Edited by Cougar
  • Like 1

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Link to comment
Share on other sites

Hi guys,

 

 

What You'll need:

- Mist 3.2 with small hot fix for mist.message.add attached in this post

- 476th vFG Air Weapons Range Objects

- attached files

 

 

Hi Cougar,

 

Out of curiosity, what was the problem with mist.message.add before the hot fix?

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

Not sure if I can put it to immediate use but I sure appreciate the effort you put in! It's guys like you, mbot, st3ve, gelexo (I never spell his name right) who keep the capabilities of this sim from getting stale.

 

Thanks again coug.

 

;)

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Link to comment
Share on other sites

could you guys explain how to make it work

INTEL CORE I7 6700K

ASUS ROG MAXIMUS VIII HERO

ASUS ROG GTX1080Ti Strix OC

16GB @ 4100 MHz |CORSAIR

Intel 730 SSD 240GB

Corsair 850 W Modular PSU

Corsair Obsidian 650d

Logitech X-56 HOTAS ,Saitek X-65F HOTAS, Pro Ruder Pedals, Pro Flight Instrument Panel

NP TrackIr 5 Pro

Windows 10 PRO

Link to comment
Share on other sites

Nice Cougar.

 

I modifed the BDU script so that it gives both the distance and clock position of bombs. It also calls "no spot" for off-target misses, as well as "bullseye" for direct hits. It's only for use on the conventional circles though, so my next order of business was to get something going for the strafe pits.

 

Looks like I wont have to reinvent the wheel.

 

This is something nice that I miss from the FSX community...over there, freeware and payware devs alike help each other out in order to elevate the baseline knowledge of the community. Unfortunately, thats not something you see too much of around the DCS community.

 

Any news on this upgrade? Will you share it?

 

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Eh Coug...

 

I'm going to run your mission on my server for a bit- well, as the backdrop of some of my emerging missions.

 

I hope you don't mind but I want to be able to add / subtract some aircraft slots- but in doing so I imagine I'm going to need to adjust the script that's tracking these aircraft and add in the various names. Or is that even a factor?

 

Anyway, just wanted to let you know it looks fantastic and I'm looking forward to flexing its muscles a bit in the MP environment in the next few days.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Eh Coug...

 

I'm going to run your mission on my server for a bit- well, as the backdrop of some of my emerging missions.

 

I hope you don't mind but I want to be able to add / subtract some aircraft slots- but in doing so I imagine I'm going to need to adjust the script that's tracking these aircraft and add in the various names. Or is that even a factor?

 

Anyway, just wanted to let you know it looks fantastic and I'm looking forward to flexing its muscles a bit in the MP environment in the next few days.

 

 

No it shouldnt be a problem to remove aircraft....as long the unit name remain the same if you add new items within the limits of the number of present in the mission.....

 

Ive progressed a bit on the updated code but just lacking of time at the moment but new code will be better i assume ;)

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Link to comment
Share on other sites

Okay so from what I'm reading as long as I maintain the existing unit names it doesn't matter what actual aircraft I'm using.

 

Perhaps we can PM about where in the code I may need to go to modify it in the event that my additional aircraft expand beyond the existing ID's you currently use?

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Okay so from what I'm reading as long as I maintain the existing unit names it doesn't matter what actual aircraft I'm using.

 

Correct

 

Perhaps we can PM about where in the code I may need to go to modify it in the event that my additional aircraft expand beyond the existing ID's you currently use?

 

It will be something tricky unfortunatly....

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Link to comment
Share on other sites

Correct

 

 

It will be something tricky unfortunatly....

 

Dont want to step on this thread too much but I was inspired by Cougars script to make one that is a lot more flexible. I can share it with both of you if you would like. You can create any number of zones,targets, and units to be tracked. Most of the work is done in the ME (no messy triggers and such will need to be defined) then you just update 3 or 4 tables in the script and you are good to go. Currently it only supports aircraft gun types (no helis but that could be easilly changed). The script is also less than 300 lines of code vs 3000.

 

If y'all(couldnt resist, I live in Texas) are interested I can attach the example mission and script

Link to comment
Share on other sites

I wouldn't want to take away from the work the Cougar has done but what you've done sounds like it can be applied to any mission at any target?

 

Might also come in handy- but like you (couldn't resist, I'm from canada) mentioned I don't want to hijack this thread either.

 

You should post a thread of your own up- sounds like these two features could work well in their own application.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

I wouldn't want to take away from the work the Cougar has done but what you've done sounds like it can be applied to any mission at any target?

 

Might also come in handy- but like you (couldn't resist, I'm from canada) mentioned I don't want to hijack this thread either.

 

You should post a thread of your own up- sounds like these two features could work well in their own application.

 

That is correct any target but currently only counts gun hits (of a specific type). I was going to post the script and sample mission this evening when i got home from work but saw your questions so I thought i would chime in

Link to comment
Share on other sites

On the next update ive remove the need for zones ;)....wiyh noodle idea selecting target via f10 menu will make it instead of the complex trigger zone mess...

 

Post it up or pm with your script which mihht help pass on some bumps im having here and there ..

sigpic4165_1.gif

attachment.php?attachmentid=36435&d=1266786388

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...
  • Recently Browsing   0 members

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