Dynamic Medevac Script - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 05-27-2013, 11:32 PM   #1
RagnarDa
3rd Party Developer
 
RagnarDa's Avatar
 
Join Date: Mar 2012
Posts: 1,441
Default Dynamic Medevac Script



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 3.0+ (versions older than 4.2 needs Mist 2.0 and SCT, see next post)

Instructions:

Code:
1. Edit the file Medevac.lua and change as you please:
  • medevac.medevacunits - so it contains all the Medevac UNITS (as named under "Pilot" in the mission editor) that you want to use. See picture below.
  • 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.maxbleedtime - set the maximum time that one could have before a wounded bleeds to death.
  • medevac.bluesmokecolor = Color of smokemarker for blue side, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue
  • medevac.redsmokecolor = Color of smokemarker for red side, same as above
  • 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.
  • medevac.showbleedtimer = Set to true to see a timer counting down the time left for the wounded to bleed out, false to hide it
  • medevac.sar_pilots = Set to true to allow for Search & Rescue missions of downed pilots, false to not use this feature
  • medevac.clonenewgroups - set to true to spawn new units every time the player manages to bring back some wounded to the MASH.
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 Mistv3_x.lua 7. Repeat 4-6 but set time to 4 sec and select Medevac.lua instead. 8. Close the window 9. 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). 10. Add MEDEVAC units (preferably player-controlled Hueys, right?) and name the UNITS (the line that says "Pilot") like you did above in medevac.medevacunits. See pictures: Click image for larger version

Name:	Unit_name.png
Views:	880
Size:	252.1 KB
ID:	92622 Click image for larger version

Name:	Medevac_name.png
Views:	1040
Size:	419.9 KB
ID:	92633 11. Play the mission.


Known issues (v 4):

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

Latest version on GitHub:
https://github.com/RagnarDa/DCS-Miss...master/Medevac


Changelog
( 2014-01-05 ) Happy new year! Time for version no. 4.2! This includes changes from version 4.1 and for alexej21.
  • Changelog v 4.2
    - Verified compatibility with MiST 3.2+ and removed compatibility with SCT.
  • Changelog v 4.1
    - Added so units will place new smoke if the medevac crashes (requested by Xillinx) Still untested, please report!
  • Changelog v 4 alexej21
    - Added option for immortal wounded.
    - Added option for spawning every third crew as an RPG soldier.

( 2013-09-09 ) Update no. 4! This includes the changes from version 3.1 and 3.2:
  • Changelog v 4
    - Added option medevac.sar_pilots for those that want to turn off the search for downed pilots feature, which is probably better done by other scripts.
  • 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)
  • Changelog v 3.1
    - Added check so that MASH is on right coalition.
    - Removed option to use MiST-messaging as it is not working.
    - Added option to change color of smoke for each side (suggested by Shelt)
