Jump to content

Dynamic Extraction Team Spawning (My Script Linked)


Psyrixx

Recommended Posts

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 by Psyrixx
  • Like 3

Robert Sogomonian | Psyrixx

website| e-mail | blog | youtube | twitter

Link to comment
Share on other sites

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

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

  • 1 year later...

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

  • Recently Browsing   0 members

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