Dynamic Extraction Team Spawning (My Script Linked) - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 05-15-2013, 01:58 PM   #1
Psyrixx
Member
 
Psyrixx's Avatar
 
Join Date: Feb 2013
Location: San Francisco, CA
Posts: 501
Lightbulb Dynamic Extraction Team Spawning (My Script Linked)

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.

http://www.youtube.com/watch?v=pu1_Tp53NcA&hd=1
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.



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!


Last edited by Psyrixx; 05-15-2013 at 02:02 PM.
Psyrixx is offline   Reply With Quote
Old 05-15-2013, 05:07 PM   #2
RagnarDa
3rd Party Developer
 
RagnarDa's Avatar
 
Join Date: Mar 2012
Posts: 1,441
Default

Nice work!

I made a similar script, though I'm glad that yours have a little different aim.
__________________
DCS AJS37 HACKERMAN

Bugs will happen
RagnarDa is offline   Reply With Quote
Old 05-15-2013, 07:14 PM   #3
dwpenney
Member
 
dwpenney's Avatar
 
Join Date: Dec 2008
Posts: 163
Default

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.
dwpenney is offline   Reply With Quote
Old 05-15-2013, 09:23 PM   #4
Joyride
Veteran
 
Joyride's Avatar
 
Join Date: Apr 2009
Location: Colorado, USA
Posts: 513
Default

Nice work, Psyrixx! I was looking forward to seeing this.

Your "first script" is much cleaner than my attempt.

dwpenney...here's a simple dynamic SAR scenario which spawns a solider ("pilot") at the ejection location: http://forums.eagle.ru/showpost.php?...7&postcount=43
Joyride is offline   Reply With Quote
Old 05-16-2013, 12:48 AM   #5
dwpenney
Member
 
dwpenney's Avatar
 
Join Date: Dec 2008
Posts: 163
Default

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.
dwpenney is offline   Reply With Quote
Old 05-16-2013, 06:04 AM   #6
SNAFU
Member
 
SNAFU's Avatar
 
Join Date: Jan 2009
Posts: 726
Default

Thank you very much, Psyrixx. Very helpful for learning! Great work!
__________________


Unsere Facebook-Seite
SNAFU is offline   Reply With Quote
Old 05-21-2013, 07:42 PM   #7
gunterlund21
Member
 
Join Date: Mar 2012
Location: Napa, Ca
Posts: 652
Default

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.
gunterlund21 is offline   Reply With Quote
Old 05-21-2013, 07:46 PM   #8
Psyrixx
Member
 
Psyrixx's Avatar
 
Join Date: Feb 2013
Location: San Francisco, CA
Posts: 501
Default

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.

=)
Psyrixx is offline   Reply With Quote
Old 06-22-2014, 08:01 AM   #9
ENO
Veteran
 
ENO's Avatar
 
Join Date: May 2012
Location: Okotoks, Alberta
Posts: 3,411
Default

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
ENO is offline   Reply With Quote
Reply

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