Psyrixx Posted May 15, 2013 Share Posted May 15, 2013 (edited) Here's my script for spawning a dynamic extraction team from the UH-1H Huey helicopter. Makes use of Speed and Grimes' excellent MIST library for DCS: World. A preview of it in action. Script features the following: Group dynamically spawns at User's location Group spawns on the side of the Huey closest to the objective that they're moving towards Group dynamically navigates to set point (friendly asset in this case) Group waits for set amount of time while other objectives are managed Group checks to see if User is on the ground, if not they call in for pick-up Group dynamically navigates back to User's aircraft location (in case they've moved) Group sets trigger and deactivates to simulate being picked up vs killed Group does not spawn or move to extraction until helicopter has touched down and stopped moving Works for multiple aircraft (in Multiplayer, one user can drop off units and another can pick them up upon mission completion if necessary [first player dead, occupied, RTB, etc]) This is my first script using LUA so I apologize if the code is not super organized and neat or if I did not use any well known LUA shortcuts. Big thanks to Grimes for pointing me in the right direction with regards to the "recursive main() loop" that keeps it going. :thumbup: And so, without further ado: Just the code: http://pastebin.com/79MxZncb Edit the code: https://github.com/Psyrixx/dcsw-dynamic-extraction-team I've included a github link in case anyone notices any obvious errors that I've made or wants to tidy things up. I've tested the heck out of this script and think I've squashed all of the bugs. I hope it can help others! :joystick: Edited May 15, 2013 by Psyrixx 3 Robert Sogomonian | Psyrixx website| e-mail | blog | youtube | twitter Link to comment Share on other sites More sharing options...
RagnarDa Posted May 15, 2013 Share Posted May 15, 2013 Nice work! I made a similar script, though I'm glad that yours have a little different aim. DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is. Link to comment Share on other sites More sharing options...
dwpenney Posted May 15, 2013 Share Posted May 15, 2013 Nice! Now I'd like to get a 'downed pilot' spawned at a player crash site :-) Fridge ---------- Things which do you no good in aviation: 1) Altitude above you; 2) Runway behind you; 3) Fuel in the truck; 4) The airspeed you don't have. Link to comment Share on other sites More sharing options...
Joyride Posted May 15, 2013 Share Posted May 15, 2013 Nice work, Psyrixx! I was looking forward to seeing this. Your "first script" is much cleaner than my attempt. :thumbup: dwpenney...here's a simple dynamic SAR scenario which spawns a solider ("pilot") at the ejection location: http://forums.eagle.ru/showpost.php?p=1758327&postcount=43 Link to comment Share on other sites More sharing options...
dwpenney Posted May 16, 2013 Share Posted May 16, 2013 Thanks Joyride! This starts me on the dark path to LUA scripting in DCS :-) Fridge ---------- Things which do you no good in aviation: 1) Altitude above you; 2) Runway behind you; 3) Fuel in the truck; 4) The airspeed you don't have. Link to comment Share on other sites More sharing options...
SNAFU Posted May 16, 2013 Share Posted May 16, 2013 Thank you very much, Psyrixx. Very helpful for learning! Great work! [sIGPIC][/sIGPIC] Unsere Facebook-Seite Link to comment Share on other sites More sharing options...
gunterlund21 Posted May 21, 2013 Share Posted May 21, 2013 This is awesome, great job on this. Now we have some new tasks for the Huey. Other ideas for this would be running supplies to fire bases, etc. Nice Work. I was in Art of the Kill D#@ it!!!! Link to comment Share on other sites More sharing options...
Psyrixx Posted May 21, 2013 Author Share Posted May 21, 2013 Glad it is useful to people! I wrote it specifically for my first mission, Asset Extraction, but I tried to keep the code as modular as possible so that people could adapt it to whatever scenario they desired. =) Robert Sogomonian | Psyrixx website| e-mail | blog | youtube | twitter Link to comment Share on other sites More sharing options...
ENO Posted June 22, 2014 Share Posted June 22, 2014 Psyrixx... or someone else who knows how to interpret the script... I'm trying to set up a hostage rescue where the "asset" will be generated when other conditions are met. I'm trying to figure out if this script is the answer and I know it's VERY close... but there are a few variables I'm not sure of. I take it most of the unit numbers (the chevy's etc) are just group / unit names for choppers that need to be put in the mission- but in this section: local assetUnit = Unit.getByName('Downed Pilot') local assetGroup = Group.getByName('Downed Pilot') local rescueUnit = false local rescueGroup = false local verifyGroup = false I'm wondering... what are the = false for? Does the asset need to go by a specific name? Can it be a larger group or multiple groups of people as a string? Does anyone have a guide for how to apply this script by any chance or a few tips? Thanks "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 More sharing options...
Recommended Posts