Jump to content

Dynamic Medevac Script


Recommended Posts

Nice work! Need to try merging it with CSAR and AM from Wolle and Deck's troop drop script... will make for a nearly complete dynamic tasking for Hueys in missions. One step closer to non-stop server action! :D :thumbup:

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

@shelt

Sorry for late response. What you're describing is not the way it's designed to work. I was unaware that there was problems with late clients, my own testing haven't seen this issue but I will have a look and see what the problem might be. I think I noticed a problem with the F10-menu not showing for everyone but the pick-ups should work I think...

 

@Hoghwayman-Ed and Shagrat

There shouldn't be any problems with using this script alongside others. Mix and match as you please! ;)

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

@shelt

Sorry for late response. What you're describing is not the way it's designed to work. I was unaware that there was problems with late clients, my own testing haven't seen this issue but I will have a look and see what the problem might be. I think I noticed a problem with the F10-menu not showing for everyone but the pick-ups should work I think...

 

You are correct, the pick-ups still do work for the units specified for MEDEVAC in the script.

The problem I have seen is not being able to tell if there is still an EVAC mission available, have seen some of the spawned survivors be killed by enemy forces before getting there and no way to tell which units still are alive and require EVAC.

 

Great stuff, though. I can easily overlook it :thumbup:

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

  • 2 weeks later...

I need help with the script "MEDEVAC"

 

Dear RagnarDa:

 

I am contacting you to see if I can solve the problem that I have come up with one of my missions.

The idea was to make a mission using their scritps: Mist_v2, sctv and MEDEVAC_SARv3. Using the same names in the units in your mission.

But I found several problems:

 

1st. - The only thing that works well is that by destroying a unit, appears the crew to evacuate, the other things (collecting messages before throwing smoke, etc. ..) do not work and I had to solve the problem basis to "Triggers". I mean that when it comes to that, I don´t need help.

 

2nd. - In what I need is help in collecting the helicopter units, soldiers do not go up. Apart from this, do not know why it does not work the countdown after collecting the units.

 

If I send the mission, you might take a look and help me?

Awaiting your response, receive my cordial greetings.

Versatile training UH-KA50-A10.rar


Edited by UNICOP
Link to comment
Share on other sites

That took some time to figure out!

 

What you did was that you changed USA to RED-side and set up for the wounded to be delivered to the BlueMASH, but that would'nt make sense wouldn't it? :)

 

So I changed the names of your RedMASH-unit and and the BlueMASH unit so it would be correct.

 

Also I needed to change this line:

medevac.textdisplaymode = 0

into this:

medevac.textdisplaymode = 1

because the MiST-messaging doesnt work for whatever reason.

 

Nice looking mission though!

Versatile training UH-KA50-A10 RagnarDa.zip

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

Any chance on getting green smoke on Blue units, and red on red units? Actually not picky on the colors, just able to choose which color for each side would help.

Is there a way this can be changed in the script?

I'm working on a close quarters city invasion with lots of ground units, and it is hard to tell which units are which sometimes :)

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

 

The Huey was designed primarily as a medevac helicopter, so I made a little script that will generate Medevac taskings for wounded units. If a ground-vehicle on your side is destroyed, some infantry will spawn representing the crew of the vehicle. You will be notified that they want to be evacuated, you will get coordinates of their position, and when you get near they will drop a smoke marker. You should then pick them up, and before the timer has ended, you should have dropped them off at the MASH (hospital). Unfortunately you can't get any points for saving people, but I included a option to spawn a new group just like the destroyed units once you land (see medevac.clonenewgroups in the spoiler). Also, from version 3 on you can pick up downed pilots (Search And Rescue).

 

Requires: Mist 2.0 and SCT

 

Instructions:

 

