Dangerzone Posted February 23, 2022 Posted February 23, 2022 Hi, Just wondering if anyone knows of a script that will allow routing of a C130 to a dynamic point (passing a vector), where it drops cargo and then spawns units at that location, or a way of performing this. I know in the C130 mod they've had the ability to load & parachute transport out the back which is mostly what I'm looking for, but with AI. I'd like to implement this into a mission where I can specify a point on a map dynamically, have some AI C17/130 take off from a designated base - fly direct to the given vector, and drop out re-enforcements like the C130 mod, but not sure if this has already been done or not, or where to start and was hoping someone could point me in the right direction? Thanks DZ
Grimes Posted February 23, 2022 Posted February 23, 2022 Easiest would be to add a command task to the route over the point where you want the AI to "drop" the unit at. dropList = {} function dropCargo(gp) local gName = gp:getName() if dropList[gName] then local point = gp:getUnit(1):getPoint() -- do whatever you need to do to spawn the contents of dropList[gName] at or near that location. end end --The task format needs to be rougly like this within a route. task = {["id"] = "ComboTask", ["params"] = {tasks = {{["params"] = {["action"] = { ["id"] = "Script", ["params"] = {["command"] = "local gp = ... dropCargo(gp)"}}}}}}} -- DO NOT CHANGE the ( ... ) that is literally a lua command. Gist is you make a table of cargo groups and their contents, then use a task that the AI do on passing a waypoint to execute a function that checks that table to see if it can drop anything. If there is then you can spawn the group as needed. Conversely you can just periodically check the location of that unit and get the distance from the drop point. If its within a certain range of that point then drop it. The command is "better" in the sense that the AI actually have to reach the destination and it executes automatically assuming its setup correctly. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Dangerzone Posted February 24, 2022 Author Posted February 24, 2022 18 hours ago, Grimes said: Easiest would be to add a command task to the route over the point where you want the AI to "drop" the unit at. dropList = {} function dropCargo(gp) local gName = gp:getName() if dropList[gName] then local point = gp:getUnit(1):getPoint() -- do whatever you need to do to spawn the contents of dropList[gName] at or near that location. end end --The task format needs to be rougly like this within a route. task = {["id"] = "ComboTask", ["params"] = {tasks = {{["params"] = {["action"] = { ["id"] = "Script", ["params"] = {["command"] = "local gp = ... dropCargo(gp)"}}}}}}} -- DO NOT CHANGE the ( ... ) that is literally a lua command. Gist is you make a table of cargo groups and their contents, then use a task that the AI do on passing a waypoint to execute a function that checks that table to see if it can drop anything. If there is then you can spawn the group as needed. Conversely you can just periodically check the location of that unit and get the distance from the drop point. If its within a certain range of that point then drop it. The command is "better" in the sense that the AI actually have to reach the destination and it executes automatically assuming its setup correctly. Thanks Grimes. So at this stage there's no animation and/or action available in DCS to do this. (Have cargo drop out of plane). It's a matter of getting a designated AI unit to fly over said point, and then 'pretending' that the unit has dropped cargo by just spawning a group on the ground when they're at that particular location. I appreciate the confirmation. Thank you!
Backy 51 Posted April 9, 2022 Posted April 9, 2022 Could you also trigger the Illumination Bomb to drop at that point and perhaps have that impact trigger the spawning of the Cargo Dropped Object. That way you'd at least get a visual eye candy of a parachute. Would that work Grimes? I don't need no stinkin' GPS! (except for PGMs :D) [sIGPIC][/sIGPIC]
Recommended Posts