( 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
( 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-05-28 ) Update! Found a bug thanks to my squad-mate Agaton. Updated script + mission attached!

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!
Attached Files
File Type: miz MEDEVAC_SAR-demo v4_2.miz (58.5 KB, 377 views)
File Type: lua Medevac_SAR v4_2.lua (51.1 KB, 517 views)
__________________
DCS AJS37 HACKERMAN

Bugs will happen

Last edited by RagnarDa; 07-08-2014 at 10:18 AM. Reason: Added link to GitHub
RagnarDa is offline   Reply With Quote
Old 05-28-2013, 11:19 AM   #2
RagnarDa
3rd Party Developer
 
RagnarDa's Avatar
 
Join Date: Mar 2012
Posts: 1,441
Default

These are older versions of the script in case a upgrade breaks it. Requires Mist 2.0 and SCT,
Attached Files
File Type: lua Medevac.lua (23.4 KB, 95 views)
File Type: miz MEDEVAC-demo.miz (43.1 KB, 84 views)
File Type: lua Medevac v2.lua (33.2 KB, 77 views)
File Type: miz MEDEVAC-demo v2.miz (48.3 KB, 85 views)
File Type: lua Medevac_SAR v3.lua (46.3 KB, 100 views)
File Type: miz MEDEVAC_SAR-demo v3.miz (51.1 KB, 95 views)
File Type: lua Medevac_SAR v4.lua (48.8 KB, 108 views)
File Type: miz MEDEVAC_SAR-demo v4.miz (51.9 KB, 108 views)
__________________
DCS AJS37 HACKERMAN

Bugs will happen

Last edited by RagnarDa; 01-05-2014 at 02:31 PM. Reason: Moved old scripts here instead
RagnarDa is offline   Reply With Quote
Old 05-28-2013, 03:40 PM   #3
BIGNEWY
Moderator/ED Testers Team
 
BIGNEWY's Avatar
 
Join Date: Aug 2011
Location: Hereford, UK
Posts: 14,757
Default

Thanks RagnarDa

I am integrating this into one of the Shrek Squadron missions I have, it works well in testing, and I am looking forward to testing it in multiplayer with a full server.

One question I do have, is it possible to change the colour of the smoke ? I had a look at the lua but could not see which attribute was the colour.

again

thanks for a great script
__________________
Windows 10 Pro x64, NVIDIA PALIT 1080 8GB, INTEL i7 4790K ( Cooled by H100i ), 16GB DDR3 , Asus Z97-AR, TM Warthog, Jet provost rudder pedals, TIR5, Trackclip pro, DELL Visor WMR
BIGNEWY is offline   Reply With Quote
Old 05-28-2013, 04:40 PM   #4
mwd2
Senior Member
 
mwd2's Avatar
 
Join Date: Aug 2010
Location: Germany
Posts: 2,829
Default

really nice... in particular that you have add
Code:
medevac.maxbleedtime - set the maximum time that one could have before a wounded bleeds to death.
after i saw : http://www.youtube.com/watch?v=Sh47mRjerGs
__________________
Waiting for:DCS: F/A-18C, DCS: SoH & DCS: Mi-24 Hind, ...
Intel i5-7600K @4.1GHz, 16GB DDR4 @2400MHz, GTX 1070 Gigabyte Gaming OC 8GB DDR5, WIN 10 64Bit Prof.
"Do you know the way to Chak Chak?."


GSPB Squadron "Serious Ugly"

Ghost0815

mwd2 is offline   Reply With Quote
Old 05-28-2013, 07:26 PM   #5
RagnarDa
3rd Party Developer
 
RagnarDa's Avatar
 
Join Date: Mar 2012
Posts: 1,441
Smile

Quote:
Originally Posted by BIGNEWY View Post
Thanks RagnarDa

I am integrating this into one of the Shrek Squadron missions I have, it works well in testing, and I am looking forward to testing it in multiplayer with a full server.

One question I do have, is it possible to change the colour of the smoke ? I had a look at the lua but could not see which attribute was the colour.

again

thanks for a great script
THANK YOU for the feedback!

To change the color, look at line 314:
Code:
trigger.action.smoke(_rescuepoint, 1)
Change the 1 to another number (0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue). Make sure you reload the script in the mission by deleting "Do script file" - trigger and re-adding it. Which color do you want to change to? I don't know which color is normally used at a Medevac/Casevac LZ...

Could I ask you to maybe send me the mission once you finished it? It would be fun to see what you made out of it, and maybe we in Masterarms could use it for our flying-evenings.

Quote:
Originally Posted by mwd2 View Post
really nice... in particular that you have add
Code:
medevac.maxbleedtime - set the maximum time that one could have  before a wounded bleeds to death.
after i saw : http://www.youtube.com/watch?v=Sh47mRjerGs
Thanks! I thought it would add more suspense to the mission.
__________________
DCS AJS37 HACKERMAN

Bugs will happen
RagnarDa is offline   Reply With Quote
Old 05-28-2013, 11:34 PM   #6
BIGNEWY
Moderator/ED Testers Team
 
BIGNEWY's Avatar
 
Join Date: Aug 2011
Location: Hereford, UK
Posts: 14,757
Default

Quote:
Originally Posted by RagnarDa View Post
THANK YOU for the feedback!

To change the color, look at line 314:
Code:
trigger.action.smoke(_rescuepoint, 1)
Change the 1 to another number (0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue). Make sure you reload the script in the mission by deleting "Do script file" - trigger and re-adding it. Which color do you want to change to? I don't know which color is normally used at a Medevac/Casevac LZ...

Could I ask you to maybe send me the mission once you finished it? It would be fun to see what you made out of it, and maybe we in Masterarms could use it for our flying-evenings.



RagnarDa, tested tonight with a few friends and it worked great! I am tweaking my mission, for a shrek squadron mission night and when it is finished I will message you with a copy.

Edit: I changed the smoke to white, the only reason for this was I had red smoke in my mission already for the enemy.

Thanks again !
__________________
Windows 10 Pro x64, NVIDIA PALIT 1080 8GB, INTEL i7 4790K ( Cooled by H100i ), 16GB DDR3 , Asus Z97-AR, TM Warthog, Jet provost rudder pedals, TIR5, Trackclip pro, DELL Visor WMR

Last edited by BIGNEWY; 05-28-2013 at 11:46 PM.
BIGNEWY is offline   Reply With Quote
Old 05-29-2013, 12:01 AM   #7
dooom
Senior Member
 
dooom's Avatar
 
Join Date: Sep 2009
Location: Saskatoon Saskatchewan
Posts: 2,220
Default

very cool
__________________

""This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL
*NOTCH VIDEO F15 vs SU33
*P-51D ANM64 Bombing guide
dooom is offline   Reply With Quote
Old 05-29-2013, 12:18 AM   #8
Speed
Veteran
 
Speed's Avatar
 
Join Date: Nov 2008
Location: Auburn, AL
Posts: 4,079
Default

That's just freaking awesome. I bet this could be modified for pilot SAR very easily, too. A long time back, I wanted to make a script to automatically dispatch an AI SAR helo, but I never got around to it. Your concept is much better though, as it really gives the UH-1 pilots something cool and useful to do. It's far better than the cumbersome ideas that I had (though it helps a lot having an actual human pilot to do it...)

Maybe in the next version of Slmod, I could add the ability to add a custom stat to SlmodStats via Slmod mission scripting. So maybe, if you're interested, a future verison of your script could call the Slmod function (if it exists) to add a stat to player- in particular- number of injured persons saved. So we could have the people you saved added to your logbook, in a very real sense!

Oh and what if your script was modified further- the patients you pick up, maybe they could have randomized injuries. Some would be only lightly injured, while others could be critically injured so badly that if you don't get them back to the MASH really fast, they die! You could have the on-board "Medic" outTextToGroup stuff like, how badly is the guy injured, and whether or not you have time to pick someone else up or you need to book it back to base.

Of course, you need to have patients randomly die and there be nothing you can do about it. Frequently. And the injury timers need to start when the person is hurt, not when you pick them up.

Anyway, I see huge potential in this concept... basically- DCS: MASH!!!! This idea has me greatly excited!
__________________
Intelligent discourse can only begin with the honest admission of your own fallibility.
Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/
Lua scripts and mods:
MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616
Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979
Now includes remote server administration tools for kicking, banning, loading missions, etc.

Last edited by Speed; 05-29-2013 at 12:21 AM.
Speed is offline   Reply With Quote
Old 05-29-2013, 12:33 AM   #9
OGREMAN
Member
 
OGREMAN's Avatar
 
Join Date: Apr 2008
Location: UK HEREFORD
Posts: 128
Default FEEDBACK MASH is Painless MEDEVAC

We have this evening been running your medevac script in a test within one of our training missions. This script is BEAUTIFUL , congratulations on a work of art ...... I love the way it runs and particularly like the way it generates a casualty "bleedout time" linking it to the lifebar status of the casualty. Picking up MULTIPLE groups of casualties in the same lift is also well handled with the "Bleedout time" being indicated by an alternating display showing each groups status .... its great.
Thanks to your help we were also able to change the pickup point smoke colour to better suit our need.
This was by no means an exhaustive test but the first test runs have been great for atmospheric activity for the HUEYs we all loved it.
Possible improvments...... well there is some concern that because of the ruthless efficiency of AI combatants it might be difficult to get enough casualties / survivors to keep one or two MASH HELOS busy during a mission, the logic being that if they were in contact with enemy AI then the spawned casualties would also be quickly killed in follow up action. This might generate lots of "futile" casevac notifications.
In our test session we had a player killing units that were not in direct contact with ememy ground forces, this produced casevac requests that had survivors to pickup.
The other problem lay with the choice of cas location information format ie MGRS grid reference . This is less than usefull when your F10 map cursor only shows Lat & Long and as far as I know its not changable "in mission" bearing in mind that players are now increasingly swapping between many different aircraft in a single session so it would be much better to provide for locations format to be selectable in some way, or if that is not an option then the default choice should be Lat & Long.
BIGNEWY-=Shrek=-99 is now looking to further refine its integration into our training missions.
So the test run got a big thumbs up and we will be using this script in our missions for sure. WELL DONE from shrek squadron members.
__________________
OGREMAN is offline   Reply With Quote
Old 05-29-2013, 10:23 AM   #10
RagnarDa
3rd Party Developer
 
RagnarDa's Avatar
 
Join Date: Mar 2012
Posts: 1,441
Default

@Speed
About the SAR: I had the same idea a while ago, but it seems other people beat me to it (haven't tested it yet).

About the scoring: That would be much appreciated! That was my original idea, to have the player receive points for people they rescued but its impossible right now when only using the script engine.

About different injuries: This is implemented now and the units carried will bleed out depending on multiple factors like the nature of the wound, their relative physical health, amount of blood in their system, amount of pressure applied to the wound and if they're in chock or not.
Spoiler:
No, not really

There's just a countdown timer that starts to count down a random amount of seconds (max time selected by mission designer) from when the unit is picked up and when time is up the unit "dies". Sometimes the soldiers will die almost instantly after they board, sometimes you will have time to pick up others. I will consider changing the code so it will start the countdown when the unit get wounded, but I foresee some problems with that. I was also thinking about changing the countdown timer to something a virtual medic would have said, like "We're losing him! Hurry up!" or something.


@OGREMAN
Thanks for the kind words! I am happy the multiplayer mission worked as I haven't had time to do tests on my own.

About futile medevacs: this might be considered a mission-design issue as the opposing force might be too overhwelming. One way the medevac-Huey's could be more useful is if you place road mines in the mission (Static objects->Structures->Land mine I think). I do on the other hand have a few a ideas that might remedy this problem but I can only try them out once I have more time for coding.

About different map-grids: Will look into having this selectable by the mission-designer.

Thanks everyone for the input!
__________________
DCS AJS37 HACKERMAN

Bugs will happen
RagnarDa is offline   Reply With Quote
Reply

Tags
dynamic, huey, medevac, script

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 11:24 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.