1. Edit the file Medevac.lua and change:

 

  • medevac.medevacunits - so it contains all the Medevac UNITS (as named in the mission editor) that you want to use.
  • medevac.clonenewgroups - set to true to spawn new units every time the player manages to bring back some wounded to the MASH.
  • medevac.maxbleedtime - set the maximum time that one could have before a wounded bleeds to death.
  • medevac.bluemash = Unit.getByName("BlueMASH") - name a unit in the mission to BlueMASH and it will act as the MASH for blue side.
  • medevac.redmash = Unit.getByName("RedMASH") -name a unit in the mission to RedMASH and it will act as the MASH for red side.
  • medevac.smokecolor = Color of smokemarker, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue
  • medevac.requestdelay = Time in seconds before the survivors will request Medevac
  • medevac.coordtype = Use Lat/Long DMTM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.
  • medevac.displaymapcoordhint = Change to false to disable the hint about changing coordinates on the F10-map
  • medevac.textdisplaymode = 0 to use stacked MiST-style (ideal), 1 to use old-single message style (if no text displayed).
  • medevac.displayerrordialog = Set to true to display error dialog on fatal errors. Recommend set to false in live game.
  • medevac.displaymedunitslist = Set to true to see what medevac units are in the mission at the start (for debugging your mission).
  • medevac.bluecrewsurvivepercent = Percentage of blue crews that will make it out of their vehicles. 100 = all will survive.
  • medevac.redcrewsurvivepercent = Percentage of red crews that will make it out of their vehicles. 100 = all will survive.

2. Open your mission in the Mission Editor

 

 

3. Click "Set rules for trigger" in the left pane

 

 

4. Click the leftmost New for a new trigger.

 

 

5. Click the middle New and change it to Time more, and set it to 2 sec

 

 

6. Click the rightmost New and change it to Do script file and click open and select Mistv2_0.lua

 

 

7. Repeat 6 and select sct2.lua instead

 

 

 

8. Repeat 4-6 but set time to 4 sec and select Medevac.lua instead.

 

 

9. Close the window

 

 

10. Add a MASH for each side. It must be a live ground unit and it must be named "BlueMASH" and "RedMASH" respectively (unless you changed it above).

 

 

11. Add MEDEVAC units (preferably player-controlled Hueys, right?) and name the UNITS (not the groups anymore) like you did above in medevac.medevacunits

 

 

12. Play the mission.

 

Known issues (v 3):

- The Latitude/Longitude coordinates is broken. Don't know why or how to fix it. The other coordinates options (MGRS or Bullseye) do work.

- When I modified a mission made by the Mission Generator, the MiST message-system crashed or just stopped working after a little while. Included an option to use non-MiST message system (just one message at a time).

 

( 2013-05-28 ) Update! Found a bug thanks to my squad-mate Agaton. Updated script + mission attached!

 

( 2013-05-29 ) Update! Fixed a few problems and added new features:

 

  • Please note that medevac.medevacunits should now contain the name of the individual units, and not the group like before.
  • A message system (using MiST) that displays multiple messages from different medevac-tasks. Don't really know how this will work in multiplayer.
  • More options! You can now select which color of the smoke markers to use (default green), coordinate system that the medevac-request will be in (default Bullseye/Imperial), and how long before a unit will request evacuation (default 5 sec which is kind of short). Theres also multiple useful options for debugging/going live, like turning OFF error-dialogs.
  • Note that this download is called v2 and you can still download the old version in case this update brakes something.

( 2013-06-12 ) Update! Fixed some issues, and added new features (including SAR!):

 

  • Changed model of red soldiers to high-detail (russian) ones
  • Added survivalpercent for both sides (suggested by [MA] Agaton)
  • I *think* I solved the problem with long messages (reported by BIGNEWY)
  • Search And Rescue missions! (suggested by a number of people)
  • Added a F10-radiomenuitem so you can check available tasks (suggested by MiK684 and WolfK33)
  • Solved issue with survivors running around in circles
  • The update is called v3

WHAT DO I WANT IN RETURN?

I've spent a few days developing this script. What I need now is feedback! Did it crash? Did it suck? Did it rock? The script outputs data to the dcs.log - file so if you experience a crash or something else unwanted, please please please send the log-file to me so I can maybe fix the problem. If you make a mission with this script please tell me! Even if its a very simple mission I would really like to know how and if this script is used.

 

See you in the skies!

 

RagnarDa,

 

Sorry, new to scripting of any kind. Do you just copy the modified Medevac.lua in the scripts folder??

Link to comment
Share on other sites

spn: Don't copy the script into the script folder. Look at the post you quoted, there is a line that says "Instructions" and then a "Spoiler" and a button. Click the "Show"-button to see the instructions on how to use the script.

 

shelt: I've made changes to the script as per request. You can change the colors at the same place you normally change the smoke colors (see instructions). I haven't tested it so I can't guarantee I haven't made a mistake. If so, please let me know.

 

EDIT: Attachment removed. See following posts.


Edited by RagnarDa

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

spn: Don't copy the script into the script folder. Look at the post you quoted, there is a line that says "Instructions" and then a "Spoiler" and a button. Click the "Show"-button to see the instructions on how to use the script.

 

shelt: I've made changes to the script as per request. You can change the colors at the same place you normally change the smoke colors (see instructions). I haven't tested it so I can't guarantee I haven't made a mistake. If so, please let me know.

 

Thanks for taking a look at this. I tried the script and got the following error.

 

AppData\Local\Temp\DCS\/~mis00005921"]:33: ')' expected near '!'

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

Thanks for taking a look at this. I tried the script and got the following error.

 

AppData\Local\Temp\DCS\/~mis00005921"]:33: ')' expected near '!'

:poster_oops:

Its hard to switch your brain between Lua and C++...

 

Also, if someone would come up with a way to compile DCS:World scripts outside of DCS that would save me LOTS and LOTS of time...

Medevac_SAR v3_1 shelt.lua


Edited by RagnarDa
  • Like 1

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

Did a quick test and seems to work fine now!

Thanks for fulfilling the request, the work is very much appreciated.

Will be running the server tonight and will let you know if there are issues.

Thanks again!

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

I added this script to a "Generated" fast mission. Holy Smokes, I didn't last long! Worked great, but I kept getting blown out of the sky. Guess we gotta hope the Huey gets some CM soon! Those R-73 armed Su-25Ts are killing me. Great addition to the sim!

Link to comment
Share on other sites

Hello RagnarDa, nice work. I put it into a mission I'm working on for quite a while, to let the Huey have some work to do.

Works quite well, but the area of Operations is quite big. So with the bleed timer people die quite often on the way back... well even if not, it is quite boring to fly back to the BlueMASH.

 

Any chance to have multiple MASH per coalition? (BlueMASH#1, BlueMASH#2 etc.) I would like at least 3 to have a chance to divert if time is pressing.

 

...and to make me totally happy: can we change the bleed timer to a Timer that starts when the wounded are hit?

The idea is to realistically simulate the fight of the MEDEVAC to get the wounded to a hospital in the "Golden Hour" to enhance his chance of survivng (like in the Video about the Pararescue guys on the UH-60s).

 

The timer would start counting when the wounded got hit, reaches 60 minutes - message: "That guy is now past the Golden Hour, hope he'll make it" - if the timer exceeds 75 min or so random check if he died already...

 

Not sure this is possible, but it would be extremely realistic. :thumbup:

 

Anyway, if you could add the multiple MASH function, it will greatly enhance the possibiliy of the script to be used in larger missions. :notworthy:

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Dear Colleague:

The other day I read, you had not been able to put in your mission more than 4 helicopters "MEDEVAC".

After studying the matter, here I write as I have gotten, I put 12 helicopters "MEDEVAC"

 

 

medevac.medevacunits = {"MEDEVAC #1", "MEDEVAC #2", "MEDEVAC #3", "MEDEVAC #4", "MEDEVAC #5", "MEDEVAC #6", "MEDEVAC #7", "MEDEVAC #8", "MEDEVAC #9", "MEDEVAC #10", "MEDEVAC #11", "MEDEVAC #12"} -- List of all the MEDEVAC _UNIT NAMES_!

 

medevac.redmash = Unit.getByName("RedMASH","RedMASH #2", "RedMASH #3") -- The unit that serves as MASH for the red side

 

;)


Edited by UNICOP
Link to comment
Share on other sites

I have put at least 8 units in as medevac, haven't tried to put multiple MASH units in, but don't see why it would be an issue.

 

I also set the MASH units to transmit an ogg file (use radio chatter for immersion effect, or music to fly by) set to a specified FM channel. You can then use the FM>Home feature to navigate to the MASH unit.

Good thing is that you can use the same ogg file for different aircraft radio, say for P51 on channel 124 AM.

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

v 3.2

 

UNICOP: I doubt that adding multiple MASH:es in the way you suggested will work, but I did modify my script to be able to handle multiple MASH:es. Adding multiple MEDEVAC-units the way you wrote should on the other hand work.

 

shagrat: The reason I don't start the bleed-out timer when the units gets wounded is because I'm not really sure how it will look when units suddenly disappear because I can't "kill" them but only remove them ("destroy"). Will look into it at some point though. I also think a time-window of 60 minutes will be too much for most missions but we'll see what I can do. Also, about long transportation: If the battlefield is moving you could just keep the MASH moving with it, it doesn't have to be stationary...

 

Changelog v 3.2

- Added possibility for multiple MASH:es (suggested by a number of people)

- Added option to hide bleedout timer (suggested by FubarBundy)

Medevac_SAR v3_2.lua

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

Great! I'll test it today !

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

perfect! multiple MASHs work like a charme.

Thank you! :thumbup:

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Any idea on why this error would pop up?

 

ERROR Trigger: can't execute trigger, err:"[string "?"]:1: bad argument #1 to 'loadstring' (string expected, got function)"

 

I had a MP server last night would crash each time until I renamed the BlueMash without the "#1" then no crash.

 

I ran the script with single player with mash named BlueMASH #1 and seemed to work OK. Just MP an issue?

 

**EDIT** Just a note to say I set "medevac.clonenewgroups" to false and seemed the error went away


Edited by shelt

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

Hmm... It is difficult to tell what that is. First of all I am not entirely sure that it is related to my script as IIRC the line usually starts with ERROR SCRIPT .... and so on if there is an error in the script. Could be something related to my script but I think I need more info then, like for example the whole log-file. From the looks of it it might be an issue with a trigger in your mission. Could it be that the trigger loading the script was broken but it got fixed when you modified the script and then reloaded the script, or maybe you updated DCS but the mission was first saved in the old version of DCS? I am just guessing...

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

Link to comment
Share on other sites

I wont be able to test it out until next weekend, not around my computer to try it.

I will see if i can narrow it down some.

I have noticed a couple of wrinkles in the mission that seems over time ejected pilots may take the spot of "client" available aircraft?

A friend and I took the time during one test to join each and every aircraft available as "human controlled" before the mission start, and all available aircraft were usable by a human for the next hour and half for human to join. If we do not take the time to do this we would eventually get the "soldier ak" or similar error when trying to join a client aircraft.

This seems to indicate pilots who ejected are taking th ID of the client aircraft?

I will also try and remove all aircraft hen test to see if thar solves the problem as well.

I'll send you a complete log next week-end.

 

Thanks for the patience and responding :thumbup:

Intel i7-3770K,Windows 10 64,Noctua NH-U12S ,ASRock Z77 Extreme4 ,G.Skill 32GB DDR3 2400,EVGA GTX 1080,ADATA XPG900x2 RAID 0, CM HAF XB Case,Thrustmaster Warthog,Combat Rudder Pedals,Logitech G930 with wireless TrackIR 5, 39" Insignia LED 120Hz Monitor, Oculus Rift

Link to comment
Share on other sites

Just checked my code and the ID of the "pilot" and his group is a randomly generated number between 1000 and 10000 which means it is a pretty slim chance that it takes up the ID of a client aircraft (especially since you probably don't have over 1000 units in your mission). Also, my understanding is that if a new unit is created with the same ID as an old unit the old unit is removed and the new unit is created. I really don't have an idea how it could be that you're having this issues. I guess its especially frustrating to have issues in multiplayer :(

 

I would highly recommend trying to rule out any mods that might be the issue. Also, this "fix" has made DCS a lot more stable for me, but use it at your own risk:

http://forums.eagle.ru/showthread.php?t=107315

DCS AJS37 HACKERMAN

 

There will always be bugs. If everything is a priority nothing is.

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